DeFi
Browse all DeFi articles.
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…
18 min read
How Concentrated Liquidity in Uniswap V3 Works
This article explains how Uniswap V3 implements concentrated liquidity. We assume the reader already understands Uniswap V2.
9 min read
get_D() and get_y() in Curve StableSwap
This article shows algebraically step-by-step how the code for get_D() and get_y() are derived from the StableSwap invariant.
4 min read
UniswapV2Library Code Walkthrough
The Uniswap V2 Library simplifies some interactions with pair contracts and is used heavily by the Router contracts.
4 min read
Bulkers in Compound V3
The bulker contracts in Compound V3 are multicall-like contracts for batching several transactions.
6 min read
cUSDC V3 (Compound V3) as a non-standard Rebasing Token, CometExt.sol
The Compound V3 contract behaves like a rebasing ERC-20 token. A rebasing token is a token which has an algorithmically adjusted supply rather than a…
7 min read
How Compound V3 Allocates COMP Rewards
Compound issues rewards in COMP tokens to lenders and borrowers in proportion to their share of a market’s lending and borrowing.
8 min read
DeFi Interest Rate Indexes: Principal value and Present Value in Compound V3
The intuitive way to track lender deposits is to record the amount of USDC they deposited and the time they deposited. Compound V3 does not do this.
11 min read
Understanding Collateral, Liquidations, and Reserves in Compound V3
In this chapter we will examine the following topics about Compound V3.
6 min read
Compound V3 Interest Per Second
The Compound V3 protocol measures interest on the scale of seconds. The Compound V3 frontend scales the number up to years for human friendliness.
11 min read
Compound V3 Smart Contract Architecture Explained
How Compound V3 (Comet) works: lending, borrowing against collateral, liquidations, and how its contracts and governance parameter updates fit together.
9 min read
Uniswap V2: Calculating the Settlement Price of an AMM Swap
This article explains how to determine the price settlement of a trading pair in an Automated Market Maker (AMM).