Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/utils/pricing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ let STABLE_COINS: string[] = [

let MINIMUM_ETH_LOCKED = BigDecimal.fromString('60')

let Q192 = 2 ** 192
let Q192 = BigInt.fromI32(2).pow(192)
export function sqrtPriceX96ToTokenPrices(sqrtPriceX96: BigInt, token0: Token, token1: Token): BigDecimal[] {
let num = sqrtPriceX96.times(sqrtPriceX96).toBigDecimal()
let denom = BigDecimal.fromString(Q192.toString())
let denom = new BigDecimal(Q192)
let price1 = num
.div(denom)
.times(exponentToBigDecimal(token0.decimals))
Expand Down