Skip to content

cykura/liquidity-mining

Repository files navigation

Cykura liquidity miner / staker

Accounts

  1. Incentive: A reward farm. Multiple farms can be permissionlessly created for a liquidity pool. One can optionally create boosted farms, where the staker's voting power in a particular locker can give additional fees. Boosting is based on the Izumi finance boost formula.
min((vliquidity∗40/100)+(Totalvliquidity∗VotingPower/VotingTotal∗(100−40)/100),vliquidity)
  1. Deposit: A Cykura LP NFT deposited into the smart contract. A deposit can be staked into one or more incentive to earn rewards.

  2. Stake: The state of a deposit staked into an incentive.

  3. Reward: Tracks rewards owed per address.

UI integration guide

Writes

  1. Farm creation:

  2. Stake token:

    • Deposit the LP NFT using createDeposit(), then stake the deposit in an incentive by calling stakeToken().
    • Shortcut: use depositAndStake() to call both functions in a single TX
    • Note: Dual liquidity mining rewards need two stake instructions.
  3. Collecting fees and withdrawing

    • Create a Reward account using createRewardAccount()
    • unstakeToken() and unstakeTokenBoosted() remove the deposit from a staked incentive. Note that reclaiming the LP NFT or collecting the reward tokens need additional steps.
    • To reclaim the deposited NFT, call withdrawToken()
    • To collect reward, call claimReward(). This can be done independently of withdrawToken().
    • If you only want to harvest fees and keep the token staked, call stakeToken() instead of withdrawToken().

Reads

  1. Every wrapper (Incentive, Reward, Stake and Deposit) has a data() function to fetch and cache accounts.
  2. Unclaimed reward- stake.getRewardInfo()
  3. APR- TODO
  4. Boost percentage- TODO
  5. Find all deposits of a user- deposits.fetchAll(), then filter for the wallet's address
  6. If a deposit is staked in an incentive- Generate the stake address using the deposit and incentive addresses.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •