-
Notifications
You must be signed in to change notification settings - Fork 44
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
NotionalV2 Strategy #72
base: master
Are you sure you want to change the base?
Conversation
0x8eae010b847722fa95e85dfc0113c19f46531a85595a4a8aeb38cb97657d35c4; | ||
bytes32 internal constant _NTOKEN_UNDERLYING = 0xca1ad68fb46e1d177e14769fefa6ec6792476f949c8cd88042b7f02ed2f5d2e2; | ||
|
||
address public constant weth = address(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); |
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.
ise CAPITAL_CASE for contants
IERC20(_nTokenUnderlying).safeApprove(_rewardPool, underlyingBalance); | ||
} | ||
|
||
Types.BalanceAction memory action = Types.BalanceAction( |
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.
better to use Type creations via JSON, make reviewer work a bit easy :)
IBVault.FundManagement memory funds; | ||
funds.sender = address(this); | ||
funds.fromInternalBalance = false; | ||
funds.recipient = address(uint160(address(this))); |
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.
is it necessary wrapping?
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 need it to cast address
to payable address
.
address _underlying, | ||
address _vault, | ||
address _rewardPool, // always the notional proxy, could be constant, | ||
address _bVault, |
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 make it static variable
} | ||
|
||
function investedUnderlyingBalance() public view returns (uint256) { | ||
uint256 underlyingBalance = IERC20(underlying()).balanceOf(address(this)); |
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.
inline please
address _vault, | ||
address _rewardPool, // always the notional proxy, could be constant, | ||
address _bVault, | ||
bytes32 _note2wethpid, |
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.
can be static for reduce gas usage
New strategy for Notional V2. We hold the
nTokens
and claimNOTE
rewards and compound those rewards into morenTokens
.The
nTokens
are liquidity share token, users provide liquidity to the Notional and get back thenTokens
. More informations aboutnTokens
here.The reward token of this strategy is
WETH
. We swap theNOTE
rewards toWETH
and then swapWETH
to the underlying of thenToken
to mint morenToken
.Added the test outputs for ETH and DAI since the Notional receives native
ETH
instead ofWETH
.Test outputs at blockNumber = 15003364: