Get price
Get price

Uniswap · Reads onchain state

Reads the spot price of one token in the other on a Uniswap pool. The pool you pick names its version, and the read follows it: a V2 pair's reserves price one whole base token through the router's quote, while a V3 or V4 pool's stored square-root price is converted to the same thing. It is the marginal price before fees, not an executable amount. The pools of one pair disagree, so the version and fee tier are named in the list, and the deepest pool is offered first. Reach for it to compare against an oracle price and detect a stale or manipulated pool, or to set a rough floor before a swap quote refines it.

On other protocols · 8