Trading Dev AcademyFree quant education

Free lesson · Crypto derivatives

Reconcile the funded spot–perpetual hedge

Open interactive lessonPractice calculationsExplore labs

Start with the idea

Equal spot and short-perpetual quantities remove some price exposure, but their basis can change and funding, financing and costs remain.

Symbols, units & horizon
  • q: matched positive base units long spot/short linear perpetual
  • S_0,S_1: spot entry/exit USD/base
  • P_0,P_1: perpetual entry/exit USD/base
  • F: signed funding received USD
  • B: financing cost USD
  • C: fees USD
  • Π: total holding-period USD profit

When and why to use this

Deliver a reproducible carry project with cash-flow reconciliation, basis sensitivity and a failed-margin scenario.

Equal spot and short-perpetual quantities remove some price exposure, but their basis can change and funding, financing and costs remain.

Record spot entry/exit, perpetual entry/exit, matched base units, signed funding, financing and every fee. Do not force the perpetual exit to equal spot unless the scenario states it.

Reconcile each leg first. Then replay margin to determine whether that terminal ledger was reachable. A hedge that liquidates midway cannot claim the hypothetical final convergence profit.

Π=q(S1−S0)+q(P0−P1)+F−B−C
Model assumptions, derivation and arithmetic

Reconcile the funded spot–perpetual hedge

  1. Calculate long spot P&L q(S_1−S_0).
  2. Calculate short perpetual P&L q(P_0−P_1).
  3. Add funding, subtract financing and fees, then reconcile cash and margin paths.
Work it by hand

.1 BTC: spot 50000→52000 earns $200; perp 50500→52100 loses $160; funding +$13, financing $20, fees $8. Total=200−160+13−20−8=$25.

Apply it in a strategy

  • Deliver a reproducible carry project with cash-flow reconciliation, basis sensitivity and a failed-margin scenario.
  • Record the input timestamp, executable quantity, currency and horizon. Reconcile the result with a cash-flow or state table.
  • Stress this failure condition: Matched underlying quantity does not remove funding, basis, custody or collateral risk.

Research deliverable

Build and explain a reconcile the funded spot–perpetual hedge worksheet. Deliver a reproducible carry project with cash-flow reconciliation, basis sensitivity and a failed-margin scenario.

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: Schmeling, Schrimpf & Todorov — Crypto carry ↗

BIS Working Paper 1087; initially April 2023 · Review: Primary publisher summary and abstract checked 2026-09-12; full paper not reviewed in this authoring pass. Markets/data: Bitcoin and Ether spot/futures; exact sample endpoints not verified in this pass. Interpretation: Motivates separating quoted carry from capital and margin constraints. Limits: Summary-level access; no inference that a quoted basis is a realizable return. 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.

Research sources, review dates and limitations

Connect the ideas: Constraints and survival

Retrieve: A desired position must fit available capital and explicit limits.

Check the change: Portfolio weights, venue collateral, working orders and redemption obligations impose different constraints.

Risk → Portfolio construction → Optimization → Arbitrage → Execution & microstructure → Fund operations & capstone

Explain it yourself: Can an offsetting terminal payoff remove a margin problem today?

Self-assessed. Write your explanation before opening this comparison.

No. Cash may be required before the hedge pays, or in another account. Check the path, collateral location and feasible transfer times.

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 hedge_ledger(q,spot0,spot1,perp0,perp1,funding,financing,fees):
    if q<0 or min(spot0,spot1,perp0,perp1)<=0 or min(financing,fees)<0: raise ValueError("Invalid hedge inputs")
    spot=q*(spot1-spot0)
    derivative=q*(perp0-perp1)
    return spot,derivative,spot+derivative+funding-financing-fees

print(hedge_ledger(.1,50000,52000,50500,52100,13,20,8))

Continue learning

Crypto Derivatives: Carry, Funding and Liquidation — all lessons
  1. Linear contract payoff and the multiplier
  2. Inverse contracts pay in the base asset
  3. Basis annualization and its limits
  4. Perpetual funding as actual cash flows
  5. Equity versus maintenance along a price path
  6. Solve a simplified liquidation boundary
  7. Collateral depegs and wrong-way exposure
  8. Reconcile the funded spot–perpetual hedge

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