-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aavev2 apr and apy #73
Conversation
193b57e
to
80a32c5
Compare
@@ -267,14 +267,14 @@ export interface ProtocolTokenApy extends Erc20Metadata { | |||
/** | |||
* Current apy of protocol pool | |||
*/ | |||
apyDecimal: string | |||
apyDecimal: number |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do we think about this change?
Having it as a string would make it tricky to work with it afterwards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No strong opinion. Dont see an issue atm
@@ -31,6 +33,14 @@ type AaveV2PoolMetadata = Record< | |||
} | |||
> | |||
|
|||
const protocolDataProviderContractAddresses: Partial<Record<Chain, string>> = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same contracts used for metadata, so I've just moved them as a constant for the whole file.
[Chain.Avalanche]: '0x65285E9dfab318f57051ab2b139ccCf232945451', | ||
} | ||
|
||
const RAY = 10 ** 27 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to their glossary, A ray is just a unit with 27 decimals of precision.
|
||
if ( | ||
!reserveConfigurationData.isActive || | ||
reserveConfigurationData.isFrozen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checks that the protocol token is active and not frozen.
Otherwise, they are not included in the metadata file.
8b82b81
to
aa19efd
Compare
"name": "Maker", | ||
"symbol": "MKR", | ||
"decimals": 18, | ||
"profitRaw": "7186772652009n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we are missing profit formatted number, but should do on separate mr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are not missing them, they are at the bottom.
They get printed like this because we add them at the end of the process (maybe we can apply some order when printing).
APR and APY calculation for AaveV2 pools.
Removes multiple frozen and inactive protocol tokens from AaveV2 metadata