Design Perpetual Futures

Hard45 min
1 / 30
understanding8 min read

Problem Statement: Perpetual Futures Exchange

Problem Statement: Perpetual Futures Exchange — perpetual futures interview depth

Problem Statement: Perpetual Futures Exchange

Design a dYdX/GMX-class perpetual futures venue: leveraged exposure without expiry, collateralized by a vault, priced by mark for margin and liquidations, anchored to a spot index via funding. This section (sec-01, order 1) covers problem statement in the understanding phase.

Mechanism

  • Perpetual swap tracks index via funding payments
  • Position size notional = margin × leverage
  • Insurance fund absorbs shortfall on bad debt
  • Oracle index + mark TWAP for manipulation resistance

Failure modes

  • cascade liquidations during volatility spikes
  • oracle staleness triggering unfair liquidations
  • negative funding squeezing crowded longs
  • ADL when insurance fund insufficient

Interview checkpoint (sec-01)

  • Perpetual has no delivery date—funding replaces expiry
  • Mark price ≠ last trade; used for margin checks
  • Liquidation engine must be deterministic and auditable

Staff+ talking point

Unique angle sec-01: perpetual futures exchange (Problem Statement) — emphasize leveraged long/short with no expiry date and mark price drives pnl, funding, and liquidations without repeating AMM reserve templates.

Quantify open interest, funding bps, and liquidation penalty before naming cloud services—interviewers at dYdX, GMX, and Perpetual Protocol expect risk-first narration.

javaOne Dark Pro
1public record PerpPosition(String account, long sizeBase, long entryPrice, int leverage) {}
pythonOne Dark Pro
1def notional(size: float, mark: float) -> float:
2 return abs(size) * mark
typescriptOne Dark Pro
1export type Position = { size: bigint; entryPrice: bigint; margin: bigint };

Why interviewers care

Perpetual Futures interviews reward crisp scope, explicit trade-offs, and failure stories—not generic microservice diagrams.

Interview checkpoint

Name one failure story for Problem Statement: Perpetual Futures Exchange that proves you understand real outages, not happy-path diagrams.

Key Highlights

  • Leveraged long/short with no expiry date
  • Mark price drives PnL, funding, and liquidations
  • Collateral vault with cross-margin accounting
  • Hybrid: on-chain settlement + off-chain matching optional
Mention this
Tie Problem Statement: Perpetual Futures Exchange to **mark price**, **funding**, and **insurance fund**—signals production perps literacy.
Pro tip
Always separate **index** (external spot) from **mark** (risk) when explaining liquidations in Problem Statement: Perpetual Futures Exchange.

Section Rescue Kit

Buzzwords to use:

Funding rateMaintenance margin

Safe statements:

  • "For Problem Statement: Perpetual Futures Exchange, I'll state vault≥liabilities invariant before cloud SKUs."
  • "I'll walk deposit → open → funding → liquidation when stuck."
Design Perpetual Futures - System Design | WinJob | WinJob