There was an error while loading. Please reload this page.
1 parent 5ef0e66 commit bdaf62eCopy full SHA for bdaf62e
1 file changed
src/utils/pricing.ts
@@ -17,10 +17,7 @@ export function sqrtPriceX96ToTokenPrices(
17
18
const num = sqrtPriceX96.times(sqrtPriceX96).toBigDecimal()
19
const denom = BigDecimal.fromString(Q192.toString())
20
- const price1 = num
21
- .div(denom)
22
- .times(exponentToBigDecimal(token0Decimals))
23
- .div(exponentToBigDecimal(token1Decimals))
+ const price1 = num.div(denom).times(exponentToBigDecimal(token0Decimals)).div(exponentToBigDecimal(token1Decimals))
24
25
const price0 = safeDiv(BigDecimal.fromString('1'), price1)
26
return [price0, price1]
0 commit comments