Skip to content

Latest commit

 

History

History
66 lines (59 loc) · 5.36 KB

FLOW.md

File metadata and controls

66 lines (59 loc) · 5.36 KB

Flow

Involved entities

Deployment and initialization flow

  1. LDO token is deployed.
  2. 1INCH token is deployed.
  3. DAI token is deployed.
  4. stETH token is deployed.
  5. Mooniswap is deployed:
    • Pair of tokens is stETH and DAI.
    • Mooniswap provides LP tokens as result of depositing.
  6. FarmingRewards is deployed:
    • Target pool is previously deployed Mooniswap.
    • Initial gift is 1INCH token (scale and duration are TBD).
    • Initial gift distribution is TBD, but expected to be related to 1INCH.
    • Initial gift reserves index 0 in tokenRewards array.
  7. RewardsManager is deployed:
    • GIFT_INDEX constant value is set to 1.
    • Target rewards contract is previously deployed FarmingRewards.
    • Target rewards token is LDO token.
  8. FarmingRewards owner adds new gift (calls addGift()):
    • Gift token is LDO.
    • Gift distribution is RewardsManager.
    • Gift is REQUIRED to be at index 1 in tokenRewards array (this MUST match with GIFT_INDEX constant value in RewardsManager).
    • Gift scale and duration have to be determined carefully:
  9. LIDO triggers new reward period (via Aragon Voting):
    • LDO tokens is transferred to an address of RewardsManager.
    • Method start_next_rewards_period() is called on RewardsManager.
      • RewardsManager transfers all LDO tokens to an address of FarmingRewards.
      • RewardsManager calls method notifyRewardAmount() method on FarmingRewards.
      • LDO tokens CAN NOT be recovered (via recover_erc20() method call or rescueFunds()) after this action.

Usage flow

  1. There is a User, that has stETH and DAI tokens.
  2. User calls method deposit() on Mooniswap and provides stETH and DAI tokens.
    • User receives LP tokens as the result.
  3. User calls method approve() on Mooniswap.
    • Recipient is FarmingRewards.
    • Amount is TBD.
  4. User calls method stake() on FarmingRewards.
    • User receives staking tokens as the result.
  5. After some time User calls method claim() on FarmingRewards.
    • User receives 1INCH and LDO tokens as the result.
    • LP tokens are left in FarmingRewards.
  6. User calls method withdraw() on FarmingRewards.
    • User receives his LP tokens.
    • 1INCH and LDO are left in FarmingRewards.
  7. User calls method exit() on FarmingRewards.
    • User receives 1INCH and LDO tokens as the result.
    • User receives his LP tokens.

Visual diagram of the flow

Visual diagram