We previously shared that @Uniswap v3 enables a new type of MEV attack — Just-in-Time (JIT) Liquidity Sandwiching, which has siphoned >$1M USD in profits away from non-mempool-aware Uniswap v3 LPs. Reactions to this discovery have been mixed... 👇 dune.xyz/ChainsightAnal…
Despite these mixed reactions to JIT attacks—and there's likely no singular 'right' answer to this type of MEV—here's how we envision JIT developing:👇🧵
1/ First, why is JIT an attack? Simple - the trade that ends up being sandwiched by JIT bots would never have been executed in the first place without the passive Uni v3 LPs being there first, providing a valid trade route. Without initial LPs, the trade is never even routed.
2/ The very definition of an attack is to take an aggressive action against another. JIT bots view the mempool to take profit from pre-existing LPs. As such, LPing on Uniswap v3 is now an adversarial environment; to describe JIT as anything other than an attack would be incorrect
3/ Not only that, JIT bots are getting more efficient, improving their profit ratio over time. They are learning how to do this better and better: dune.xyz/embeds/233623/…
4/ How can non-mempool-aware LPs fight back? Does @VisorFinance help? Visor is hardly an active LP, updating its WETH-USDC tick once in the last 2 weeks. @VisorFinance also has no strategies that are mempool-aware. As such, LPs on Visor will still be vulnerable to JIT attacks.
5/ L2s will only make JIT attacks more prevalent. The only barrier to JIT attacks is gas cost. If L2's reduce gas cost even 90%, L2's will allow the present JIT MEV bot profit ratio to explode to over 100x as more JIT opportunities become available dune.xyz/embeds/233623/…
6/ Another interesting solution are private mempools (@EdenNetwork, @bertcmiller). If a trade that is JIT'able is never publicly transmitted, it cannot be attacked. But this goes against a core tenet of Ethereum, decentralization, as private mempools introduce centralized actors
8/ What happens when non-mempool-aware LPs begin to withdraw their liquidity on L2 Uniswap v3 due to rampant JIT attacks and resultant impermanent losses? One envisions a scenario where @Uniswap Team/VCs must subsidize the base level liquidity themselves to provide valid routing
@Uniswap 9/ That scenario would be quite disappointing, considering that @Uniswap v2 and DeFi has so far freed the masses from the sophisticated actors of TradeFi. However, JIT attacks clearly only benefit those with institutional advantage, like HFT firms and exclusive trading outfits
@Uniswap 10/ Despite their age, @Bancor, @Curve and Uniswap v2 style AMMs do not suffer from JIT Liquidity attacks. Does this mean L2 @Uniswap v3 is doomed for failure? Probably not. But JIT presents a problem that can be solved in the future, and we are excited to see solutions presented
1/ @GMX_IO's price oracle updates can be abused by toxic MEV bots, able to extract ~10% of total protocol profits (>$260,000 over last 40 days).
Bots viewing the @avalancheavax mempool can buy assets from GMX immediately before price increases, and sell them back for profit
👇
2/ GMX differs from traditional AMMs by offering zero slippage on trades via an oracle price update system. Differing from AMMs like @Uniswap, which relies on arb bots to properly balance prices in their pools, GMX updates the prices of assets themselves via these oracle updates
3/ GMX team-run bots make calls to SetPriceWithBits() to update asset prices. An unfortunate side effect of this architecture is that MEV bot operators can observe these price updates in the mempool before they land on chain, exposing this toxic MEV opportunity.
Problem 1: With EVM, nothing can happen without *someone* sending a tx (and paying for gas).
But protocols want things to happen automatically—liquidations, auto-compounding yield farms, lending upkeep, rewards distributions, earmarking checkpoints, twa*, metawallets, etc.
3/
Bad Solution: Each protocol rolls their own thing—precious developer time spent building automated bots, protocols overpaying incentives for external users to make required periodic transactions, bug risk if paying in your native token, frontrunning/node sync issues, etc.
Recently, @chainlink whales removed over $55M $LINK from @Uniswap v2 and @Sushiswap LPs. As a result, @Bancor now owns over 80% of $LINK on ETH L1 DEXs.
However, did this "liquidity monopoly" result in more trade volume, and thus more fees?
1/ @thekeep3r KP3R will soon be transitioning to a new ve(3,3) model. It's kind of a big deal, but no one is talking about it. But what does it mean? Let's break it down 👇🧵👇
2/ KP3R token is the fee-bearing asset for 4 (for now) @AndreCronjeTech projects. In order to claim fees, the KP3R must be locked, and the locker receives vKP3R in return. dune.xyz/embeds/271075/…
3/ KP3R token has a slight inflationary aspect, but this only affects KP3R holders who do not lock for vKP3R. In the past, vKP3R holders would receive rKP3R which is redeemable at the rate of inflation. However, vKP3R decreased over time, like CRV. Complicated, but it worked.
1/ @Uniswap v3 introduces a new form of MEV attack — Just-in-Time Liquidity (JIT), that allows LPs to add and remove concentrated liquidity positions atomically in one block. Sophisticated actors are running JIT bots to sandwich trades, to the detriment of pre-existing LPs 👇🧵
2/ Using @DuneAnalytics, we find the @Uniswap positions that are added and removed in the same block for the same LP. From this, we calculate the revenue from the fees of the sandwiched trade, and subtract the gas costs required to perform the JIT attack:dune.xyz/embeds/233623/…