What is sqrtPriceX96 in Uniswap V3 Pools | Napkin Math to get Price from sqrtRatioX96 / sqrtPriceX96
Blockman Codes Blockman Codes
6.69K subscribers
5,092 views
0

 Published On Nov 11, 2022

Get my free EthersJS cheatsheet to master Web3!
👉 https://blockman-codes.ck.page/91b29a...
------------------------------------------
Courses:
👉 Build a Uniswap V3 interface that can do swaps: https://bit.ly/3JkXYqL
------------------------------------------

How do you get the ratio between 2 tokens in the Uniswap V3 app from the sqrtPriceX96 or sqrtRatioX96? And how do you do it without importing functions from Uniswap libraries? The math to convert sqrtPriceX96 to the human-readable price is actually very simple, even though the sqrtPriceX96 on its own seems like an incomprehensible number. I'll explain exactly what sqrtPriceX96 is. And walk through the napkin math from it to the price ratio you see in the Uniswap V3 app.

show more

Share/Embed