Skip to content

Commit

Permalink
Rename harvest to compound
Browse files Browse the repository at this point in the history
  • Loading branch information
prevostc committed Mar 23, 2024
1 parent f667ed2 commit 3e40d8a
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 123 deletions.
130 changes: 65 additions & 65 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -286,16 +286,16 @@ type BeefyCLVault @entity {
"Transfer count for that vault"
cumulativeTransferCount: Int!

"The harvested amount of the first token"
cumulativeHarvestedAmount0: BigDecimal!
"The harvested amount of the second token"
cumulativeHarvestedAmount1: BigDecimal!
"The harvested amount of the first token in USD"
cumulativeHarvestedAmount0USD: BigDecimal!
"The harvested amount of the second token in USD"
cumulativeHarvestedAmount1USD: BigDecimal!
"The harvested amount in USD"
cumulativeHarvestValueUSD: BigDecimal!
"The compounded amount of the first token"
cumulativeCompoundedAmount0: BigDecimal!
"The compounded amount of the second token"
cumulativeCompoundedAmount1: BigDecimal!
"The compounded amount of the first token in USD"
cumulativeCompoundedAmount0USD: BigDecimal!
"The compounded amount of the second token in USD"
cumulativeCompoundedAmount1USD: BigDecimal!
"The compounded amount in USD"
cumulativeCompoundedValueUSD: BigDecimal!

"Amount of native token charged as call fee incentive"
cumulativeHarvesterFeeCollectedNative: BigDecimal!
Expand Down Expand Up @@ -395,16 +395,16 @@ type BeefyCLVaultSnapshot implements Snapshot @entity {
"Transfer count for that vault"
transferCount: Int!

"The harvested amount of the first token"
harvestedAmount0: BigDecimal!
"The harvested amount of the second token"
harvestedAmount1: BigDecimal!
"The harvested amount of the first token in USD"
harvestedAmount0USD: BigDecimal!
"The harvested amount of the second token in USD"
harvestedAmount1USD: BigDecimal!
"The harvested amount in USD"
harvestValueUSD: BigDecimal!
"The compounded amount of the first token"
compoundedAmount0: BigDecimal!
"The compounded amount of the second token"
compoundedAmount1: BigDecimal!
"The compounded amount of the first token in USD"
compoundedAmount0USD: BigDecimal!
"The compounded amount of the second token in USD"
compoundedAmount1USD: BigDecimal!
"The compounded amount in USD"
compoundedValueUSD: BigDecimal!

"Amount of native token charged as call fee incentive"
harvesterFeeCollectedNative: BigDecimal!
Expand Down Expand Up @@ -479,16 +479,16 @@ type BeefyCLVaultHarvestEvent @entity(immutable: true) {
"Total value locked in the vault after the harvest in USD"
totalValueLockedUSD: BigDecimal!

"The amount of first underlying tokens harvested"
harvestedAmount0: BigDecimal!
"The amount of second underlying tokens harvested"
harvestedAmount1: BigDecimal!
"The amount of first underlying tokens harvested in USD"
harvestedAmount0USD: BigDecimal!
"The amount of second underlying tokens harvested in USD"
harvestedAmount1USD: BigDecimal!
"Total usd value of the harvest"
harvestValueUSD: BigDecimal!
"The amount of first underlying tokens compounded"
compoundedAmount0: BigDecimal!
"The amount of second underlying tokens compounded"
compoundedAmount1: BigDecimal!
"The amount of first underlying tokens compounded in USD"
compoundedAmount0USD: BigDecimal!
"The amount of second underlying tokens compounded in USD"
compoundedAmount1USD: BigDecimal!
"Total usd value of the compounded"
compoundedValueUSD: BigDecimal!

"Price of the first token in expressed as the second token at the time of the harvest"
priceOfToken0InToken1: BigDecimal!
Expand All @@ -504,26 +504,26 @@ type BeefyCLVaultUnderlyingFeesCollectedEvent @entity(immutable: true) {
"transaction hash + log index"
id: Bytes!

"The vault the harvest event is for"
"The vault the collect event is for"
vault: BeefyCLVault!
"The strategy that harvested the vault"
"The strategy that collect for the vault"
strategy: BeefyCLStrategy!

"The transaction that created the vault harvest event"
"The transaction that created the vault collect event"
createdWith: Transaction!

"The timestamp of the harvest event so you can sort by time"
"The timestamp of the collect event so you can sort by time"
timestamp: BigInt!

"Underlying balance of the first token after the harvest"
"Underlying balance of the first token after the collect"
underlyingAmount0: BigDecimal!
"Underlying balance of the second token after the harvest"
"Underlying balance of the second token after the collect"
underlyingAmount1: BigDecimal!
"Underlying balance of the first token after the harvest in USD"
"Underlying balance of the first token after the collect in USD"
underlyingAmount0USD: BigDecimal!
"Underlying balance of the second token after the harvest in USD"
"Underlying balance of the second token after the collect in USD"
underlyingAmount1USD: BigDecimal!
"Total value locked in the vault after the harvest in USD"
"Total value locked in the vault after the collect in USD"
totalValueLockedUSD: BigDecimal!

"Amount of collected fees in the first token"
Expand All @@ -537,9 +537,9 @@ type BeefyCLVaultUnderlyingFeesCollectedEvent @entity(immutable: true) {
"Total usd value of the collected fees"
collectedValueUSD: BigDecimal!

"Price of the first token in expressed as the second token at the time of the harvest"
"Price of the first token in expressed as the second token at the time of the collect"
priceOfToken0InToken1: BigDecimal!
"Price of the first token in USD at the time of the harvest"
"Price of the first token in USD at the time of the collect"
priceOfToken0InUSD: BigDecimal!
}

Expand Down Expand Up @@ -634,8 +634,8 @@ type Investor @entity {
"All withdraws of the investor"
cumulativeWithdrawCount: Int!

"All time harvested amount in USD"
cumulativeHarvestValueUSD: BigDecimal!
"All time compounded amount in USD"
cumulativeCompoundedValueUSD: BigDecimal!

"All investor beefy positions"
positions: [InvestorPosition!]! @derivedFrom(field: "investor")
Expand Down Expand Up @@ -683,8 +683,8 @@ type InvestorSnapshot implements Snapshot @entity {
"Withdraws count for the investor at the time of the snapshot"
withdrawCount: Int!

"The harvested amount in USD at the time of the snapshot"
harvestValueUSD: BigDecimal!
"The compounded amount in USD at the time of the snapshot"
compoundedValueUSD: BigDecimal!
}

"""
Expand Down Expand Up @@ -740,16 +740,16 @@ type InvestorPosition @entity {
"The last daily position values in USD for the last 30 days. Most recent last."
last30DailyPositionValuesUSD: [BigDecimal!]!

"The harvested amount of the first token"
cumulativeHarvestedAmount0: BigDecimal!
"The harvested amount of the second token"
cumulativeHarvestedAmount1: BigDecimal!
"The harvested amount of the first token in USD"
cumulativeHarvestedAmount0USD: BigDecimal!
"The harvested amount of the second token in USD"
cumulativeHarvestedAmount1USD: BigDecimal!
"The harvested amount in USD"
cumulativeHarvestValueUSD: BigDecimal!
"The compounded amount of the first token"
cumulativeCompoundedAmount0: BigDecimal!
"The compounded amount of the second token"
cumulativeCompoundedAmount1: BigDecimal!
"The compounded amount of the first token in USD"
cumulativeCompoundedAmount0USD: BigDecimal!
"The compounded amount of the second token in USD"
cumulativeCompoundedAmount1USD: BigDecimal!
"The compounded amount in USD"
cumulativeCompoundedValueUSD: BigDecimal!

"All investor position snapshots"
snapshots: [InvestorPositionSnapshot!]! @derivedFrom(field: "investorPosition")
Expand Down Expand Up @@ -800,16 +800,16 @@ type InvestorPositionSnapshot implements Snapshot @entity {
"Current position value in USD"
positionValueUSD: BigDecimal!

"The harvested amount of the first token at the time of the snapshot"
harvestedAmount0: BigDecimal!
"The harvested amount of the second token at the time of the snapshot"
harvestedAmount1: BigDecimal!
"The harvested amount of the first token in USD at the time of the snapshot"
harvestedAmount0USD: BigDecimal!
"The harvested amount of the second token in USD at the time of the snapshot"
harvestedAmount1USD: BigDecimal!
"The harvested amount in USD at the time of the snapshot"
harvestValueUSD: BigDecimal!
"The compounded amount of the first token at the time of the snapshot"
compoundedAmount0: BigDecimal!
"The compounded amount of the second token at the time of the snapshot"
compoundedAmount1: BigDecimal!
"The compounded amount of the first token in USD at the time of the snapshot"
compoundedAmount0USD: BigDecimal!
"The compounded amount of the second token in USD at the time of the snapshot"
compoundedAmount1USD: BigDecimal!
"The compounded amount in USD at the time of the snapshot"
compoundedValueUSD: BigDecimal!
}

enum InvestorPositionInteractionType {
Expand Down
4 changes: 2 additions & 2 deletions src/entity/investor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function getInvestor(accountAddress: Bytes): Investor {
investor.cumulativeInteractionsCount = 0
investor.cumulativeDepositCount = 0
investor.cumulativeWithdrawCount = 0
investor.cumulativeHarvestValueUSD = ZERO_BD
investor.cumulativeCompoundedValueUSD = ZERO_BD
}

return investor
Expand All @@ -43,7 +43,7 @@ export function getInvestorSnapshot(investor: Investor, timestamp: BigInt, perio
snapshot.interactionsCount = 0
snapshot.depositCount = 0
snapshot.withdrawCount = 0
snapshot.harvestValueUSD = ZERO_BD
snapshot.compoundedValueUSD = ZERO_BD
}

// copy non-reseting values from the previous snapshot to the new snapshot
Expand Down
20 changes: 10 additions & 10 deletions src/entity/position.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ export function getInvestorPosition(vault: BeefyCLVault, investor: Investor): In
position.positionValueUSD = ZERO_BD
position.averageDailyPositionValueUSD30D = ZERO_BD
position.last30DailyPositionValuesUSD = new Array<BigDecimal>()
position.cumulativeHarvestedAmount0 = ZERO_BD
position.cumulativeHarvestedAmount1 = ZERO_BD
position.cumulativeHarvestedAmount0USD = ZERO_BD
position.cumulativeHarvestedAmount1USD = ZERO_BD
position.cumulativeHarvestValueUSD = ZERO_BD
position.cumulativeCompoundedAmount0 = ZERO_BD
position.cumulativeCompoundedAmount1 = ZERO_BD
position.cumulativeCompoundedAmount0USD = ZERO_BD
position.cumulativeCompoundedAmount1USD = ZERO_BD
position.cumulativeCompoundedValueUSD = ZERO_BD
}
return position
}
Expand All @@ -64,11 +64,11 @@ export function getInvestorPositionSnapshot(
snapshot.underlyingBalance0USD = ZERO_BD
snapshot.underlyingBalance1USD = ZERO_BD
snapshot.positionValueUSD = ZERO_BD
snapshot.harvestedAmount0 = ZERO_BD
snapshot.harvestedAmount1 = ZERO_BD
snapshot.harvestedAmount0USD = ZERO_BD
snapshot.harvestedAmount1USD = ZERO_BD
snapshot.harvestValueUSD = ZERO_BD
snapshot.compoundedAmount0 = ZERO_BD
snapshot.compoundedAmount1 = ZERO_BD
snapshot.compoundedAmount0USD = ZERO_BD
snapshot.compoundedAmount1USD = ZERO_BD
snapshot.compoundedValueUSD = ZERO_BD
}

// copy non-reseting values from the previous snapshot to the new snapshot
Expand Down
20 changes: 10 additions & 10 deletions src/entity/vault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ export function getBeefyCLVault(vaultAddress: Bytes): BeefyCLVault {
vault.cumulativeDepositCount = 0
vault.cumulativeWithdrawCount = 0
vault.cumulativeTransferCount = 0
vault.cumulativeHarvestedAmount0 = ZERO_BD
vault.cumulativeHarvestedAmount1 = ZERO_BD
vault.cumulativeHarvestedAmount0USD = ZERO_BD
vault.cumulativeHarvestedAmount1USD = ZERO_BD
vault.cumulativeHarvestValueUSD = ZERO_BD
vault.cumulativeCompoundedAmount0 = ZERO_BD
vault.cumulativeCompoundedAmount1 = ZERO_BD
vault.cumulativeCompoundedAmount0USD = ZERO_BD
vault.cumulativeCompoundedAmount1USD = ZERO_BD
vault.cumulativeCompoundedValueUSD = ZERO_BD
vault.cumulativeHarvesterFeeCollectedNative = ZERO_BD
vault.cumulativeProtocolFeeCollectedNative = ZERO_BD
vault.cumulativeStrategistFeeCollectedNative = ZERO_BD
Expand Down Expand Up @@ -95,11 +95,11 @@ export function getBeefyCLVaultSnapshot(vault: BeefyCLVault, timestamp: BigInt,
snapshot.depositCount = 0
snapshot.withdrawCount = 0
snapshot.transferCount = 0
snapshot.harvestedAmount0 = ZERO_BD
snapshot.harvestedAmount1 = ZERO_BD
snapshot.harvestedAmount0USD = ZERO_BD
snapshot.harvestedAmount1USD = ZERO_BD
snapshot.harvestValueUSD = ZERO_BD
snapshot.compoundedAmount0 = ZERO_BD
snapshot.compoundedAmount1 = ZERO_BD
snapshot.compoundedAmount0USD = ZERO_BD
snapshot.compoundedAmount1USD = ZERO_BD
snapshot.compoundedValueUSD = ZERO_BD
snapshot.harvesterFeeCollectedNative = ZERO_BD
snapshot.protocolFeeCollectedNative = ZERO_BD
snapshot.strategistFeeCollectedNative = ZERO_BD
Expand Down
Loading

0 comments on commit 3e40d8a

Please sign in to comment.