From d1e1ec3e8470cee9ef9b90175d0ceace17c69383 Mon Sep 17 00:00:00 2001 From: Michael Wang <44713145+mzywang@users.noreply.github.com> Date: Wed, 24 Apr 2024 13:26:36 -0400 Subject: [PATCH] fix typo --- src/utils/pricing.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/utils/pricing.ts b/src/utils/pricing.ts index c3481ecc..7ce77fed 100644 --- a/src/utils/pricing.ts +++ b/src/utils/pricing.ts @@ -7,16 +7,13 @@ import { ONE_BD, ZERO_BD, ZERO_BI } from './constants' const WETH_ADDRESS = '0x4200000000000000000000000000000000000006' const USDC_WETH_05_POOL = '0x4c36388be6f416a29c8d8eee81c771ce6be14b18' +const USDC_ADDRESS = '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913' + // token where amounts should contribute to tracked volume and liquidity // usually tokens that many tokens are paired with s -export const WHITELIST_TOKENS: string[] = [ - WETH_ADDRESS, // WETH - '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913', // USDC -] +export const WHITELIST_TOKENS: string[] = [WETH_ADDRESS, USDC_ADDRESS] -const STABLE_COINS: string[] = [ - '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913', // USDC -] +const STABLE_COINS: string[] = [USDC_ADDRESS] const MINIMUM_ETH_LOCKED = BigDecimal.fromString('1') @@ -24,7 +21,10 @@ const Q192 = BigInt.fromI32(2).pow(192 as u8) export function sqrtPriceX96ToTokenPrices(sqrtPriceX96: BigInt, token0: Token, token1: Token): BigDecimal[] { const num = sqrtPriceX96.times(sqrtPriceX96).toBigDecimal() const denom = BigDecimal.fromString(Q192.toString()) - const price1 = num.div(denom).times(exponentToBigDecimal(token0.decimals)).div(exponentToBigDecimal(token1.decimals)) + const price1 = num + .div(denom) + .times(exponentToBigDecimal(token0.decimals)) + .div(exponentToBigDecimal(token1.decimals)) const price0 = safeDiv(BigDecimal.fromString('1'), price1) return [price0, price1] @@ -32,7 +32,7 @@ export function sqrtPriceX96ToTokenPrices(sqrtPriceX96: BigInt, token0: Token, t export function getEthPriceInUSD(): BigDecimal { // fetch eth prices for each stablecoin - const usdcPool = Pool.load(USDC_WETH_05_POOL) // dai is token0 + const usdcPool = Pool.load(USDC_WETH_05_POOL) // usdc is token1 if (usdcPool !== null) { return usdcPool.token1Price } else {