LM Terminal can deploy a pool incentivized by reward tokens on Uniswap V3.
Projects which want to incentivize their liquidity can deploy their pool and select any number of tokens as reward.
Liquidity providers can deposit their tokens in the pool and immediately start accumulating rewards.
The reward program period is customizable, and the rewards can either be sent directly to the liquidity providers or vested for a given duration of time before being sent to the LPs.
LM Terminal:
- Select a pair of tokens to be incentivized on Uniswap V3 and any number of reward tokens.
- Deploy Uni V3 pool if there isn't one for that pair using deployUniswapPool()
- Deploy Incentivized pool for that pair using deployIncentivizedPool():
- symbol - Pool contract token symbol
- lowerTick - lower tick for the position range
- upperTick - upper tick for the position range
- rewardTokens - array of reward tokens which will be distributed to LPs
- vestingPeriod - length of time for which tokens will be escrowed on user claim
- poolFee - pool fee
- token0 - token 0 address
- token1 - token 1 address
- amount0 - token 0 amount for initial pool liquidity (used to initialize pool position)
- amount1 - token 1 amount for initial pool liquidity (used to initialize pool position)
- Initialize reward program using initiateRewardsProgram:
- clrPool - address of the pool for that program
- totalRewardAmounts - array of reward token amounts, in same order of the pool deployment.
- rewardsDuration - reward program duration
- After end of the rewards program, a new program can be initialized using initiateNewRewardsProgram.
CLR Pool:
- Collecting rewards - using collect()
- Staking all buffer balance in contract: rebalance()
- Swapping tokens in buffer in contract: adminSwap()
- Staking tokens from buffer in position: adminStake()
- Pausing contract: pauseContract()
- Unpausing contract: unpauseContract()
CLR Pool:
- Providing liquidity for a CLR Pool is done by calling deposit() with token 0 or 1 and amount of that token. LPs provide token amounts which are auto-calculated.
- Removing liquidity for a CLR Pool is done by calling withdraw() with the amount of staked token to be withdrawn.
- Claiming accumulated rewards is done by calling claimReward().
- Removing liquidity and claiming rewards for a CLR Pool is done by calling withdrawAndClaimReward().
--- Run npm i beforehand ---
--- Set .env as in env.example ---
To compile:
npx hardhat compile
To run tests:
npx hardhat test
The primary license for xAssetCLR is the Business Source License 1.1 (BUSL-1.1), see LICENSE.