Uniswap V2
Browse all Uniswap V2 articles.
12 min read
Uniswap v3 Positions: How Liquidity Ranges Work
In Uniswap v3, liquidity providers open positions over a tick range instead of getting LP tokens. Learn how positions, fees, and the mint function work.
7 min read
Calculating the real reserves between two prices in the Uniswap V3 codebase
In previous chapters, we derived formulas to calculate the real reserves of tokens X and Y between two prices in a segment.
10 min read
The constant product formula in Uniswap v3
This chapter is optional. It introduces no fundamentally new concepts compared to the previous ones, but offers a different perspective on deriving real…
11 min read
Real reserves in Uniswap v3
In the last chapter, we introduced two new concepts: real reserves and virtual reserves.
12 min read
Real and virtual reserves in Uniswap v3
Uniswap v3 uses two types of reserves: real reserves and virtual reserves. Real reserves represent the actual amount of tokens present in a segment.
8 min read
Tickmath getSqrtRatioAtTick
This article explains how the getSqrtRatioAtTick() function in Uniswap V3 TickMath library works.
8 min read
Square and Multiply Algorithm
The square and multiply algorithm computes integer exponents in O(log n) (logarithmic time).
7 min read
Computing the Current Tick Given sqrtPriceX96
In the previous chapters, we saw that the protocol stores the square root of the price instead of the price itself.
7 min read
Uniswap V3 Factory and the Relationship Between Tick Spacing and Fees
In early chapters, we introduced the concept of ticks, which discretize the price curve.
6 min read
Tick limits in Uniswap V3
The smallest tick in Uniswap v3 is -887,272 and the largest tick is 887,272.
9 min read
Square Root Price in Uniswap V3
In Uniswap V2, the protocol tracks token reserves and derives the spot price, p_x=y/x, and total liquidity, L=xy, where x and y are the reserves of…
15 min read
Introducing ticks in Uniswap V3
This article explains what ticks are in Uniswap V3. Ticks enable gas-efficient accounting of concentrated liquidity, so let’s quickly review concentrated…