Lowest slippage swap
Last updated
Was this helpful?
Last updated
Was this helpful?
Our protocol implements an algorithm that can reach the lowest slippage during token swap in Uniswap V2 like DEX. Just like 1inch, our algorithm supports all major protocols in Polygon, including QuickSwap, SushiSwap, Dfyn, Kyber DMM, WaultSwap, JetSwap, and more.
Suppose that you want to swap exact USDC to WETH through several Uniswap V2 like DEX using only USDC-WETH LP. In 1inch, they will split the swap across all supported DEX. Our algorithm does a similar thing.
For Uniswap V2 like DEX, the swap can be described as the following function
where
is the input USDC amount to the -th DEX
is the swap fee for the -th DEX
is the WETH reserve in the -th DEX
is the USDC reserve in the -th DEX
is the output WETH amount
We need to optimize the following function
For Uniswap V2 like DEX, the swap can be described as the following function
whereβ
We need to optimize the following function
Using the , we can find the optimal solution for
Suppose that you want to swap some USDC to get exact WETH through several Uniswap V2 like DEX using only USDC-WETH LP.
β is the output WETH amount to get from the β-th DEX
ββ βis the swap fee for the β-th DEX
ββ βis the WETH reserve in the β-th DEX
ββ is the USDC reserve in the β-th DEX
is the minimum input USDC amount needed
Again, using the , we can find the optimal solution for