-
Notifications
You must be signed in to change notification settings - Fork 6
WIP Ethena sUSDe <> USDe ARM #147
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
base: main
Are you sure you want to change the base?
Conversation
* Add EthenaARM integration tests and shared setup * Rename test file * Add integration tests for swapTokensForExactTokens functionality in EthenaARM * Refactor swapExactTokensForTokens tests for clarity and correctness * Remove unused IERC721Receiver import from EthenaARM contract
* Enhance EthenaARM to support multiple unstaker contracts for parallel cooldown requests * Fix type casting for last used unstaker index to ensure proper indexing * Simplify array management * Implement request delay for unstake requests and update visibility of state variables * Refactor comments in EthenaARM contract for clarity and consistency * Remove unused imports and clean up comments in EthenaARM contract * Refactor EthenaARM contract to use constant for maximum unstakers and update related code for clarity
src/contracts/EthenaARM.sol
Outdated
| require(unstaker != address(0), "EthenaARM: Invalid unstaker"); | ||
|
|
||
| // Ensure unstaker isn't used during last 7 days | ||
| uint256 amount = EthenaUnstaker(unstaker).cooldownAmount(); |
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.
this can call cooldowns on sUSDe directly rather than going via the helper
src/contracts/EthenaARM.sol
Outdated
| /// @notice Claim all the USDe that is now claimable from the Staked USDe contract. | ||
| /// Reverts with `InvalidCooldown` from the Staked USDe contract if the cooldown period has not yet passed. | ||
| function claimBaseWithdrawals(address unstaker) external { | ||
| uint256 cooldownAmount = EthenaUnstaker(unstaker).cooldownAmount(); |
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.
this can call cooldowns on sUSDe directly rather than going via the helper
src/contracts/EthenaUnstaker.sol
Outdated
| susde.unstake(arm); | ||
| } | ||
|
|
||
| function cooldownAmount() external view returns (uint256) { |
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 can drop this function. The ARM can get the cooldown amount for the unstaker directly
* wip add unstaker deployment script * Refactor deployUnstakers function to use constant for max unstakers * Rename setUnstaker function to setUnstakers for clarity * Deploy unstakers and set ownership in DeployEthenaARMScript * Make unstakers array public for improved accessibility * Add tests for request/claim withdraw * Add more test for request/claim * Fix error message for request delay in requestBaseWithdrawal function * Simplify cooldown amount handling in EthenaARM contract * Add tests for swapping SUSDE to USDE with outstanding withdrawals and insufficient liquidity * Refactor cooldown handling in EthenaARM and EthenaUnstaker contracts to use UserCooldown struct * Refactor import statements in DeployEthenaARMScript to consolidate IWETH and IStakedUSDe imports
Overview
Ethena's synthetic dollar, USDe, provides the crypto-native, scalable solution for money achieved by delta-hedging Bitcoin, Ethereum and other governance-approved spot assets using perpetual and deliverable futures contracts, as well as holding liquid stables such as USDC and USDT.
USDe can be staked to receive protocol rewards. sUSDe is the liquidity provider token received when staking USDe. There is a 7 day cooling off period to unstake sUSDe which means sUSDe trades with a discount in the market.
Objectives/Requirements
Links
ARM Configuration