Skip to main content

Event Reference And Use Cases

This reference lists all key on-chain events tracked by the Earn V2 subgraph and how they update entities.

Factory-Level Events

EventEntity UpdatedDescription
VaultDeployedFactory, VaultNew vault instance created by factory
VaultMigratedFactory, VaultMigrated vault from older version
VaultRegisteredFactory, VaultExternal vault imported into registry
ApprovedImplementationFactoryImplementation added to upgrade list

Vault-Level Events

EventEntity UpdatedDescription
DepositVault, Account, SharesBalanceUser deposit; increases vault total supply
WithdrawVault, Account, SharesBalanceUser withdrawal; decreases supply
YieldAccruedVaultReflects updated yield and share price
ManagementFeeAccruedVaultAdds to totalManagementFeeAccrued
PerformanceFeeAccruedVaultAdds to totalPerformanceFeeAccrued

Async Vault Events

EventEntity UpdatedDescription
EpochProcessedVaultNew epoch finalized
QueuedWithdrawalWithdrawalQueueUser creates pending withdrawal
RequestCancelledWithdrawalQueueRequest deleted from queue
RequestClaimedWithdrawalQueueMarks claim complete
RequestMovedToNextEpochWithdrawalQueueShifts request to next epoch

Strategy Events

EventEntity UpdatedDescription
StrategyYieldAccruedStrategyUpdates allocatedValue and yield accounting
StrategyWithdrawStrategyReduces allocated value
AllocateFundsStrategyIncreases allocation; emitted by AllocateModule
DeallocateFundsStrategyMoves funds back to vault
AdjustTotalAssetsStrategy(Multisig) Adjusts position value manually
AssetsForwardedStrategy(Multisig) Confirms custody movement
AssetsRetrievedStrategy(Multisig) Confirms returned funds

Aggregation Event Sources

EventUsed ForDescription
VaultBalanceUpdatedVaultStatsTracks share price and assets over time
VaultFeesAccruedVaultFeesStatsAggregates daily fee data
NewUserNewUserStatsTracks first-time depositor/receiver actions

Typical Query Examples

Query all vaults for a factory:

{
factories {
id
vaultCount
vaults {
id
name
sharePrice
totalSupply
}
}
}

Query daily vault stats:

{
vaultStats(interval: day, first: 30) {
timestamp
vault { name }
totalSupply
sharePrice
}
}

Query pending withdrawal queue for a vault:

{
withdrawalQueues(where: { vault: "0x123..." }) {
account { id }
epochID
shares
}
}