-
Notifications
You must be signed in to change notification settings - Fork 0
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
Aave V3 - Opty 1560 #3
base: main
Are you sure you want to change the base?
Conversation
function getPoolValue(address _liquidityPoolAddressProviderRegistry, address _underlyingToken) | ||
public | ||
view | ||
override | ||
returns (uint256) | ||
{ | ||
return | ||
ERC20(_underlyingToken).balanceOf( | ||
getLiquidityPoolToken(_underlyingToken, _liquidityPoolAddressProviderRegistry) | ||
); | ||
} |
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.
For this function, should we rely on the underlying token balance of the aToken contract (supplied - borrowed) or should we rely on the total underlying tokens supplied?
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.
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.
However, your point may be right, In V3 they replace availableLiquidity with totalAToken, which is the total supply of a token
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.
@dhruvinparikh we need your opinion.
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.
Liquidity is the cash in underlying token available within the pool, For AaveV3, I checked the underlying token is being held in atoken contract.
contracts/AaveV3Adapter.sol
Outdated
/** | ||
* @notice the A tokens list that is used for claiming reward token | ||
*/ | ||
address[] public aaveAssetsList; |
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.
When Aave updates this list, would it be more costly to update this variable or to take all the aToken addresses from the getReserveData function in Lending Pool contract by running a for loop?
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.
_assetsList in Aave is also an array, so if they add more tokens, we need to update our variable also. This variable aaveAssetsList
is because Aave rewards functions require _assetsList as a param.
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.
@mariogutval to take all the aToken addresses from the getReserveData function in Lending Pool contract by running a for loop
I'm not sure what you mean. In the Adapter, I don't call getReserveData in Lending Pool contract.
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 doubt if there even need to for assetList Array as the vault will have atmost hold only single aToken , I can see it is used for claiming rewards and reading unclaimed rewards; we need just pass the single array element with one aToken address to the parameter that accepts aaveAssetList.
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.
To do that, I will need to find a way to get the aToken based on its underlying token. If not, I will create a mapping.
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 found it, will implement it
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.
addressed
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.
You can keep separate behaviour test files being called from single setup test.For e.g.
https://github.com/Opty-Fi/curve-polygon-adapter/blob/main/test/CurveFinanceAdapter.ts
@dhruvinparikh Feedback is addressed |
const aaveV3AdapterArtifact: Artifact = await hre.artifacts.readArtifact("AaveV3Adapter"); | ||
this.aaveV3Adapter = <AaveV3Adapter>( | ||
await hre.waffle.deployContract(this.signers.deployer, aaveV3AdapterArtifact, [this.mockRegistry.address]) | ||
); | ||
}); | ||
Object.keys(pools).map((token: string) => { | ||
const poolItem: PoolItem = pools[token]; | ||
shouldBeHaveLikeAaveAdapter(token, poolItem); | ||
}); |
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.
- Enclose it in a separate describe with title "AaveV2 On Polygon"
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.
addressed
test/AaveFinanceAdapter.ts
Outdated
Object.keys(poolsV3).map((token: string) => { | ||
const poolItem: PoolItem = poolsV3[token]; | ||
shouldBeHaveLikeAaveV3Adapter(token, poolItem); | ||
}); |
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.
- Enclose it in a separate describe with title "AaveV3 On Polygon"
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.
addressed
For @mariogutval
|
No description provided.