Multi In/Out Swap

Velocore's novel feature

In a conventional setting, a pair contract only allows the input of one type of token at a time, delivering a different token in return. Liquidity Providers (LPs) such as 3pool accept three types of tokens, swapping these tokens between the LP and users. This is manageable for LPs supporting only two types of tokens. However, for LPs like Balancer, which supports up to eight tokens, this limitation on the number of inputs and outputs can become inefficient. Therefore, we have enhanced our TokenVault(=router) contracts to facilitate multiple inputs and outputs. Moreover, these inputs/outputs are not limited to single tokens; they can also be LPs or other entities. As an example, in a USDT/USDC/DAI/BUSD pool, it's possible to exchange a combination of USDT and USDC for DAI and BUSD, or LP and DAI. While this might not be a feature that the general user will use often, the flexibility it offers opens up opportunities for more innovative and efficient swaps. This added functionality is especially useful for DEX aggregators and arbitrageurs, as it expands the range of potential swap combinations and strategies.

Last updated