Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/strategies/contract-call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,20 @@ export default async function getValue(
}

// AAVE effective balance from Liquidity Pool
if (
const aaveFromLP =
params.address.toLowerCase() ===
'0xC0259c59D9f980E3b5e2574cD78C9A9Bc6A8E3fc' &&
params.methodABI?.name === 'balanceOf' &&
params.network === 1
) {
params.network === 1;

// AAVE base/staked/lended token
const aaveToken =
params.address.toLowerCase() ===
'0xa198Fac58E02A5C5F8F7e877895d50cFa9ad1E04' &&

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this has always the same value than AAVE right?

params.methodABI?.name === 'getFullVotingPower' &&

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And getFullVotingPower is just the balance?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not exactly, it's returning the voting power, which is coming from the delegated balance.

So if a user has 100 aave, and delegated to himself, he get 100
If a user has 0 aave, but got delegated 100 aave by someone else, he get 100
If a user has 100 aave, but not delegated them, he get 0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok but that's always 1 vp = 1 AAVE token.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

params.network === 1;

if (aaveFromLP || aaveToken) {
return erc20BalanceOf(
{
...params,
Expand Down