You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is "outstanding treasury income"?
This is the accruedToTreasury field in the aave subgraph you use. And that coincides with accruedToTreasury in aave smart contracts.
What is accruedToTreasury?
"//the current treasury balance, scaled" - per comment in contracts
How does this field behave?
This is essentially a counter for reserve accrued interest, and once it is large enough a MintToTreasury event is emitted and the counter is reset to 0, and the value (in aTokens) is minted to the treasury.
Why is this wrong?
This is not a strictly increasing field. So it is reset to 0, and when you subtract current value by yesterday's value it is possible to get negative values. Doesn't seem to be handled in the open source code, so I am guessing you do something internally to hide these values.
This value is really just lifetimeReserveFactorAccrued or treasuryIncomeUSD (in the adapters). So it is double counting fees generated to the protocol from user interest sent to the treasury.
What are the effects?
There are pretty massive $1mm+ spikes, that don't coincide with the actual revenue.
Source: https://defillama.com/protocol/aave-v3
The text was updated successfully, but these errors were encountered:
Hey defillama team,
I am over at messari and noticed a bug in how you are calculating the fees for aave v3 (likely other aave protocols and forks).
dimension-adapters/fees/aave/index.ts
Line 392 in ce9c198
What is "outstanding treasury income"?
This is the
accruedToTreasury
field in the aave subgraph you use. And that coincides withaccruedToTreasury
in aave smart contracts.What is
accruedToTreasury
?"//the current treasury balance, scaled" - per comment in contracts
How does this field behave?
This is essentially a counter for reserve accrued interest, and once it is large enough a
MintToTreasury
event is emitted and the counter is reset to 0, and the value (in aTokens) is minted to the treasury.Why is this wrong?
lifetimeReserveFactorAccrued
ortreasuryIncomeUSD
(in the adapters). So it is double counting fees generated to the protocol from user interest sent to the treasury.What are the effects?
Source: https://defillama.com/protocol/aave-v3There are pretty massive $1mm+ spikes, that don't coincide with the actual revenue.
The text was updated successfully, but these errors were encountered: