Skip to content

Aave PCV Deposit#128

Merged
Joeysantoro merged 10 commits intofeat/wethPCVDepositBasefrom
feat/AavePCVDeposit
Aug 17, 2021
Merged

Aave PCV Deposit#128
Joeysantoro merged 10 commits intofeat/wethPCVDepositBasefrom
feat/AavePCVDeposit

Conversation

@Joeysantoro
Copy link
Contributor

An Aave PCV deposit similar to the Compound one. Uses WethPCVDeposit to support ETH deposits into Aave

@Joeysantoro Joeysantoro marked this pull request as ready for review August 14, 2021 01:07

/// @notice returns total balance of PCV in the Deposit
function balance() public view override returns (uint256) {
return aToken.balanceOf(address(this));
Copy link
Contributor

@eswak eswak Aug 14, 2021

Choose a reason for hiding this comment

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

is that the balance of underlying tokens, or the amount of aTokens ? I think it's better if we return an amount in underlying tokens, it will be more convenient to find an oracle price for these

Copy link
Contributor

@eswak eswak Aug 14, 2021

Choose a reason for hiding this comment

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

nvm :

image

you could add a @dev comment for clarity

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call, shouldn't expect devs to know aTokens are rebasing

Copy link
Contributor

Choose a reason for hiding this comment

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

technically it's aWETH 🤓

Copy link
Contributor

@eswak eswak Aug 14, 2021

Choose a reason for hiding this comment

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

If you want, you could also write logging && console.log(...); & not have to bother with : undefined at the end

Comment on lines +324 to +335
await aaveEthPCVDeposit.deposit();

await aaveEthPCVDeposit.claimRewards();
const aaveBalanceAfter = await contracts.stAAVE.balanceOf(aaveEthPCVDeposit.address);

expect(aaveBalanceAfter.sub(aaveBalanceBefore)).to.be.bignumber.greaterThan(toBN(0));
Copy link
Contributor

Choose a reason for hiding this comment

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

How come the rewards balance is not 0 if the deposit just happened ?

I guess you could add a small time fast-forward in your test, to check that you earn some interest?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Time did fast forward at least 1 second/block between the deposit and the claim

@Joeysantoro Joeysantoro force-pushed the feat/wethPCVDepositBase branch from f82b7a3 to 1b687b7 Compare August 14, 2021 22:27
@Joeysantoro Joeysantoro merged commit 2df4a78 into feat/wethPCVDepositBase Aug 17, 2021
@xklob xklob deleted the feat/AavePCVDeposit branch September 19, 2021 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments