Trading Dev AcademyFree quant education

Free lesson · On-chain markets

A reproducible on-chain economics study

Open interactive lessonPractice calculationsExplore labs

Start with the idea

A useful study reconstructs what was known at each block, labels economic actions and reconciles net cash rather than reporting raw transfer volume.

Symbols, units & horizon
  • Π_net: USD profit over the declared study interval
  • Π_gross: gross economic trade profit USD
  • C_gas: all successful/failed gas USD
  • C_trade: other trade/route fees USD
  • C_lock: stated capital opportunity cost USD
  • L_failed: unmatched/failure loss USD excluding costs already counted

When and why to use this

Deliver a data manifest, causal event ledger, verified model and an acceptance or rejection memo for one narrow on-chain hypothesis.

A useful study reconstructs what was known at each block, labels economic actions and reconciles net cash rather than reporting raw transfer volume.

Choose one chain, contract version, block range and hypothesis, such as whether an attainable price difference survives execution and waiting costs. Save source endpoints, hashes, decimal metadata, time zones, missing-block handling and classification rules.

Use a synthetic replay first to validate accounting, then acquire a permitted historical sample and distinguish observations from simulated actions. Compare equal-capital benchmarks, retain failures and report data gaps; do not claim a replication until the stated empirical result has actually been reproduced.

Πnet=Πgross−Cgas−Ctrade−Clock−Lfailed
Model assumptions, derivation and arithmetic

A reproducible on-chain economics study

  1. Reconcile gross economic profit from cash and token changes with external flows removed.
  2. Sum each distinct cost category without counting failed gas twice.
  3. Subtract costs and failed-leg losses; compare net result and drawdown with the frozen benchmark.
Work it by hand

Synthetic gross profit $120; gas $25, route fees $10, lock-up cost $15, failed-leg loss $30. Net=120−25−10−15−30=$40.

Apply it in a strategy

  • Deliver a data manifest, causal event ledger, verified model and an acceptance or rejection memo for one narrow on-chain hypothesis.
  • Record the input timestamp, executable quantity, currency and horizon. Reconcile the result with a cash-flow or state table.
  • Stress this failure condition: Duplicate economic activity, look-ahead oracle states and omitted failures can convert a negative executable result into apparent alpha.

Research deliverable

Build and explain a a reproducible on-chain economics study worksheet. Deliver a data manifest, causal event ledger, verified model and an acceptance or rejection memo for one narrow on-chain hypothesis.

Evidence boundary: Synthetic arithmetic and scenarios illustrate mechanics. They are not historical returns, a paper replication, or evidence of an executable edge. Research sources and their access limitations are recorded at the end of this module.

Primary research and operational references · reviewed 12 September 2026

Further reading: Daian et al. — Flash Boys 2.0 ↗

Foundational arXiv research record, 2019; subsequent venue status not checked in this pass · Review: Abstract-only review 2026-09-12. Markets/data: Ethereum decentralized exchange ordering; sample endpoints not checked. Interpretation: Explains why transaction ordering belongs in execution analysis. Limits: Historical mechanisms cannot be assumed to match current proposer/builder markets; use alongside the recent LVR checkpoint. No independent replication performed.

Further reading: Milionis et al. — Automated Market Making and Loss-Versus-Rebalancing ↗

arXiv manuscript v6, revised 20 August 2026; publication status beyond this record not checked · Review: Abstract-only review 2026-09-12. Markets/data: Continuous-time model and Uniswap v2 ETH–USDC illustration; empirical sample dates not verified. Interpretation: Separates inventory market exposure from fees and adverse selection against a rebalancing benchmark. Limits: Abstract-only access; no empirical magnitude is used here. Discrete block trading, fees and oracle changes alter a continuous model. No independent replication performed.

Further reading: Aldasoro, Beltrán & Grinberg — Stablecoin flows and spillovers to FX markets ↗

BIS Working Paper 1340, 27 March 2026 · Review: Primary publisher summary and abstract checked 2026-09-12. Markets/data: Four USD stablecoins, 27 fiat currencies, 64 exchanges, 2021–2025. Interpretation: Motivates studying stablecoin conversion as a segmented FX route with balance-sheet constraints. Limits: The identification and quantitative estimates require full-paper review; a parity gap is not a frictionless trading profit. No independent replication performed.

Further reading: Uniswap — V2 pricing ↗

Official protocol documentation, V2 · Review: Documentation inspected 2026-09-12. Markets/data: Constant-product pools; no historical sample. Interpretation: Operational reference for reserve-based swap arithmetic and external price checks. Limits: The lessons label simplified fee and execution assumptions; other pool versions require different formulas. No independent replication performed.

Research sources, review dates and limitations

Python implementation

Self-contained teaching example. Python 3.10+; dependencies and input conventions are shown in the code and notation. Run in your own Python environment.

# Python 3.10+; standard library unless NumPy is imported below.
# Inputs and outputs use the units defined in this lesson. Synthetic teaching example.
def research_net(gross,gas,trade,lock,failed_loss):
    if min(gas,trade,lock,failed_loss)<0: raise ValueError("Cost magnitudes must be nonnegative")
    return gross-gas-trade-lock-failed_loss

print(research_net(120,25,10,15,30))

Continue learning

On-Chain Markets: Data, Oracles and Execution — all lessons
  1. Raw token amounts and economic event types
  2. Transaction gas in a reporting currency
  3. Minimum output and ordering risk
  4. Time-weighted reference prices
  5. Stale oracle health versus executable collateral value
  6. Bridge fragmentation and capital lock-up
  7. Inclusion, finality and conditional loss scenarios
  8. A reproducible on-chain economics study

Quantitative finance and development glossary · Python resources and libraries · Research sources and limitations