Skip to content

Commit

Permalink
store harvest price data
Browse files Browse the repository at this point in the history
  • Loading branch information
seguido committed May 22, 2024
1 parent 35d5ef7 commit 69da433
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,13 @@ type BeefyCLVaultHarvestEvent @entity(immutable: true) {
totalSupply: BigInt!
"Total amount of reward pool shares at time of harvest"
rewardPoolTotalSupply: BigInt!

"Token 0 price in native at the time of the interaction. Expressed with 18 decimals."
token0ToNativePrice: BigInt!
"Token 1 price in native at the time of the interaction. Expressed with 18 decimals."
token1ToNativePrice: BigInt!
"Native token price at the time of the interaction. Expressed with 18 decimals."
nativeToUSDPrice: BigInt!
}

"""
Expand Down
3 changes: 3 additions & 0 deletions src/vault-compound.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ export function handleStrategyHarvest(event: HarvestEvent): void {
harvest.rewardPoolTotalSupply = vaultData.rewardPoolTotalSupply
harvest.compoundedAmount0 = event.params.fee0
harvest.compoundedAmount1 = event.params.fee1
harvest.token0ToNativePrice = vaultData.token0ToNativePrice
harvest.token1ToNativePrice = vaultData.token1ToNativePrice
harvest.nativeToUSDPrice = vaultData.nativeToUSDPrice
harvest.save()
}

Expand Down

0 comments on commit 69da433

Please sign in to comment.