Timeline for Computing the Uniswap V3 pair price from Q64.96 number
Current License: CC BY-SA 4.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 2, 2023 at 14:07 | comment | added | MShakeG | This is wrong/misleading, if the active liquidity in a pool is 0 then your function would attempt to divide by 0. Liquidity is irrelevant to calculating price, the only reason your function returns the correct price(provided liquidity != 0) is because your function can be reduced to the same formula as many of the other answers listed here: (sqrtPriceX96 * sqrtPriceX96 * 1e18)/(2^96 * 2 ^ 96) = (sqrtPriceX96*sqrtPriceX96 * 1e18)/(2^192) | |
Dec 2, 2023 at 12:43 | history | edited | MShakeG | CC BY-SA 4.0 |
fix code block indentation
|
Oct 6, 2022 at 8:46 | review | Late answers | |||
Oct 6, 2022 at 22:06 | |||||
S Oct 6, 2022 at 8:23 | review | First answers | |||
Oct 6, 2022 at 12:59 | |||||
S Oct 6, 2022 at 8:23 | history | answered | Navigator | CC BY-SA 4.0 |