Uniswap V2’s user-friendly codebase has been widely adopted and adapted, influencing numerous networks and derivative projects like Solidly. However, its requirement for liquidity to be added or removed in strict 50/50 ratios has led to a less-than-ideal user experience. In cases where users provide imbalanced ratios, the excess is forfeited, resulting in fewer LP tokens during minting or an enforced 50/50 split upon burning. Odos improves this by accepting any ratio of tokens, converting them efficiently into the most advantageous LP tokens in a single transaction.
Before Odos Zaps
In order to exit a liquidity position and enter a new one, a user must make a minimum of 4 transactions. Below is an example of going from a LP position in Uniswap V2 to another one. For this example, the pools will be WETH/DAI and USDC/UNI
- Remove liquidity from WETH/DAI
- Swap WETH for UNI
- Swap DAI for USDC
- Deposit liquidity into USDC/UNI pool
During these transactions, the market may move, or slippage may occur, resulting in less than a 50/50 split of assets.
After Odos Zaps
Odos simplifies the process of moving from an LP to another LP, but doing it perfectly and in a single, atomic transaction.
Odos Zapping supports Uniswap V2 and Solidly style pools, along with minting and burning of Curve LP tokens for StableSwap pools within the core Odos SOR.
Odos strives to distribute your input evenly across a pool’s 50/50 ratio requirement. However, price fluctuations during the transaction can create an imbalance, resulting in a surplus that the pool won’t accept and could be lost. To avoid this, Odos Zaps employ two protective measures:
- For standard Uniswap V2 pools: It calculates the exact swap amount to align your contribution with the current pool reserves, optimizing the use of your funds.
- For non-standard pools: It can return any surplus tokens to your wallet, ensuring you’re only contributing what’s needed for LP tokens.
Since both options will have a small additional fixed gas cost, they will only be performed if the quantity of wasted assets is above a specified threshold.
With Odos zapping, users can adjust their investments across several liquidity pools or specific tokens in just one step. This tool is particularly handy for streamlining the process of selling off or reorganizing a set of LP tokens. You can go from many LP positions into a single position or into a combination of tokens.
A summary of what is possible with Odos Zaps:
- Any number of tokens to a single LP
- Any number of LPs to a single LP
- Any number of LPs and tokens to a single LP
- Any number of LPs and tokens to any number of tokens
Odos Zaps are accessible through the API and utilize the same smart contract router as the core SOR service. This commonality eliminates the requirement for additional approvals, minimizing security risks. Existing Odos SOR users can conveniently use Odos Zaps to manage their entry into and exit from liquidity positions with ease.
When using Odos Zaps, the
swapMulti function on the router is always employed, incurring a fee of 0.01%. It’s important to note that no additional fees are collected from positive slippage when
swapMulti is used.