Skip to content

Latest commit

 

History

History
43 lines (26 loc) · 1.68 KB

File metadata and controls

43 lines (26 loc) · 1.68 KB
description
V2 Converters allow for one-sided liquidity provision and removal. There is one LP token per reserve asset.

V2 Converters

Adding Liquidity

addLiquidity increases the pool's liquidity and mints new shares in the pool to the caller.

function addLiquidity(IERC20Token _reserveToken, uint256 _amount, uint256 _minReturn) public payable protected active validReserve greaterThanZero greaterThanZero 
returns(uint256)

Arguments

NameTypeDescription
_reserveTokenIERC20Tokenaddress of the reserve token to add liquidity to
_amountuint256amount of liquidity to add
_minReturnuint256minimum return-amount of pool tokens

Returns

The amount of pool tokens minted.

Removing liquidity

removeLiquidity decreases the pool's liquidity and burns the caller's shares in the pool.

function removeLiquidity(ISmartToken _poolToken, uint256 _amount, uint256 _minReturn) public nonpayable protected active validPoolToken greaterThanZero greaterThanZero 
returns(uint256)

Arguments

NameTypeDescription
_poolTokenISmartTokenaddress of the pool token
_amountuint256amount of pool tokens to burn
_minReturnuint256minimum return-amount of reserve tokens *

Returns

The amount of liquidity removed.