Implement gOHMRISE leveraged tokens using Rari Fuse Pool.
These are the requirements:
- Mint
- Redeem
- Rebalance
Mint gOHMRISE
Here is step by step to mint gOHMRISE token:
- User deposit asset
x
- gOHMRISE contract swap
x asset to gOHM token via Sushiswap. If x is gOHM, no need to swap.
- gOHMRISE contract charge 0.1% mint fees
- gOHMRISE contract deposit gOHM as collateral to Risedle Fuse Pool
- gOHMRISE contract borrow USDC from the Risedle Fuse Pool
- gOHMRISE contract deposit gOHM to Risedle Fuse Pool
- gOHMRISE contract convert 2x gOHM - USDC debt as gOHMRISE shares
- Mint gOHMRISE to the User
Redeem gOHMRISE
Here is step by step to redeem gOHMRISE token:
- User deposit gOHMRISE token and choose asset
y as the output
- gOHMRISE contract convert deposited gOHMRISE token to gOHM + USDC debt
- gOHMRISE contract swap some portion gOHM via Sushiwap to repay the debt to Risedle Fuse Pool
- gOHMRISE contract charge 0.1% redeem fees
- gOHMRISE contract swap gOHM to asset
y. If y is gOHM no need to swap.
- gOHMRISE contract burn the gOHMRISE token
- gOHMRISE contract send
y asset to the user
Rebalance gOHMRISE
Here is step by step to rebalance gOHMRISE token:
- rebalance() executed
- Check the leverage ratio
z
- If
z is less than or equal to 1.7
- Borrow more USDC from Rari Fuse Pool
- Swap USDC -> gOHM via Sushiswap
- Deposit gOHM to Rari Fuse Pool
- If
z is larger than or equal to 2.5
- Withdraw gOHM from Risedle Fuse Pool
- Swap gOHM -> USDC via Sushiswap
- Repay the USDC to the Rari Fuse Pool
- Otherwise do nothing
Implement gOHMRISE leveraged tokens using Rari Fuse Pool.
These are the requirements:
Mint gOHMRISE
Here is step by step to mint gOHMRISE token:
xxasset togOHMtoken via Sushiswap. Ifxis gOHM, no need to swap.Redeem gOHMRISE
Here is step by step to redeem gOHMRISE token:
yas the outputy. Ifyis gOHM no need to swap.yasset to the userRebalance gOHMRISE
Here is step by step to rebalance gOHMRISE token:
zzis less than or equal to 1.7zis larger than or equal to 2.5