Skip to content

Commit

Permalink
fix(lint): auto-fix [ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
mzywang committed Apr 23, 2024
1 parent b6e26cd commit b81a7ed
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/mappings/pool/burn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
updatePoolHourData,
updateTokenDayData,
updateTokenHourData,
updateUniswapDayData
updateUniswapDayData,
} from '../../utils/intervalUpdates'

// Note: this handler need not adjust TVL because that is accounted for in the handleCollect handler
Expand Down
2 changes: 1 addition & 1 deletion src/mappings/pool/collect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
updatePoolHourData,
updateTokenDayData,
updateTokenHourData,
updateUniswapDayData
updateUniswapDayData,
} from '../../utils/intervalUpdates'
import { getTrackedAmountUSD } from '../../utils/pricing'

Expand Down
9 changes: 3 additions & 6 deletions src/utils/pricing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ const USDC_WETH_05_POOL = '0x4c36388be6f416a29c8d8eee81c771ce6be14b18'
// usually tokens that many tokens are paired with s
export const WHITELIST_TOKENS: string[] = [
WETH_ADDRESS, // WETH
'0x833589fcd6edb6e08f4c7c32d4f71b54bda02913' // USDC
'0x833589fcd6edb6e08f4c7c32d4f71b54bda02913', // USDC
]

const STABLE_COINS: string[] = [
'0x833589fcd6edb6e08f4c7c32d4f71b54bda02913' // USDC
'0x833589fcd6edb6e08f4c7c32d4f71b54bda02913', // USDC
]

const MINIMUM_ETH_LOCKED = BigDecimal.fromString('1')
Expand All @@ -24,10 +24,7 @@ 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]
Expand Down

0 comments on commit b81a7ed

Please sign in to comment.