LP Token¶
Overview¶
Mero liquidity pool depositors receive an amount of a pool-specific LP token in exchange for their deposited funds. This represents their share of the pool’s liquidity. As the pool accrues interest over time, the total underlying of the pool increases and a pool’s LP token appreciates over the underlying in value. A liquidity pool LP token may be redeemed for the underlying asset at any point in time by the LP token holder.
The LP token is an ERC20 token and follows the standard Open Zeppelin ERC20 implementation.
Note
The precision of the LP token is equal to the liquidity pool’s underlying asset’s precision.
Non-standard ERC20 Methods¶
The LP token contract implements several methods that are not implemented by the Open Zeppelin ERC20 implementation.
-
LpToken.
minter
() public view returns (address)¶ Get the address of the minter of the LP token. The minter (i.e. a liquidity pool) can only be set once for an LP token contract.
-
LpToken.mint(address account, uint256 amount) external
Mint new LP tokens.
account
: Address to receive newly minted LP tokensamount
: Amount of LP tokens to mint
Note
This is only callable by the LP token’s
minter
.
-
LPToken.burn(uint256 amount) external
Burn an amount of LP tokens. This burns the LP tokens of
msg.sender
.amount
: Amount of LP tokens to burn.
-
LPToken.burn(address owner, uint256 burnAmount) external
Burn an amount of LP tokens of any token holder.
owner
: Owner of the tokens that should be burned.burnAmount
: Amount of LP tokens to burn.
Note
This is only callable by the LP token’s
minter
.