Uniswap / v3-sdk

🛠 An SDK for building applications on top of Uniswap V3
MIT License
547 stars 425 forks source link

Query Pool State at Block Number/Time #110

Open sandeepmukh opened 2 years ago

sandeepmukh commented 2 years ago

Is there an easy way to query the liquidity state and price of a pool similar to the observe function from the SDK does?

marktoda commented 2 years ago

Hey @sandeepmukh - if you're looking for accurate live pricing your best bet may be to use the Quoter contract. Bindings in the SDK are here: https://github.com/Uniswap/v3-sdk/blob/fa4bcec4cf472781f00ac5701c4f58fde2c139ce/src/quoter.ts