Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update mainnet minimum_eth_locked #226

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": false,
"singleQuote": true,
"printWidth": 120,
"trailingComma": "all"
}
5 changes: 0 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,5 @@
"npm-run-all": "^4.1.5",
"prettier": "^1.18.2",
"typescript": "^3.5.2"
},
"prettier": {
"printWidth": 120,
"semi": false,
"singleQuote": true
}
}
2 changes: 1 addition & 1 deletion src/mappings/pool/collect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function handleCollect(event: CollectEvent): void {
collectedAmountToken0,
token0 as Token,
collectedAmountToken1,
token1 as Token
token1 as Token,
)

// Reset tvl aggregates until new amounts calculated
Expand Down
2 changes: 1 addition & 1 deletion src/mappings/pool/swap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function handleSwap(event: SwapEvent): void {

// get amount that should be tracked only - div 2 because cant count both input and output as volume
const amountTotalUSDTracked = getTrackedAmountUSD(amount0Abs, token0 as Token, amount1Abs, token1 as Token).div(
BigDecimal.fromString('2')
BigDecimal.fromString('2'),
)
const amountTotalETHTracked = safeDiv(amountTotalUSDTracked, bundle.ethPriceUSD)
const amountTotalUSDUntracked = amount0USD.plus(amount1USD).div(BigDecimal.fromString('2'))
Expand Down
4 changes: 2 additions & 2 deletions src/utils/pricing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const STABLE_COINS: string[] = [
'0x4dd28568d05f09b02220b09c2cb307bfd837cb95',
]

const MINIMUM_ETH_LOCKED = BigDecimal.fromString('60')
const MINIMUM_ETH_LOCKED = BigDecimal.fromString('20')

const Q192 = BigInt.fromI32(2).pow(192 as u8)
export function sqrtPriceX96ToTokenPrices(sqrtPriceX96: BigInt, token0: Token, token1: Token): BigDecimal[] {
Expand Down Expand Up @@ -132,7 +132,7 @@ export function getTrackedAmountUSD(
tokenAmount0: BigDecimal,
token0: Token,
tokenAmount1: BigDecimal,
token1: Token
token1: Token,
): BigDecimal {
const bundle = Bundle.load('1')!
const price0USD = token0.derivedETH.times(bundle.ethPriceUSD)
Expand Down