IAMM
facilitates interaction with the API of anyone AMM whitelisted by the Aggregator. addLiquidity
and removeLiquidity
methods. To support a second AMM he should create another separate Farming contract or he could add in the code the specific methods of addLiquidity
and removeLiquidity
and so on. Using the AMM Aggregator it is possible to create a Farming contract that using the add/remove liquidity methods of the IAMM
supports all the AMMs whitelisted by the Aggregator._hasUniqueLiquidityPools
is true for that specific AMM; so, only if the AMM does not support multiple LPs with the same pairs. The function always returns the ordered list of tokens exactly as the AMM itself returns it.LP token total amount in the pool*(numerator/denominator)
,the pair token amounts as percentages calculated as tokens amount in the pool*(numerator/denominator)
; and the addresses of the pair tokens.addresss(0)
if the receiver is the msg.sender
). Retrieves the LP token amount achieved, the corresponding pair token amounts added, the created LP token address and the corresponding tokens addresses used to create the pool. This method is not supported in Balancer verticalization.LiquidityPoolData
struct to add liquidity to a specific AMM. Retrieves the resulting LP amount, the respective equivalent in pair tokens, and the addresses of the pair tokens.LiquidityPoolData
struct (look at the previous point) and retrieve the resulting LP amount array, an array containing the array of the respective equivalent in pair tokens, and an array containing the array of the pair tokens addresses.LiquidityPoolData
struct to remove liquidity from a specific AMM and retrieve the resulting LP amount , the respective equivalent in pair tokens, and the pair token addresses.LiquidityPoolData
struct and retrieve the resulting LP amount array, an array containing the array of the respective equivalent in pair tokens, and an array containing the array of the pair token addresses.swapData
struct to swap liquidity through a specific AMM following a fixed path. Retrieves the output token amount swapped.swapData
to swap multiple liquidities through a specific AMM following a fixed path. Retrieves an array containing the swapped output tokens.IAMMAggregator
, on the other hand, facilitates direct interaction with the APIs of the Aggregator. It provides some general utility methods to retrieve information and data at once from all the AMM, and so all the models contracts, whitelisted by the Aggregator.IAMMAggregator
methods: