The technical content top engineers rely on to level up.

8 min read
Tickmath getSqrtRatioAtTick This article explains how the function in Uniswap V3 TickMath library works. The function takes a tick index and returns the square root price at that exact tick as a...
Last updated on Aug 20, 2025
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. Therefore, it is necessary to relate...
Last updated on Aug 20, 2025
Storage Slots of Dynamic Types (Mappings, Arrays, Strings, Bytes) Dynamic-sized types in Solidity (sometimes referred to as complex types) are data types with variable size. They include mappings,...
Last updated on Aug 20, 2025
11 min read
Real reserves in Uniswap v3 In the last chapter, we introduced two new concepts: real reserves and virtual reserves. The real reserves of a segment are the amount of tokens contained in that segment—...
Last updated on Aug 20, 2025
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 tokens X...
Last updated on Aug 20, 2025
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. A tick is a price defined by the formula...
Last updated on Aug 20, 2025
9 min read
get_D() and get_y() in Curve StableSwap This article shows algebraically step-by-step how the code for and are derived from the StableSwap invariant. Given the StableSwap Invariant: $$ An^n\sum x_i...
Last updated on Aug 20, 2025
9 min read
Uniswap v2 router code walkthrough The Router contracts provide a user-facing smart contract for safely minting and burning LP tokens (adding and removing liquidity) safely swapping pair tokens They...
Last updated on Jul 19, 2025
6 min read
Indicate Then Constrain If we want to say that “ can be equal to 5 or 6” we can simply use the following constraint: However, suppose we want to say that “ is less than 5 or is greater than 17.” In...
Last updated on Jun 20, 2025
6 min read
Intermediate Signals and Sub-Component Circom’s primary purpose is to compile down to a Rank 1 Constraint System (R1CS), but its secondary purpose is to populate the witness. For most circuits, the...
Last updated on Jun 20, 2025
12 min read
Elementary Group Theory for Programmers !Group Theory Hero Image This article provides several examples of algebraic groups so that you can build an intuition for them. A group is a set with: a...
Last updated on May 20, 2025
22 min read
Elementary Set Theory for Programmers Why another set theory tutorial? The target audience for this piece is the sort of folks who don’t care about abstract math unless they see a direct use-case for...
Last updated on Apr 25, 2025