Skip to content

Implement gOHMRISE with Rari Fuse Pool #19

@pyk

Description

@pyk

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions