Collections/9 parts/152 min total

Onchain & DeFi Quant

Quantitative DeFi from first principles - MEV and sandwich attacks, atomic arbitrage, liquidation cascades on lending protocols, and LP profitability on Uniswap v3.

01

MEV anatomy: sandwiches, frontrunning, and the dark forest of the mempool

Every swap you send to a public RPC is a visible limit order nobody has to honor. A technical breakdown of how MEV extraction works: mempool ordering, sandwich math on Uniswap v2, PGAs, Flashbots, and trader defenses.

02

The MEV supply chain: PBS, MEV-Boost, and who actually captures the value

MEV stopped being a lone bot and became an assembly line: searcher, builder, relay, proposer. A technical walk through proposer-builder separation, MEV-Boost's sealed-bid block auction, why the searcher's margin gets bid away, order-flow auctions as the new moat, and how Solana's Jito model differs.

03

On-chain arbitrage: atomic cycles, flash loans, and the auction you have to win

Finding an on-chain arbitrage cycle is the easy half. The hard half is winning the sealed-bid priority auction against every other searcher who found the same cycle. A technical breakdown of atomicity, flash loans, backrunning, and where arb profit actually survives - including non-atomic CEX-DEX.

04

Liquidations on-chain: Aave and Compound mechanics, and the bot business around them

How Aave v3 and Compound liquidations actually work: health factor math, close factors, liquidation bonuses, Chainlink oracle triggers, and what it takes to run a flash-loan liquidation bot in 2026.

05

Liquidation cascades as a trading signal: reading forced, pre-announced flow

Every leveraged position advertises the price at which it must be sold. How to build the on-chain liquidation depth chart and the CEX liquidation heatmap, model cascade dynamics as a reproduction number, and trade forced flow as a signal instead of only fearing it as a risk.

06

Impermanent Loss and LVR: the real math of LP profitability

Impermanent loss, concentrated-liquidity leverage, and loss-versus-rebalancing derived from first principles. The closed forms, the σ²/8 result, per-block markout, and the exact fee-versus-volatility condition under which an LP actually beats holding.

07

Uniswap v3 for Quants: Concentrated Liquidity and Tick Math from First Principles

How Uniswap v3 really works under the hood: virtual reserves, liquidity L, sqrtPriceX96, tick math, feeGrowthInside, and why an LP position is a short-volatility payoff. With exact formulas and a worked numeric example.

08

Active Uniswap v3 LPing as Market Making: Range Selection, Rebalancing, and Delta Hedging

An active v3 LP is running a market-making book with gas costs and no cancel button. Size ranges from a GARCH vol forecast, frame rebalancing as fee-gain vs realized-cost, derive the position delta from tick math and hedge it with perps, and understand JIT liquidity and the honest pitfalls of backtesting LP from on-chain data.

09

Analysis of Trader Behavior Prediction Capabilities in DEX Based on Identification and Modeling

How DEX transparency and modern identification methods allow predicting trader behavior, detecting manipulations, and building a desire orderbook.