From 427ad8d8517edce9bb380d62fbb2cfe25307b580 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Pr=C3=A9vost?= <998369+prevostc@users.noreply.github.com> Date: Sun, 24 Mar 2024 22:13:20 +0100 Subject: [PATCH] Fix APR --- src/vault-compound.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vault-compound.ts b/src/vault-compound.ts index 34e19af..e986ab4 100644 --- a/src/vault-compound.ts +++ b/src/vault-compound.ts @@ -341,7 +341,7 @@ export function handleStrategyClaimedFees(event: ClaimedFeesEvent): void { vault.underlyingAmount1USD = vault.underlyingAmount1.times(token1PriceInUSD) vault.totalValueLockedUSD = vault.underlyingAmount0USD.plus(vault.underlyingAmount1USD) let aprState = AprState.deserialize(vault.aprState) - aprState.addTransaction(collectedAmount0, event.block.timestamp, vault.underlyingAmount0USD) + aprState.addTransaction(collect.collectedValueUSD, event.block.timestamp, collect.totalValueLockedUSD) vault.apr1D = AprCalc.calculateLastApr(DAY, aprState, event.block.timestamp) vault.apr7D = AprCalc.calculateLastApr(DAY.times(BigInt.fromU32(7)), aprState, event.block.timestamp) vault.apr30D = AprCalc.calculateLastApr(DAY.times(BigInt.fromU32(30)), aprState, event.block.timestamp)