Skip to content

Commit

Permalink
Fix APR
Browse files Browse the repository at this point in the history
  • Loading branch information
prevostc committed Mar 24, 2024
1 parent d7fe087 commit 427ad8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/vault-compound.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 427ad8d

Please sign in to comment.