LM Pool Uniswap Version 3
This is the contract used for staking uniswap version 3 LP tokens. It includes primary functionalities like deposit, withdrawal, reward claim, reward distribution for LP token holders, and others.
function initialize( address, uint256, uint256, uint256)
This function is used to initialize Astra contract address, owner/dev address, Astra per block to be rewarded, start reward block, end reward block, for the LM pool contract.
Astra contract address
ASTR rewards per block
start block number for starting rewards distribution
end block number for ending reward distribution
function add(IERC20,address, address, uint24)
This function is used to add the pool for LP token on the LM pool contract. This function is only to be called by the owner of the LM pool contract.
lm pool contract address
Pair's first token address
Pair's second token address
Fee range for pair
This function is used to add the vault value for the LP token on the LM pool contract. This function is only to be called by the owner of the LM pool contract.
value of month like 0, 3, 6, 9, 12
function deposit(uint256, uint256, uint256)
This function is used to deposit/stake the amount by the user. On the LM pool contract, users can stake and lock their LP token.
amount to be deposited
function withdraw(uint256, bool)
This function is used to withdraw the staked/deposited amount and Astra reward from the LM pool contract. Users can choose the option of re-staking Astra reward or instant payout.
: pool id
: withdraw the amount with or without the stake.
function viewEligibleAmount(uint256, address)
This function is basically used to view the eligible amount which needs to be withdrawn if the user deposits the amount in multiple vaults.
function updateBlockReward(uint256, address)
This function is used to calculate the total block reward as defined Astra per block and the distribution will be calculated with the current user reward multiplier, total user multiplier, and total pool multiplier. After calling this function users can update their reward.
function viewRewardInfo(uint256, address)
This function is used to view the total reward (including block reward) which the user has earned on the Astra Dao platform.
function withdrawASTRReward(uint256 _pid, bool _withStake)
This function is used to claim the Astra rewards. Users can claim the claimable ASTR reward. There are two options for claiming the reward with or without staking the Astra token. If the user wants to claim 100% then he needs to stake the Astra to Astra pool. Otherwise, a percentage of Astra amount would be deducted as a fee.
_withStake: with or without stake
function getTodayReward(uint256 _pid)
This function is used to show the amount of rewards the user has claimed to date.