DefiLab Uniswap V3 Simulator: The Classroom

Defi Lab
3 min readMay 3, 2021

--

The simulation tool we designed here at Defi-Lab.xyz is divided in two sections.

The first section, that will be discussed in this post, is called the classroom and it shows the performance of Uniswap V3 versus different strategies from a strict mathematical point of view.

Fees are dependant on market conditions therefore we can’t forecast deterministically the amount that will be earned by a specific Uniswap V3 strategy. We can, however, determine the increase efficiency of concentrated liquidity of a specific Uniswap V3 strategy vs providing generalised liquidity similarly to what happens in a classical AMM strategy (used by Uniswap V2, SushiSwap, Balancer and all other standard AMM)

The second section, that will be discussed in part 2, is called the playground and it allows to make several hypothesis on how the market will behave and determine how any given Uniswap V3 strategy performs in these conditions, including a precise calculation of the fees to be collected.

The Classroom

Selection Criteria:

This section of the simulator allows you to compare up to two Uniswap V3 Strategy with some standard basic investment strategies.

The first element to be specified is the pair you want to analyse (in this post we will use as example ETH and USDC) and your investment amount to be used as base of the calculations.

Token pair Selection

You can then proceed to define your Uniswap V3 strategies (up to 2 different strategies) defining the price ranges you want your liquidity to be actively used by the Uniswap V3 protocol.

Uniswap V3 price range definition (purple strategy 1 / blue strategy 2)

Finally you can select standard strategies you want to use in you analysis to be compared with the Uniswap V3 strategies.

Strategy selection

Charts:

The main chart shows the value of your investment (excluding fees) at different price levels for the different selected Strategies. You can modify the Uniswap V3 price ranges simply dragging the marker of the price range on the chart.

The multiplier calculates the increased capital efficiency that Uniswap V3 guarantees compared to Uniswap V2 highlighting the benefits of the newly introduced concentrated liquidity.

The following charts compare the two Uniswap V3 strategies with the selected comparison strategy, determining the extra profit or loss (excluding fees) for each price level .

Performance of Uniswap V3 Strategy vs other selected strategy

These charts can be used to analyse the effect of the “impermanent loss”. These charts highlight the amount of fees required to offset the extra risk taken concentrating liquidity between a certain price range.

The basic mathematics behind the calculations performed in the simulator are taken from the Uniswap V3 Whitepaper https://uniswap.org/whitepaper-v3.pdf

--

--

Defi Lab
Defi Lab

Written by Defi Lab

Test your Uniswap V3 strategies with our strategy simulator at htts://defi-lab.xyz

No responses yet