Just-In-Time Liquidity - Uniswap v3 Deep Dive
Just-in-Time (JIT) Liquidity Provision is the latest profit-maximization strategy employed by traders that is sparking a hot conversation about its true benefits and potential dangers
Abstract
Just-in-Time (JIT) Liquidity Provision is a new form of Maximal Extractable Value (MEV) strategy that traders conduct on the latest version of Uniswap v3. This strategy, which implements bots, capitalizes on the update’s newly introduced feature, concentrated liquidity, which allows liquidity providers to supply capital within a specific price range. In theory, the new MEV strategy increases liquidity for traders within their desired trading ranges, minimizing slippage. However, liquidity providers think otherwise, citing the possibility that JIT Liquidity Provision is actually potential risk for Uniswap and other DEXs. To further understand this topic, it is crucial to know what Uniswap is, the functions available on its v3 platform, and assess why MEV bots are more prevalent on Uniswap v3.
What is Uniswap?
Uniswap is an exchange that uses the protocol of Ethereum for swapping cryptocurrency tokens on the Ethereum blockchain through smart contracts. Uniswap was created to work as a tool for the public to swap tokens without incurring any platform fees. Unlike most exchange platforms that match buyers and sellers to determine the prices of and execute trades, Uniwap applies a simple mathematical equation and a handful of token pools to handle the pricing and execution of trades.
Prior to a discussion of Uniswap v3 and its feature in question, concentrated liquidity, one will need to understand the history of Uniswap and the evolution of its feature set.
Uniswap v1
On November 2, 2018, Uniswap was first released on the Ethereum main net as a DEX. The Automated Market Maker (AMM) model served as the base for Uniswap. It also provided an interface for the unified exchange of ERC20 tokens on Ethereum.
Uniswap v2
Uniswap v1 was a proof-of-concept that was massively popular for decentralized finance. Its success led the team to establish Uniswap v2, an upgrade of Uniswap v1, which was launched in May 2020. The following sections establish some of the key improvements that Uniswap V2 brought to its users.
ERC20-ERC20 Pools
Since users of Uniswap v1 incurred higher costs and slippage for swapping one ERC20 token for another, Uniswap v2 introduced ERC20-ERC20 liquidity pools (LPs) to resolve this issue. This new solution, dubbed “ETH Bridging”, used wrapped ETH (WETH) in its core contracts instead of native ETH, allowing for seamless swapping. Traders were still able to utilize ETH through helper contracts.
Flash Swaps
Flash Swaps was another innovative feature that v2 introduced to Uniswap, and it gave traders the ability to withdraw as much of any ERC20 token as they would like without needing to swap for it upfront with another token. Thus, traders could receive ERC20 tokens in their desired amount, reducing the amount of fees they would incur and deferring the need for them to pay for it until later. Traders could choose to pay for the tokens withdrawn or, alternatively, pay for a portion of them and return the remaining withdrawn amount.
Uniswap v3
Uniswap launched on May 5, 2021, with some new features that focused on maximizing returns for traders and liquidity providers – in particular, minimizing slippage and diminishing downside risks. The following three new features are worthy of note as they pertain to JIT Liquidity Provision:
1. Concentrated liquidity
2. Active Liquidity
3. Range Orders
Through the combined use of these three features, traders became able to use their capital more efficiently, and liquidity providers were better enabled to manage their own risk.
1. Concentrated Liquidity
One of Uniswap's breakthroughs was its Concentrated Liquidity feature. In v2, the liquidity provided by users had to be distributed evenly along a price range, (0, ∞). Naturally, however, distributing liquidity over an “infinite” range in practice was highly inefficient, given the fact that most assets are usually swapped within a much narrower price range.
For instance, the Uniswap DAI/USDC pool maintains the majority of its trading volume between the price of $0.99 and $1.01; in Uniswap v2, the pool could thus only use about 0.5% of the liquidity with which it was provided, leaving 99.5% of the remaining capital unused.
Uniswap v3, on the other hand, increases capital efficiency by up to 4000x by enabling LPs to supply liquidity within a predetermined price range where most of the trading occurs. For example, assume there are two USDC-ETH LPs, A and B, and each of them has $10K; assume also that the price of ETH is $1600. A deploys $10,000 across the entire price range, providing 7000 USDC, and 1.875 ETH. B decides to deploy liquidity within a price range of $1500 to $2500, and deposits 900 USDC and 0.5625 ETH, for a combined $1800. In this example, even if A invests significantly more money than B, as long as the price of ETH remains within the predetermined range chosen by B, they will both earn the same amount in fees. In other words, LP B is able to make the same return on his deposit as LP A while only contributing 18% of what LP A had.
This is exactly the optimization benefit that concentrated liquidity offers. Not only does Uniswap v3 provide significantly higher capital efficiency, but it also enables LPs to simulate any programmed market maker or order book by allowing them to dynamically change the price range of their liquidity positions.
2. Active Liquidity
This is another new feature of Uniswap v3. With active liquidity, whenever market prices of trading assets change and rise above a specified price range, providers’ liquidity will be effectively removed from the pool and will cease to earn fees, instead shifting over to only the assets in the LP. That liquidity provider will then be able to select whether to wait for the market price to re-enter their price range or to select a new price range to match the current market performance.
3. Range Limit Orders
This feature enables LPs to provide a single token as liquidity at a specified price range above or below the current market rate. One asset is exchanged for another along a smooth curve as the market price moves into the predetermined range, all while generating swap fees.
Just-In-Time Liquidity Provision (JIT LP)
Despite all of the revenue-generating abilities that these new features offer, the majority of LPs actually are struggling to improve their ability to provide liquidity in limited price ranges. To understand more about the problem, it is essential to know what Flashbots and MEV are and why it was used by many on-chain market participants.
Just–in–time Liquidity Provision (JIT LP) is another pseudonym for a Maximal Extracable Value (MEV) Strategy. This is a strategy employed originally by bitcoin miners that maximize their revenue by including, excluding, or reordering the transactions in a block. This profit is considered distinct from any block rewards or transaction fees the miner would otherwise receive.
This MEV strategy has shown to be more profitable on decentralized exchanges with concentrated liquidity, such as Uniswap v3. The reason for this is that this strategy deploys bots that deploy liquidity within incredibly narrow price ranges, consuming a significant portion of the trading fees elicited. With the new benefits of increased trade depth around current prices and increased fee production for active liquidity providers, these bots are consuming an even greater proportion of those potential profits.
How this MEV strategy works has to do with the way transactions are ordered within a block by miners. When users make transactions, miners can order transactions any way that they wanted to. The highest-paying transactions usually get ordered by the miners first. Naturally, this creates a proverbial “race to the top,” in which users understand that other users are willing to pay a transaction fee premium in order to get their transactions written onto the block first. Users face a prisoner’s dilemma, in which users must participate in a Priority Gas Auction (PGA), which results in a blockage on the chain and requires higher fees from users since the presence of bots artificially inflates the population of “bidders” who are offering gas prices.
This is where Flashbots come in handy. Flashbots is an organization that aims to to reduce the negative externalities of current MEV (Maximal Extractable Value) mining techniques and preventing the factual risks MEV could cause to state-rich blockchains like Ethereum. Traders use Flashbots to prevent the problem by proposing a blind-auction relay where MEV bots “bribe” the miners instead of paying higher gas fees. This means the MEV bots deliver liquidity to the related pool after searching the mempool for a substantial pending exchange swap that has yet to reach confirmation. This is how MEV bots earn a profit, by obtaining a substantial portion of the trading commissions only to remove that liquidity in the same block. And, if the MEV bots add enough liquidity, they can take all the fees in that trade without risking any losses. In this way, MEV bots preclude LPs the opportunity of profiting from large trades. Moreover, MEV bots allow users to transfer atomic trades (a bundle of orders) to the Flashbots relay; if during that exchange, the transaction pays the miner enough, the searcher’s specified set of the ordered transaction will be included in the block.
The Effects and Consequences of JIT liquidity
Although JIT liquidity is considered a potential tactic for many users, the strategy still has its advantages and disadvantages that could affect traders and liquidity providers in reality.
Uniswap once held penalties for liquidity providers that placed and withdrew liquidity in the same block. Nevertheless, the JIT strategy has been shown to have a large positive effect on traders, helping them to minimize slippage and increase liquidity. Robert Miller, the Product Manager of Flashbots, claimed that JIT liquidity did not impact the profit of LPs since this technique is not risk-free and might not meet the risk profile of the bot because the MEV searcher cannot use it in a single atomic transaction.
According to Greg Vardy, CTO of research symposium Nethermind, most LPs are actually losing revenue because of MEV bots. As the JIT liquidity strategy keeps benefiting Defi users every day, passive liquidity provision will be more challenging, and fewer users will be inclined to trade on DEXs where they are often sandwich-attacked and front-run.
However, MEV can, and is, being mitigated at the application and protocol levels. Flashbots has shed light on this misunderstood industry and is developing tools to address the problems encountered by everyday traders.
Findings of Historical Transactions on the Uniswap Protocol
According to Xin Wan & Austin Adams from Uniswap, the USD volume of JIT liquidity has not grown much since June 2021. In recent months, the total trading volume against JIT liquidity is under $100M, which is lower than the total trading volume of most months ($200M). Also, JIT has not grown significantly over the past 6 months, comprising a more slowly increasing proportion of the total USD trading volume on Uniswap.
According to their findings, JIT liquidity provisioning is much more concentrated in the top pools, made evident in the pools where, as shown above, blue bars (the % of total historical JIT liquidity supplied) are much greater than the pink bars (the % of total trading volume/liquidity supplied). This pattern does have insightful meanings. The profit of JIT liquidity is only noteworthy if a swap in the pool is large enough, and large trades are often focused on the top pools. Another essential consideration is that pairs in large pools have more liquidity on centralized exchange venues, which facilitates and reduces the cost of the hedging transaction.
Conclusion
To conclude, JIT liquidity does benefit traders to maximize their profits overall, but it does provide negative externalities to liquidity providers since their revenue might get reduced continuously over time. Despite this, as shown above, JIT liquidity is only concentrated in the top pools and the growth rate of JIT liquidity is fairly slow relative to the greater platform; this indicates that JIT liquidity has played a minimal role in damaging LP performance while providing generally positive effects for traders within the Uniswap Protocol.
References
https://medium.com/nethermind-eth/automated-market-makers-its-curves-all-the-way-down-1b7804cae8c7
Disclaimer
The views expressed herein are for informational purposes only and should not be considered as investment advice. They may not necessarily represent the opinions of M3TA. As every investment and trading opportunity carries risk, you should conduct your own research before making any decisions. M3TA assumes no responsibility for our users' investment activities or their profits or losses. The articles, data, and content provided by M3TA should not be relied upon for any investment-related decisions. We do not advise investing funds you cannot afford to lose.
This article, encompassing text, data, content, images, videos, audio, and graphics, is presented for informational purposes only and is not intended for trading purposes. M3TA cannot guarantee the accuracy, comprehensiveness, or timeliness of the content, documents, data, materials, or website pages accessible through any service, and neither M3TA nor any of its affiliates, agents, or partners shall be liable to you or anyone else for any loss or injury caused in whole. The content available through this website is the property of M3TA and is safeguarded by copyright and other intellectual property laws. Failing to provide proper citation may result in being accused of plagiarism.