On-chain SQL // verified on live Dune

THE ON-CHAIN ANALYTICS
EDGE.

Master the on-chain SQL that gets you hired.

329 graded SQL lessons. 14 signal detectors. 8 portfolio capstones. Every query proven on live blockchain data — not plausible, not hand-waved. Go from zero to a hireable crypto data analyst, quant, or on-chain investigator.

Launching soon // $99 founding price for the waitlist // $199 at launch // one-time, lifetime

detector.sql // who is front-running traders?LIVE
-- 3-way self-join: front + back legs (same bot, -- reversed direction) with a victim wedged between WITH dt AS ( SELECT block_number, project_contract_address, tx_from, tx_hash, evt_index, token_bought_address, token_sold_address, amount_usd FROM dex.trades WHERE blockchain='ethereum' AND block_number BETWEEN 18000000 AND 18000100), legs AS ( SELECT f.tx_from AS attacker, f.evt_index fi, b.evt_index bi, f.token_bought_address fb, f.token_sold_address fs FROM dt f JOIN dt b ON f.block_number=b.block_number AND f.project_contract_address=b.project_contract_address AND f.tx_from=b.tx_from AND f.tx_hash<>b.tx_hash -- back leg reverses the front (ADDRESS-level, not symbol) AND b.token_bought_address=f.token_sold_address AND b.token_sold_address=f.token_bought_address AND b.evt_index>f.evt_index+1), -- room for a victim v AS ( SELECT DISTINCT l.attacker, val.tx_from victim, val.amount_usd FROM legs l JOIN dt val ON val.token_bought_address=l.fb AND val.token_sold_address=l.fs AND val.evt_index>l.fi AND val.evt_index<l.bi) SELECT lower(to_hex(attacker)) AS bot, count(*) AS victims, round(sum(amount_usd),0) AS victim_usd FROM v GROUP BY 1 ORDER BY victims DESC LIMIT 3
result — ethereum, live
0xae2fc483…65 · $90,424
0x77ad3a15…13 · $29,520
0xf9cafeb3…11 · $2,887
✓ live-validated · blocks 18.00M–18.00M+100
detector.sql // is this "stable" coin actually $1?LIVE
-- filter by contract_address (symbol='DAI' returns -- a $13 scam token); price = MEDIAN, never AVG WITH basket(addr,name) AS (VALUES (0xa0b8…eb48,'USDC'),(0xdac1…1ec7,'USDT'), (0x853d…b99e,'FRAX'),(0x40d1…6c2f,'GHO'), (0x4c9e…8b3,'USDe')), pt AS ( SELECT b.name, t.amount_usd, CASE WHEN t.token_bought_address=b.addr THEN t.token_bought_amount ELSE t.token_sold_amount END AS u FROM dex.trades t JOIN basket b ON b.addr IN (t.token_bought_address, t.token_sold_address) WHERE t.blockchain='ethereum' AND t.block_time > now()-interval '2' day AND t.amount_usd > 0), p AS (SELECT name, amount_usd/u AS px FROM pt WHERE u > 0 AND amount_usd/u BETWEEN 0.5 AND 2.0) SELECT name AS asset, round((approx_percentile(px,0.5)-1)*1e4,1) AS dislocation_bps FROM p GROUP BY name ORDER BY abs(dislocation_bps) DESC
result — stablecoins, live
FRAX−79.2 bps
GHO−11.3 bps
USDC+1.3 bps
✓ live-validated · FRAX trading at $0.9921
detector.sql // reconstruct Solana MEV from tipsLIVE
-- no mempool on Solana; MEV = tips to 8 Jito accounts. -- tip = balance_change>0 on a successful tx; the -- searcher is the tx SIGNER (a tip account never signs) WITH tips AS ( SELECT tx_id, sum(balance_change) AS tip_lamports FROM solana.account_activity WHERE address IN ('96gYZG…rZU5','HFqU5x…gRe', 'Cw8CFy…LkY','ADaUMi…S49','DfXygS…jDh', 'ADuUkR…cEt','DttWaM…KRL','3AVi9T…j3T') AND balance_change > 0 AND tx_success = true GROUP BY tx_id), payer AS ( SELECT a.tx_id, a.address AS searcher FROM solana.account_activity a JOIN tips t ON a.tx_id=t.tx_id WHERE a.signed = true) -- fee payer = searcher SELECT payer.searcher, count(*) AS bundles, round(sum(tips.tip_lamports)/1e9, 4) AS tip_sol FROM tips JOIN payer USING (tx_id) GROUP BY 1 ORDER BY tip_sol DESC LIMIT 3
verified tip market — solana, 1h
tip transactions357,044
total tips44.17 SOL
median tip2,853 lamports
✓ live-validated · ~700,000× heavy tail
detector.sql // where did the funds exit?LIVE
-- follow a flagged address's funds ONE hop, then -- attribute the exit to a real exchange (VASP) WITH seed AS ( SELECT "to" AS addr FROM tokens.transfers WHERE "from" = 0xd30c…fa8a AND amount_usd > 0), hop1 AS ( SELECT t."to" AS addr, sum(t.amount_usd) AS usd FROM tokens.transfers t JOIN seed s ON t."from" = s.addr WHERE t.blockchain='ethereum' AND t.block_time > now()-interval '7' day GROUP BY 1) SELECT COALESCE(l.name,'(unlabeled)') AS entity, round(sum(h.usd),0) AS off_ramp_usd FROM hop1 h LEFT JOIN labels.cex_ethereum l ON h.addr = l.address GROUP BY 1 ORDER BY 2 DESC
result — one-hop off-ramp attribution
OKX 233 (exchange)$3.31M
(unlabeled contract)→ keep tracing
✓ live · labels are behavioural, not proof of KYC
329
lessons
14
detectors
8
capstones
329/329
live-verified
Why it's different

The knowledge
is the moat.

Anyone with a Dune seat could write these queries. Almost nobody knows the details that make them correct.

01

Proven,
not plausible

Every lesson cites a real table + a number we actually ran. An LLM swears Uniswap fees are 0.3%; the real pool was 0.05% — 6× wrong. We ran it.

02

The traps
nobody teaches

Symbol collisions, avg-vs-median, evt_index ordering, uint256 overflow, RAY units, BTC-not-sats — the silent-wrong-answer bugs.

03

Honest
about limits

Where data is sparse or off-chain — perps funding, OFAC labels, NAV — we say so. No faked numbers. The honesty is the edge.

Built for real desks

Pick your target.

// TRADING

Quant / MEV

markout · VPIN · Jito · sandwich P&L

Reconstruct MEV from balance deltas, measure toxic flow, build a searcher leaderboard.

  • markout
  • LVR
  • Jito bundles
// RISK

DeFi risk

HHI · health factor · depeg · liquidations

Track concentration, position health, depeg exposure and cascades across lending + stables.

  • HHI
  • Amihud
  • net-debt
// COMPLIANCE

Investigator

taint · peel chains · mixers · VASP

Trace funds cross-chain, detect laundering + Tornado exposure, attribute exits, score confidence.

  • cross-chain
  • Tornado
  • OFAC
// RESEARCH

Data analyst

DAU · retention · wash volume · smart money

Real (wash-filtered) volume, retention cohorts, accumulation, protocol health across chains.

  • wash-filter
  • cohorts
  • Solana/BTC
8 portfolio capstones

Ship projects,
not just queries.

Each capstone is a full, live-validated monitor with a scoring layer and a real finding — the pieces you actually show an employer.

P1TRADING

MEV Sandwich Radar

Rank searchers by NET profit — front + back legs minus gas minus builder tip. Teaches that extraction ≠ profit.

real finding:a 13-victim bot is net −0.10 WETH
P2QUANT

Flow-Toxicity Signal

Markout, VPIN, LVR and a per-venue quote-width recommendation — the systematic market-making stack.

real finding:fluid +14bps toxic → native −9bps benign
P3RISK

Treasury Risk Radar

Concentration (HHI + top-1), depeg $-at-risk, and days-to-exit for a treasury's positions.

real finding:$33.4B tracked · HHI 0.073 · top-1 23.5%
P4RISK

Stablecoin Health & Depeg

Peg deviation, mint/burn flow and sender concentration — with a cross-signal for distress.

real finding:FRAX −79bps + volume collapsed to $2.8M
P5RISK

Lending & Liquidation Risk

Borrow concentration, seized collateral, net-debt reconstruction and liquidation-MEV bonus.

real finding:254 liqs · $8.16M seized in 30d
P6RESEARCH

Protocol Health Dashboard

DAU, retention cohorts and wash-filtered real volume — with a volume-inflation flag.

real finding:Balancer $215B on 6,549 traders 🚩
P7RWA

RWA NAV Monitor

Tokenized-treasury issuance/redemption, holder HHI and authorized-participant concentration.

real finding:BUIDL 2,019 mints · top AP 74.4%
P8COMPLIANCE

Forensics & Intelligence

Cross-chain attribution, peel-chain laundering, Tornado/OFAC exposure and attribution-confidence scoring.

real finding:OFAC router: 398,243 ETH / 7,210 senders
What a lesson looks like

Not a video.
A worked, graded case.

Every lesson is an executable case with the wrong query, the right query, the live proof, the interview angle, and the Python companion.

Sandwich Attacker Net ProfitHARD · MEV & Order Flow
1 · Theory

A sandwich only nets positive if the bot sat on both sides of you. But gross recovered value isn't profit — subtract gas on both legs and the coinbase tip to the builder. Anchor: the Flashbots / searcher MEV market.

7 · Canonical solution
-- net = gross − gas − builder tip
SELECT attacker,
  gross_weth - gas - builder_pay AS net
FROM legs GROUP BY attacker
8 · Common mistakes
✗ WRONG

gross recovered WETH = "profit"

✓ RIGHT

net = gross − gas − builder tip

10 · Proven live on Dune
-- real query on live tables
SELECT bot, gross, gas, tip, net
FROM dex.tradesethereum.transactionsethereum.traces
0x83b4f742 gross0.2815 WETH
builder tip−0.2764 ETH
→ net+0.0009 WETH
✓ live-validated · the 13-victim bot is net −0.10 WETH
11 · Interview angle

"How would you detect a sandwich?" → MEV, atomic front/back-run, priority-gas auction. Senior tell: compare direction on addresses not symbols, and net ≠ gross.

12 · Python companion
import polars as pl
rows = DuneClient.from_env().run_sql(q).result.rows
df = pl.DataFrame(rows)
df = df.with_columns((pl.col("gross")-pl.col("gas")-pl.col("tip")).alias("net"))
1 Theory2 Question3 Schema4 Sample rows5 Approach6 Hints7 Solution8 Mistakes9 Diagram10 Proven live11 Interview12 Python
What's inside

28 modules.
329 worked cases.

Every module goes from the foundations to expert depth — each lesson graded, proven on live Dune, with a Python companion and an interview angle.

MODULE 0117 lessons

Gas, Transactions & Wallets

EIP-1559 burn decomposition · priority-fee percentiles · base-fee elasticity · gas-guzzler contracts · bot-vs-human detection

MODULE 0219 lessons

Token Analytics

transfer volume · holder concentration (HHI) · supply velocity · unlimited-approval risk · Sybil fan-out · whale accumulation

MODULE 0313 lessons

NFT Analytics

wash-filtered real volume · floor sweeps & bundles · royalty realized-vs-nominal · holder concentration · mint→first-flip economics

MODULE 0414 lessons

DEX & Lending

impermanent loss / LVR · Uniswap-v3 tick depth · health-factor reconstruction · liquidation cascades · CEX–DEX dislocation

MODULE 0513 lessons

Traces & Internal Calls

flash-loan shape · reentrancy vs batch · proxy/delegatecall maps · internal ETH reconstruction · gas attribution

MODULE 0612 lessons

MEV & Order Flow

sandwich NET profit · atomic arbitrage · backrun capture · builder / PGA economics · searcher net-profit leaderboard

MODULE 0711 lessons

Cross-Chain & Bridges

two-leg matching · settlement-latency percentiles · capital migration · whale bridging · unfilled-past-deadline deposits

MODULE 0811 lessons

L2 Analytics

L1-data vs L2-execution fee split · blob economics (EIP-4844) · sequencer margin · cross-L2 comparison · DAU growth

MODULE 0918 lessons

Real World Assets

issuance vs redemption · holder HHI · authorized-participant concentration · transfer velocity · NAV-off-chain honesty

MODULE 1012 lessons

Oracles

Chainlink heartbeat compliance · staleness detection · oracle-vs-DEX divergence · deviation-vs-heartbeat triggers · RAY/decimals

MODULE 1114 lessons

Stablecoins

peg deviation (bps) · mint/burn flow · supply velocity · CEX net-flow · sender concentration · depeg contagion

MODULE 1210 lessons

Uniswap Deep-Dive

v3/v4 volume · swap sizing by chain · daily swap counts · pool-level analytics

MODULE 138 lessons

Aave Deep-Dive

supply/borrow flows · net position · utilization · outstanding-debt & bad-debt reconstruction

MODULE 1422 lessons

Meme-coin & Smart-Money

launch-block snipers · honeypot buy/sell asymmetry · wash-volume share · serial cross-token snipers · smart-money PnL

MODULE 159 lessons

Perpetuals

volume by market · funding · OI skew · liquidations · mark/index basis — with honest on-chain data limits stated

MODULE 1614 lessons

Solana

Jito bundle-tip MEV · pump.fun graduation funnel · Jupiter vs direct routing · wash-by-balance · SPL analytics

MODULE 1713 lessons

Bitcoin / UTXO

coin-days-destroyed · common-input clustering · dormant-coin awakening · OP_RETURN carriers · SegWit/Taproot adoption

MODULE 1811 lessons

Prediction Markets

Polymarket implied probability · book depth & liquidity · calibration & Brier · resolution & settlement-timing risk · trade-journal edge-vs-variance · cross-venue law-of-one-price arbitrage

MODULE 1914 lessons

Forensics & Intelligence

cross-chain attribution · peel-chain laundering · Tornado/OFAC exposure · behavioural fingerprinting · attribution-confidence scoring

MODULE 2014 detectors

Signal Engine · Detectors

14 live detectors — depeg, sandwich, toxicity, exit-liquidity, forensics trace, oracle — each with worked example, diagram & interview angle

MODULE 2111 lessons

SQL Traps & Data Reference

the silent-wrong-answer bugs: symbol collision · avg-vs-median · evt_index · uint256 overflow · decimals · reserved keywords

MODULE 229 lessons

Tokenized Equities / Stocks

xStocks canonical-mint (beat the fakes) · cross-venue VWAP dispersion · implied price vs NAV gap · 24/7 microstructure · trader HHI · cross-chain footprint

MODULE 239 lessons

Restaking & LRTs

LRT peg/discount stress · EigenLayer restaker HHI · operator-delegation concentration · LRT supply flows · leverage-loop detection · DeFi footprint

MODULE 249 lessons

Airdrops & Sybil Detection

common-funder sybil rings · Disperse-farm funding · claim-and-dump · behavioral-clone fingerprints · sybil-adjusted real users · funder fan-in/out graph

MODULE 259 lessons

Bitcoin Ordinals · Runes · BRC-20

Runestone blockspace share · inscription-reveal detection · witness-discount fee economics · data-carrier fee-market · mint-congestion · commit→reveal lifecycle

MODULE 269 lessons

DEX Aggregators & Routing

aggregator market HHI · routed-vs-direct · CoW solver competition · batch internalization · surplus / execution quality · route complexity

MODULE 279 lessons

Governance & DAO Analytics

voting-power HHI · whale-swing decisiveness · delegate concentration · turnout decay · vote timing · acquire-then-vote attack

MODULE 289 lessons

Account Abstraction (ERC-4337)

UserOp adoption curve · bundler market HHI · paymaster sponsorship · gasless-vs-self-paid · revert gas economics · EntryPoint-version fragmentation

329 graded lessons · 14 live detectors · 8 capstonesEthereum · L2s · Solana · Bitcoin · every query proven on live Dune
◆ Founding · waitlist only
$199 at launch
$99one-time // lifetime

One payment, forever — vs $150/yr subs with none of the verified depth.

  • 329 lessons + 14 detectors + 8 capstones
  • Every query with its real live-Dune result
  • Python (Polars) companion on every lesson
  • Interview angle + portfolio per role
  • Lifetime updates as new chains land

Lock in $99

Founding price only for the list.

No spam. One launch email.

YOU'RE ON THE LIST

Founding-price link emailed at launch.

Straight talk: an education product, not a signal service. It teaches you to do the analysis — verified on real data, honest where on-chain data runs out. The moat is the knowledge.