diff --git a/src/queries/Vaults.graphql b/src/queries/Vaults.graphql index 449eaa9..89ec194 100644 --- a/src/queries/Vaults.graphql +++ b/src/queries/Vaults.graphql @@ -24,10 +24,8 @@ query Vaults($since: BigInt!, $first: Int = 1000, $skip: Int = 0) { orderDirection: desc ) { timestamp - underlyingMainAmount0 - underlyingMainAmount1 - underlyingAltAmount0 - underlyingAltAmount1 + underlyingAmount0 + underlyingAmount1 collectedAmount0 collectedAmount1 token0ToNativePrice diff --git a/src/routes/v1/vaults.ts b/src/routes/v1/vaults.ts index 47afc28..79c2a3b 100644 --- a/src/routes/v1/vaults.ts +++ b/src/routes/v1/vaults.ts @@ -127,13 +127,12 @@ const getVaultApy = (vault: VaultsQuery['clms'][0], periodSeconds: number, now: ) ), collectTimestamp: fromUnixTime(fee.timestamp), - totalValueLocked: interpretAsDecimal(fee.underlyingMainAmount0, token0.decimals) - .plus(interpretAsDecimal(fee.underlyingAltAmount0, token0.decimals)) + totalValueLocked: interpretAsDecimal(fee.underlyingAmount0, token0.decimals) .times(interpretAsDecimal(fee.token0ToNativePrice, 18)) .plus( - interpretAsDecimal(fee.underlyingMainAmount1, token1.decimals) - .plus(interpretAsDecimal(fee.underlyingAltAmount1, token1.decimals)) - .times(interpretAsDecimal(fee.token1ToNativePrice, 18)) + interpretAsDecimal(fee.underlyingAmount1, token1.decimals).times( + interpretAsDecimal(fee.token1ToNativePrice, 18) + ) ), })) );