Function addLiquidityReturn is the getter function corresponding to function addLiquidity.
However, instead of taking an array of reserve token amounts, it takes a single reserve token amount and "assumes" that the user will provide the equivalent amount of each one of the other reserve tokens, when function addLiquidity is ultimately executed.
Thus, in order for users to know how many pool tokens they are expected to get from function addLiquidity, they need to call function addLiquidityReturn separately for each reserve token amount that they intend to pass to function addLiquidity, and then choose the smallest value that function addLiquidityReturn has returned.
This PR fixes function addLiquidityReturn to take the exact same input as function addLiquidity (excluding the 'min-return' parameter). It is an API-breaking change, under the assumption that there are currently no onchain users of this function (for offchain users, the fix should be fairly simple).
Function
addLiquidityReturn
is the getter function corresponding to functionaddLiquidity
. However, instead of taking an array of reserve token amounts, it takes a single reserve token amount and "assumes" that the user will provide the equivalent amount of each one of the other reserve tokens, when functionaddLiquidity
is ultimately executed.Thus, in order for users to know how many pool tokens they are expected to get from function
addLiquidity
, they need to call functionaddLiquidityReturn
separately for each reserve token amount that they intend to pass to functionaddLiquidity
, and then choose the smallest value that functionaddLiquidityReturn
has returned.This PR fixes function
addLiquidityReturn
to take the exact same input as functionaddLiquidity
(excluding the 'min-return' parameter). It is an API-breaking change, under the assumption that there are currently no onchain users of this function (for offchain users, the fix should be fairly simple).