LM Pool
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.
Methods
function initialize( address, uint256, uint256, uint256)
This function is used to initialize Astra DAO contract address, owner/dev address, ASTRADAO per block to be rewarded, start reward block, end reward block, for the LM pool contract.
Parameters:
address _astr:
Astra DAO contract address
uint256 _ASTRPerBlock:
rewards per block
uint256 _startBlock:
start block number for starting rewards distribution
uint256 _bonusEndBlock:
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.
Parameters:
IERC20
_lpToken:
lm pool contract address
address
_token0:
Pair's first token address
address
_token1:
Pair's second token address
uint24
fee:
Fee range for pair
function addVault(uint256)
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.
Parameters:
uint256 val:
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.
Parameters:
_pid:
pool id
_amount:
amount to be deposited
vault:
vault months
function withdraw(uint256, bool)
This function is used to withdraw the staked/deposited amount and ASTRADAO reward from the LM pool contract. Users can choose the option of re-staking ASTRADAO reward or instant payout.
Parameters:
uint256 _pid
: pool id
bool _withStake
: 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.
Parameters:
uint256 _pid:
pool id
address _user:
user address
function updateBlockReward(uint256, address)
This function is used to calculate the total block reward as defined ASTRADAO 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.
Parameters:
uint256 _pid:
pool id
address _sender:
user address
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.
Parameters:
uint256 _pid:
pool id
address _userAddress:
User address
function withdrawASTRReward(uint256 _pid, bool _withStake)
This function is used to claim the ASTRADAO rewards. Users can claim the claimable ASTRADAO reward. There are two options for claiming the reward with or without staking the Astra DAO token. If the user wants to claim 100% then he needs to stake the ASTRADAO to Astra DAO pool. Otherwise, a percentage of ASTRADAO amount would be deducted as a fee.
Parameters:
uint256 _pid:
pool id
bool
_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.
Parameters:
uint256 _pid:
pool id
Last updated