Executing Large Trades with Range Orders on Uniswap v3

This is the third post in our series, co-written with Polina Nezlobina and Nikita Zinoviev, on order flow toxicity on decentralized exchanges. Read the other parts here: part one (on the execution strategies for large orders), part two (on execution with market orders on Uniswap v3), part four (solving order flow toxicity).

Alexander Nezlobin
8 min readAug 11, 2022

Introduction

There are no true limit orders on Uniswap v3. However, the docs say that some limit orders can be replicated with short-range LP positions. A study by CrocSwap estimates that such synthetic limit orders constitute close to 20% of the overall positions.

Can one use short-range limit orders to execute large trades on Uniswap v3? In this post, we discuss the risks and benefits of this strategy.

Executing large trades with limit orders

First, let’s recap from part one of the series, how the limit order strategy works on exchanges with central limit order books (CLOBs). Alice wants to buy ETH 800 for USDT. She sees the following order book on Binance:

Figure 1. The ETH/USDT order book on Binance.

Sell limit orders — ETH available for Alice’s purchase — are in red, and buy limit orders are in green. Bars show the total amount of liquidity available for purchase or sale in a given price range. If Alice wanted to execute a buy market order, she would take some of the leftmost red dots. We discussed this scenario in detail in the first two parts of this series.

Now let’s say that she is patient and decides to purchase ETH with several limit orders. Then, instead of taking liquidity from the ask (red) side of the book, she will be making liquidity on the bid (green) side. For example, she can post a buy limit order for ETH 200 at USDT 1234.35. Then, the order book will look as follows:

Figure 2. The ETH/USDT order book with Alice’s new limit order (dark green).

Essentially, instead of buying ETH 200, she is putting up for sale USDT 246,870 (=200 *1234.35). Her best hope is that her limit order will be executed against an uninformed market order to sell ETH. In that case, she will end up buying ETH below the current market price.

In our first post, we discussed two risks associated with this strategy. First, the price of ETH can suddenly go up, in which case Alice’s order will remain unfilled and she will lose the opportunity to buy ETH at a low price. This is called the non-execution risk. Second, the price of ETH can suddenly go down, and Alice’s limit order can be taken by a fast arbitrageur. She will then end up buying ETH at a price higher than the new market price. This is called the pick-off risk.

The main trade-off of this strategy is therefore between a potential improvement in the execution price and the risks of non-execution and pick-off. To control these risks, Alice should monitor the market and move her limit orders as the price moves. There is also a trade-off between the two types of risk. If Alice places her orders deeper in the book (further to the left from the mid-price), then the risk of non-execution will be higher but the risk of pick-off lower. On the other hand, the orders that are very close to the mid-price are more likely to be executed against uninformed market orders but are also more likely to be picked-off.

How will this strategy work on Uniswap v3? To answer this question, we need to recall a few things about the Uniswap range orders.

Uniswap v3 range orders

Range orders in Uniswap are designed primarily for two-way liquidity provision, not for directional trading. As a consequence, they are different from the traditional limit orders in three main ways: their placement options are more limited, they are self-reversing, and they earn fees. Each one of these features has implications for the execution of large directional trades.

[1] Range orders have limited placement options.

Range orders can only be placed in predefined bins. The width of each bin is two times the swap fee. So, for example, for the ETH/USDT pair with a 30 bps swap fee, the bin width is 60 bps. Moreover, single-sided liquidity provision is not possible in the active bin — the bin containing the current AMM price. The net result of these constraints is that range orders can oftentimes be placed only very deep in the book.

The following picture illustrates:

Figure 4. Placement of range orders.

Let’s say the current AMM price is exactly in the middle of a bin. (We will talk more about this assumption later.) If we were to provide liquidity to the current bin, we would have to contribute both USDT and ETH, in equal values. Then, depending on the movement of the AMM price, our liquidity position would shift either to USDT (on price up-moves) or ETH (on down-moves). This is obviously problematic if our intent is to buy ETH and avoid trading in the opposite direction.

If we want to contribute only USDT, we would have to provide liquidity to the leftmost, fully green, bin. But that position will completely convert to ETH only when the price declines by three swap fees. Even for a pair with a 5 bps swap fee, the required minimum price drop would be 15 bps or USDT 1.8 per ETH. In contrast, on most centralized exchanges limit orders can be placed as close as USDT 0.01 to the mid-price for this pair. Orders that are 15 bps away from the mid-price will often be outside of the top one hundred bids or asks.

Therefore, range orders on Uniswap v3 can only be placed relatively deep in the book. As we discussed above, this entails a high risk of non-execution and a low risk of pick-off.

[2] Range orders are self-reversing.

Let’s say that we contribute USDT to the leftmost green bin in Figure 4 above. If the AMM price goes down by two swap fees, then a half of our order will convert to ETH. But recall that in the Uniswap protocol, all ETH that is received by the pool is then immediately put up for the sale to the right of the AMM price. This means that if the AMM price later recovers from its drop, our order will convert back to a pure USDT position.

How does this behavior of range orders affect the non-execution and pick-off risks? The answer is straightforward for the non-execution risk: it increases. This is because whenever a range order is partially executed, there is a chance that an incoming swap will roll back its execution rather than advance it. This makes range order execution particularly unlikely for orders consistent with the general market sentiment, e.g., a buy order in a rising market.

How about the risk of being picked-off? We argue that it increases as well. When a range order is eventually executed, it is more likely to be taken by an arbitrageur than by an uninformed trader. The reason for this is that large uninformed trades (the most profitable ones for LPs) push the AMM price away from the efficient level. As we discussed in our previous post, if the AMM price deviates sufficiently far, arbitrageurs get incentives to push it back. If they do so before the range order is canceled, the execution of the range order will be reversed. In contrast, arbitrage transactions have a more permanent price impact and thus allow for more time to close the range order.

Hence the self-reversing behavior of limit orders increases both the risks of non-execution and pick-off. This raises an interesting question: how should directional traders adjust their strategy to alleviate these risks? One potential approach is to close short-range orders when they are only partially filled, say when the AMM price is exactly in the middle of the range. When an order is half-filled, the amounts by which its execution can advance and roll back are the same. At that stage, an uninformed directional trader may benefit from canceling the current range order and placing a new single-sided one in an adjacent bin.

[3] Range orders earn fees.

The main advantage of range orders is that they earn swap fees. The higher the fluctuations of the AMM price within the range of the order, the higher the swap fees earned. There is an obvious trade-off in choosing the order range related to fees. A more concentrated, shorter-range, position will generate more fees while it is active but will also be active less often. Orders with very short ranges do not usually earn significant fees because the AMM price quickly goes out of their range. But orders with wider ranges have a higher risk of non-execution. It is therefore important for a directional trader to weigh the expected fee revenues against the potential losses due to the order non-execution.

Conclusion

To summarize, the main features of range orders have the following implications for price improvement and the risks of non-execution and pick-off.

       Feature       | PI  | Non-exec | Pick-off 
--------------------|-----|----------|---------
Placement options | - | ↑ | ↓
Self-reversibility | - | ↑ | ↑
Fees | ↑ | - | -

Directional trading with Uniswap range orders leads to a relatively high non-execution risk. This is primarily due to the fact that range orders can only be placed deep in the book and are self-reversible. Furthermore, when range orders are filled, they are usually picked off. Put differently, the execution price of a range order is usually less favorable to the order placer than the market price at the end of execution. However, range orders earn fees, which can lead to a meaningful price improvement for longer-range orders.

What can be done to make directional trading with range orders more viable? For now, the main action that traders can take to minimize the non-execution and pick-off risks is to closely monitor the range orders and reduce their amounts as they get filled. If such steps are taken quickly at predefined price points, both types of risks will be mitigated. However, such monitoring requires effort and costs gas fees. The gas fees can be particularly significant given the high non-execution risk of range orders.

What can Uniswap do? We can suggest two simple improvements that should be feasible at least on the blockchains or L2 platforms with lower gas fees (such as Polygon, Optimism, or Arbitrum by Offchain Labs):

  • Reduce the tick size. This will allow for a closer positioning of range orders to the mid-price, increasing their execution probability.
  • Allow for one-way liquidity provision. Another possibility is to add the option to place traditional, one-way, limit orders at least at the existing tick points.

In our next, and final, post of this series, we will discuss in more detail these and other potential solutions to the problem of order flow toxicity.

Next part

Next series: Designing a low-toxicity AMM

--

--

Alexander Nezlobin

I am a professor at the London School of Economics, and I write about DeFi.