Automated Liquidity Management Strategy for incentivized GEL/ETH G-UNI Pools

Kassandra
Gelato Network
Published in
6 min readSep 8, 2021

Background

Gelato Network is releasing the GEL token in a public sale (see here). In order to create a healthy and robust market for the GEL in circulation after the sale, Gelato Network is planning to incentivize liquidity for the GEL/ETH token pair on Uniswap V3. The Liquidity Mining Program proposed (see here) would use Gelato’s very own G-UNI system for pooled liquidity management on Uniswap V3. The Liquidity Mining incentives will help to accumulate capital in two GEL/ETH G-UNI Pools as holders of these GEL/ETH G-UNI tokens may stake their G-UNI to earn GEL rewards. This should bootstrap deep liquidity for the GEL token in the Uniswap V3 market.

The two incentivized G-UNI Pools will be managed by an automated smart contract that periodically adjusts the G-UNI Pools’ Positions on the Uniswap V3 trading pair, changing the price range and concentration of the positions on a predefined strategy. The strategy is optimized to maintain deep liquidity for GEL no matter where the trading price moves, as well as minimize losses due to inventory risk (impermanent loss) by cleverly managing the inventory (passive rebalancing). The details of the strategy are discussed below, so interested participants have clarity around how the assets they provide as liquidity to these G-UNI Pools will be managed.

Two-Pool Strategy

Two automated G-UNI Pools allow us to handle covering price movements in each direction separately. This two-pool strategy makes it easy to adjust the ranges without the need to swap one asset for another and “actively” rebalance the inventory. Swaps can be undesirable because they take on price risk (make impermanent loss into permanent loss), have a fee taken off the top of trades, and don’t work if there is no other liquidity to source (if you swap against your own assets you didn’t actually change your inventory). Passive rebalancing is a much better strategy for LPing in our scenario- we can adjust the composition of our G-UNI Uniswap V3 liquidity without swapping by placing the holdings in configurations that promote natural rebalancing as prices move.

Below, the “red” pool is in charge of making sure we never run out of GEL and escape the range on the left side. Similarly, the “blue” pool is in charge of making sure we never run out of ETH and escape the range on the right side.

The default starting position for GEL/ETH G-UNI Pools

Passive Rebalance with Range Order

The first and simplest kind of passive rebalance is to simply shift an out of range position to be as close to the current price as possible:

The price moves into the blue pool’s range.
The red pool shifts its GEL liquidity down to the edge of the current price
New configuration, same underlying assets

So when the current price is entirely out of range on the right of the red pool it can shift as far right as the current price, acting as a GEL range order just above market price. The same thing for the blue pool, if the price escapes the range to the left of the blue pool, it will shift left and follow the price as an ETH range order.

Passive Rebalance with Range Expansion

The other type of rebalance that is possible without swapping assets is to proportionally expand the range of a pool. This way the same liquidity (less concentrated) can cover more prices. This is how we rebalance whenever we are within the “buffer zone” of a pool:

Price moves into “blue pool” buffer zone
Blue pool expands (dilutes) to cover more prices on the right of the price
Blue pool after expansion
As before red pool can shift down towards new current price as well
Final position after both pools adjust to the new price

This way, pools extend their range and spread the thinning asset in the pool over a wider variety of prices, while concentrating liquidity near current prices with the over-accumulating asset. This promotes rebalancing of the inventory towards a more balanced ratio of GEL/ETH, without ever swapping.

Passive Rebalancing with Range Contraction

The final maneuver for the automated strategy will be the inverse of range expansion we saw above: contraction of the expanded ranges once the price is moving in the other direction. Range contraction works very similar to range expansion:

Price changes direction back into the GEL range order
With price sufficiently far from buffer zone blue pool can contract range
Final position after contraction

Putting it all together

Put as simply as possible, the two pools run a mirrored strategy on opposite sides of the market, with the following rules:

  • Expand the range (reducing concentration) of pool when the price enters the buffer zone.
  • Contract the range (increasing concentration) of pool when the price moves far enough out of the buffer zone.
  • If the price completely escapes the range on the opposite side of the buffer zone, simply shift the liquidity as close to the current price as possible.

With both pools running this mirrored strategy we will always have at least some liquidity wherever the price moves. Below, let's watch the evolution of the liquidity if the price were to move in the other direction:

Price now moves into buffer zone of the red pool
Red pool expands the range
Final Position after expansion

If the price continued to move to the left and the blue pool was entirely out of range it would start shifting left to follow the price as a range order… and so on. With such a strategy we are protected (as best as possible) from escaping both ranges completely, however we never swap assets, avoiding the associated price risks.

Notes

In this article, some aspects of the strategy have been simplified for brevity. Most importantly everywhere we speak about the “current price” we actually use a TWAP (time-weighted average price) in the real implementation. This way prices cannot be manipulated in the short term just to trigger an automated rebalance. Other important parameters are set when initializing the strategy (things like bufferLengthfor the tick length of the buffer zone, or or twapDuration for the number of seconds used in calculating TWAPs).

There are a number of other subtle technical aspects omitted here that are necessary to make the automated rebalancing strategy optimal and safe. The code and documentation will be made available for those who want to dive deeper into the exact specifications of the pool automation!

--

--