âī¸Liquidity Providers
Last updated
Last updated
Maximize: swap fees, non-toxic order flow
Minimize: toxic order flow, uncompensated MEV
Liquidity providers are the lifeblood of the DeFi system. Uniswap V2 full-range LP unlocked a lot of new features like composable LP positions in other protocols, price discovery of new tokens, and the ability to passively LP.
It is well known that passive liquidity providers (LPs) tend to get a raw deal on AMMs today. They are exposed to adverse selection and usually not compensated enough in trading fees from uninformed flow to make up for it.
In a TWAMM, all of the price-insensitive long-term flow goes through the LP pool which accrues trading fees. Note that profits earned and fees incurred by arbitrageurs are implicitly paid for by the long-term order, in the form of slippage.
Identifying toxic order flow and attracting large uninformed (non-toxic) order flow is the holy grail for market makers and liquidity providers. However, this is a hard problem for DEXs to solve without adding gas-inefficient on-chain logic or relying on off-chain computations.
In most DEXs, all swaps go through the same interface and fee bucket as shown in the diagram above. In this scenario, passive liquidity providers eat the toxic order flow because arbitrageurs exploit outdated pool prices without compensating LPs with the commensurate MEV extracted.
Our TWAMM implementation has an elegant incentive structure baked in:
The short-term swap interface is somewhat more costly gas-wise than a Uniswap V2 swap and will primarily be used to correct pool prices by arbitrageurs. So, we collect and pass on a portion of the MEV extracted via a proprietary arbitrageur swap interface.
The long-term swap interface proxies trades that happen over multiple blocks & are inherently uninformed non-toxic flow. This user pays a standard low fee that outcompetes incumbents like OTCs on fees, and other implementations on gas costs.
Now that we have a DeFi protocol that has built-in MEV extraction and novel trade execution for large uninformed order flow, we are finally able to even the playing field for passive LPs providing full range liquidity.
Sophisticated market makers have been hedging the downside of providing liquidity in DEXs by arbitraging the very same pools. With our TWAMM implementation, passive LPs will be able to hedge against impermanent loss by collecting and automatically re-investing MEV rewards from arbitrageurs.
An important part of our implementation is a design feature that transfers a portion of MEV tokens (WETH) from arbitrage partners to LPs. The design balances gas use and composability while eliminating the incentive to use flash loans for just-in-time liquidity attacks to capture MEV rewards.
There are more examples in the public repo: https://github.com/Cron-Finance/v1-twamm/tree/main/contracts/twault/scripts/helper