Skip to content
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

Implement gOHMRISE with Rari Fuse Pool #19

Open
pyk opened this issue Feb 7, 2022 · 0 comments
Open

Implement gOHMRISE with Rari Fuse Pool #19

pyk opened this issue Feb 7, 2022 · 0 comments

Comments

@pyk
Copy link
Contributor

pyk commented Feb 7, 2022

Implement gOHMRISE leveraged tokens using Rari Fuse Pool.

These are the requirements:

  1. Mint
  2. Redeem
  3. Rebalance

Mint gOHMRISE

Here is step by step to mint gOHMRISE token:

  1. User deposit asset x
  2. gOHMRISE contract swap x asset to gOHM token via Sushiswap. If x is gOHM, no need to swap.
  3. gOHMRISE contract charge 0.1% mint fees
  4. gOHMRISE contract deposit gOHM as collateral to Risedle Fuse Pool
  5. gOHMRISE contract borrow USDC from the Risedle Fuse Pool
  6. gOHMRISE contract deposit gOHM to Risedle Fuse Pool
  7. gOHMRISE contract convert 2x gOHM - USDC debt as gOHMRISE shares
  8. Mint gOHMRISE to the User

Redeem gOHMRISE

Here is step by step to redeem gOHMRISE token:

  1. User deposit gOHMRISE token and choose asset y as the output
  2. gOHMRISE contract convert deposited gOHMRISE token to gOHM + USDC debt
  3. gOHMRISE contract swap some portion gOHM via Sushiwap to repay the debt to Risedle Fuse Pool
  4. gOHMRISE contract charge 0.1% redeem fees
  5. gOHMRISE contract swap gOHM to asset y. If y is gOHM no need to swap.
  6. gOHMRISE contract burn the gOHMRISE token
  7. gOHMRISE contract send y asset to the user

Rebalance gOHMRISE

Here is step by step to rebalance gOHMRISE token:

  1. rebalance() executed
  2. Check the leverage ratio z
  3. If z is less than or equal to 1.7
    1. Borrow more USDC from Rari Fuse Pool
    2. Swap USDC -> gOHM via Sushiswap
    3. Deposit gOHM to Rari Fuse Pool
  4. If z is larger than or equal to 2.5
    1. Withdraw gOHM from Risedle Fuse Pool
    2. Swap gOHM -> USDC via Sushiswap
    3. Repay the USDC to the Rari Fuse Pool
  5. Otherwise do nothing
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

No branches or pull requests

1 participant