PRODUCT MASTER PLAN · PHASE-1 EXECUTION DOSSIER

GreenX
Dex

Open Perps for everyone. The whole product, decided before the first line of code — a venue in 45 days, an engine already derived, a franchise already mapped.

PHASES 1 → 3 PLANNED
BUILD WINDOW 45 DAYS
MARKETS BTC · ETH USDT-PERP
DOMAINS 9 · RESERVED MODULES R1–R8
SCROLL ↓
01
POSITION & THESIS

One signature replaces the entire onboarding funnel.

GreenX Dex is a perpetual futures venue with a Web3-native identity layer: wallet in, Hyperliquid-benchmark order book, USDT settlement. No email. No password. No friction. The program is governed by three planning principles — fixed now, enforced architecturally forever.

PRINCIPLE 01

Plan once, iterate forever

Every module the end-state product will ever contain is architected before Phase 1 begins. Later phases extend through interfaces reserved in advance — nothing is ever rebuilt.

PRINCIPLE 02

Risk is sequenced, not assumed

Matching, liquidation and market making are the last components to self-operate, not the first. Phase 1 stands on institutional-grade external risk machinery while the in-house designs mature.

PRINCIPLE 03

Built, reserved, or planned

There is no fourth state. "Reserved" is a Phase-1 engineering obligation — interface cut, schema provisioned, tests pre-written. Never a slide-deck aspiration.

ONE-SIGNATURE ONBOARDING — LIVE
02
COMPETITIVE DOCTRINE

Enter as a broker.
Graduate as a venue.
Never rewrite.

The category produced three archetypes. Hyperliquid and dYdX proved the order book wins — at the cost of purpose-built chains, years, and token treasuries spent renting liquidity. GMX-lineage pools bootstrap fast and stay capital-capped forever. GreenX takes the third door with a pre-cut exit: route-through execution now, with the order-book-native end state already specified and an engine swap that is a routing decision, not a rewrite.

// the lesson the leaders converged on, adopted here as module R6
no market ships without funded liquidity behind it   — governance as an inequality, not a slogan
ARCHETYPE 01

Order-book natives

Hyperliquid · dYdX — purpose-built chains, years, token treasuries.

BUILD COST
MAX
TIME TO LIVE
YEARS
CEILING
ARCHETYPE 02

Pool counterparties

GMX lineage — fast bootstrap, capital-capped forever.

BUILD COST
LOW
TIME TO LIVE
MOS
CEILING
POOL
ARCHETYPE 03

Route-through broker

GreenX Phase 1 — own the client, identity, custody, revenue. Exit ramp pre-cut (R1).

BUILD COST
LOW
TIME TO LIVE
45D
CEILING
R1↗
ENTER AS BROKER
GRADUATE AS VENUE
NEVER REWRITE
03
THE WHOLE-PRODUCT MODULE MAP

Nine domains. Three states.
Decided now.

The contract between phases. BUILT ships inside the 45-day window. RESERVED means the socket exists before the plug — interface, data model and extension point constructed in Phase 1. PLANNED is roadmapped with a defined dependency chain.

SHIPS IN 45 DAYS   SOCKET INSTALLED   ROADMAPPED
#DomainPhase-1 state
D1Trading DApp — wallet-login web client32 modules · connect ×3 · SIWE · book ladder · TradingView · full order lifecycleBUILT
D2Admin Operations Cockpit20 modules · treasury · fees · risk display · audit-trailed everythingBUILT
D3Execution LayerBroker-grade routing core behind the R1 interfaceBUILT R1 RESERVED
D4Market Data Layer12 modules · L2 mirror with checksums · private streams · fan-outBUILT
D5Custody & Treasury15 modules · ETH+BSC scanners · double-entry ledger · hot/cold gradientBUILT
D6In-house Matching, Risk & Liquidation EngineFully specified in Perp Solution v0.1 — mathematics finishedRESERVED
D7DMM & Hedging EngineAvellaneda–Stoikov quoting + delta hedge, dimensionedRESERVED
D8Advanced Order SuiteTP/SL · conditional · cross-margin — schema fields dormant in Phase 1RESERVED
D9Mobile Apps & Additional MarketsSame API surface · admitted under the R6 gatePLANNED
04
PHASE-1 EXECUTION MODEL

A complete venue in 45 days.

One deliberate decision makes it possible: execution routes through the Binance Link broker program. Every user maps to a segregated venue sub-account; margin, brackets, mark price, funding and liquidation run on battle-tested machinery and mirror to the user in real time. What GreenX builds — and owns:

The entire client experience

Wallet connect, SIWE auth, the full trading interface, assets, deposits, withdrawals. The routing substrate is invisible — the experience is GreenX end to end.

The identity & account fabric

Auto-provisioned UIDs bound to wallet signatures, mapped 1:1 to sub-accounts, with key issuance, scoping, rotation and revocation under GreenX custody.

Custody & treasury

ETH + BSC deposit detection, double-entry ledger with conservation invariants, master↔sub orchestration, hot-wallet watermarks, cold storage, dual-approval withdrawals.

The revenue layer

Fee/markup at ledger level plus broker-rebate ingestion and reconciliation — two audited revenue captures per trade.

The operations cockpit

The venue is operable by GreenX staff on day one, no engineering intervention required.

The market data plant

The display-and-distribution half of an exchange — built once, serving Phase 1's mirror and Phase 2's native engine unchanged.

// revenue per executed trade of notional N — ledger-native, reconciled daily
Revenue(trade) = m_p · N  +  r · f_v · N       // platform markup + broker rebate
§06 — Revenue architecture: an audited ledger fact, not a dashboard estimate
TRADEN = 3,000 USDT
$0.00PLATFORM MARKUP · m_p·N
$0.00BROKER REBATE · r·f_v·N
LEDGERRECONCILED DAILY
05
THE EXTENSION DOCTRINE

Eight sockets, installed
before the plugs exist.

R1

Execution Venue Abstraction

One interface, two implementations: BinanceLinkVenue now, GreenXNativeEngine next. The engine swap is per-market, reversible, shadow-testable.

R2

Risk Parameter Registry

Tiers, bands, caps and brackets as versioned data from day one — venue-synced in Phase 1, native-engine-consumed in Phase 2. Zero schema change.

R3

Order Schema Forward-Compat

Dormant trigger, TP/SL and TIF fields ship in the Phase-1 model. Advanced orders activate columns; they never migrate tables.

R4

Ledger Universality

Journal classes for insurance fund, MM inventory and funding settlement pre-cut. Retro-fitting a ledger is the costliest venue mistake — GreenX never will.

R5

Market Data Neutrality

Clients consume a normalized internal schema, never venue payloads. When the native engine becomes the producer, clients notice nothing.

R6

Listing Governance Hook

Every market creation passes a hedgeability gate — advisory in Phase 1, binding in Phase 2. The industry's hardest-won rule, pre-wired.

R7

Compliance & Geo-Policy Hook

A policy evaluation point in the auth path from day one. Tightening jurisdiction rules is configuration, not surgery.

R8

Data & BI Substrate

Every sequenced event doubles as an analytics fact. Phase-3 BI consumes the log Phase 1 writes — zero re-instrumentation.

06
ROADMAP

Every phase boundary is an activation,
not a construction site.

PHASE 1 · DAY 0–45

The Venue

Branded, operable, revenue-generating perpetuals platform. Two markets, full custody, complete operational control. Weeks 1–7 sequenced with exit criteria; interface freeze in week one.

PHASE 2A

The Desk

The DMM and hedging engine activate on routed markets first — inventory limits, hedge reconciliation and PnL attribution built into muscle memory under the safest possible conditions.

PHASE 2B

The Engine

In-house matching, risk and liquidation per the finished mathematics below. Market-by-market cutover, shadow-run validated, insurance fund funded, invariants I1–I6 fully armed.

PHASE 3

The Franchise

Mobile apps on the existing API surface, new markets admitted under the hedgeability score, cross-margin on the R3 schema, professional API tiering.

P1 · THE VENUE
2A · THE DESK
2B · THE ENGINE
P3 · THE FRANCHISE
07
ARCHITECTURE · DETERMINISTIC CORE

The state is a pure function
of the log.

State_t = f( State_0, e_1, e_2, …, e_t )
§11 — Event sourcing: bit-identical replay · shadow execution · counterfactual analysis

Every monetary state change is an append-only, totally ordered log entry. A regulator's question is answered by re-running history. The Phase-2 engine is validated by consuming the same stream in parallel and diffing against venue truth for weeks before it takes a single live order. Confirmation policy, likewise, is a probability statement — not a folk custom:

// and the ledger never stops asserting conservation — invariant I3, live from day one:
Σ balances + fees + treasury float  =  Σ deposits − Σ withdrawals
violation ⇒ withdrawals halt · engineering paged · the canonical detector of accounting defects
08
ARCHITECTURE · ORDER LIFECYCLE

T+0 µs → T+40 ms.
One order, six stations.

Watch a single order traverse the Phase-1 pipeline. Green is inside GreenX — microseconds. Red is the venue leg — milliseconds. Every station is idempotent: retries collapse onto the same journal entry by construction.

CLIENTsigned intentT+0
GATEWAYparse · auth · idem-key~40 µs
RISKbalance · filters · brackets~8 µs
VENUEmatch · margin · external5–40 ms
LEDGERfill + fee · atomic batchexactly-once
PUSHprivate WS to client~60 µs
// venue rate budgets enforced as a token-weight ledger per API key
a(t) = min( B, a(t₀) + r·(t − t₀) )        admit ⇔ a(t) ≥ w_c
t_retry = t₀·2^k + U(0, j)                  // exponential backoff + jitter under 429/418
§12 — earliest-deadline-first scheduling · user-facing cancels outrank telemetry
09
ARCHITECTURE · CUSTODY GRADIENT

Money flows one way.
Approval flows the other.

Deposits concentrate down a one-way gradient — user addresses, watermarked hot wallet, cold multisig. The only road back runs through a two-of-N approval gate. Watch the plant run: the gauge fills toward the watermark W*, then sweeps to cold.

DEPOSIT ADDRESSESHD-DERIVED · PER USER · PER CHAIN
HOT WALLET
W*
WATERMARKED
COLD STORAGEMULTISIG · CEREMONY · OFFLINE
⟵ WITHDRAWALS
2-OF-N
APPROVAL
// confirmations are a probability statement, not a folk custom
P(reorg ≥ k) ≈ (q/p)^k          k(V) = ⌈ log(ε/V) / log(q/p) ⌉   // scale with value at risk

// hot-wallet watermark — a newsvendor bound on compromise exposure
W* = μ_out·T + z_ε·σ_out·√T          stockout ≤ ε · exposure ≤ W*
§14, §24 — every control is cryptographic, double-entry, or dual-control
10
MATHEMATICS · LIQUIDATION

The whistle blows early.
By design.

The reserved engine's triggers are closed-form. With entry E, leverage L, tiered maintenance m and taker fee f_t (m′ = m + f_t — the forced close pays fees too):

Long:   P_liq = E · (1 − 1/L) / (1 − m′)          Short:  P_liq = E · (1 + 1/L) / (1 + m′)
Bankruptcy:  P_bkr = E · (1 ∓ 1/L)                 Partial: x* = (ρ|Q|P − Eq) / (|Q|P(ρ − c))
§18 — Perp Solution v0.1 · executions inside [P_bkr, P_liq] are venue-loss-free
LIQUIDATION CORRIDOR — INTERACTIVE
10×
P_bkr
P_liq
E = 30,000
27,149.32Liquidation price (USDT)
149.32Structural cushion / BTC
−9.5%Distance from entry
11
FEEL THE PRODUCT · LONG / SHORT

Take a position.
Survive the corridor.

A live sandbox of the §18 mathematics. You have $1,000 of margin. Choose a side, choose leverage — and the same closed-form liquidation line the engine computes will hunt your position across a random-walking market. Green line: your entry. Red line: where the whistle blows.

10×
+0.00OPEN PNL (USDT)
+0.00SESSION TOTAL
12
MATHEMATICS · FUNDING & PRICE

A war of attrition
the attacker funds.

// index: MAD-filtered, volume-weighted median — 50% breakdown point
reject i  if  |pᵢ − p̃| > κ·MAD(t),  κ = 5
B_t = λ·B_{t−Δt} + (1−λ)·(mid − P_idx),   λ = e^(−Δt/60s)
P_mark = P_idx + clip( B_t, ±0.5%·P_idx )

// funding: impact-price premium, TWAP over 8h — manipulation cost ∝ time-integral of displacement
prem(t) = [ max(0, ImpactBid − P_idx) − max(0, P_idx − ImpactAsk) ] / P_idx
F = P̄ + clip( 0.01% − P̄, ±0.05% ),   |F| ≤ 0.75%,   Σ transfers ≡ 0  // peer-to-peer, zero-sum
§17–19 — a spoofed 1-second $300 dislocation moves the mark ≈ $5, then decays
LONGS
SHORTS
PERP > INDEX — LONGS PAY SHORTS · CROWD RENT, EVERY 8H
13
MATHEMATICS · MARKET MAKING

Latency is a
pricing input.

The reserved DMM quotes around an inventory-adjusted reservation price (Avellaneda–Stoikov), and its stale-quote risk is a function of refresh latency — which is why the sub-millisecond internal budget exists in Phase 1, before the desk does.

r_t = s_t − q·γ·σ²·(T−t)          δ_a + δ_b = γσ²(T−t) + (2/γ)·ln(1 + γ/k)
p_pickoff = 2·Φ( −(δ/2) / (σ_$·√Δt) )                    // spread must scale as √latency
§20 — quoting SLOs: two-sided ±0.10% ≥95% of each hour, or the market flips reduce-only
BIDS · SIZE (BTC)
ASKS · SIZE (BTC)
PICK-OFF PROBABILITY — INTERACTIVE
50 ms
$15
2.3e-8P(picked off) per refresh
5.59σSafety distance
12 $/√sσ_$ · BTC calm regime
// hedging economics — every fill netted 250 ms, fired as one IOC on the reference venue
E[PnL_rt] = δ_eff − 2f_m − c_hedge − E[adverse]
Var[PnL_gap] = q_f²·σ_$²·Δt_h        VaR_α = z_α·σ_$·√Δt·|Δ_net|
W* = μ_out·T + z_ε·σ_out·√T          // hot-wallet watermark
H = w₁·ln(D_imp) − w₂·s_ref − w₃·(σ/σ_BTC) ≥ H_min
OI_max = φ·D_imp                     // listing gate, R6 quantified
§21–24 — the desk runs at E[PnL] ≥ 0: a liquidity utility, never a counterparty betting against users
14
CAPACITY & LATENCY

Budgeted in microseconds.
Enforced in CI.

GATEWAY INGRESS + PARSE
40 µs
PRE-TRADE CHECKS
8 µs
SEQUENCER APPEND + QUORUM ACK
90 µs
INTERNAL FAN-OUT
60 µs
INTERNAL END-TO-END (P50)
~200 µs
VENUE LEG (SUBMIT → REPORT)
5–40 ms
// matching envelope, M/M/1 — measured μ = 5×10⁵ ev/s, design load λ = 5×10⁴/s
ρ = λ/μ = 0.1        E[W] = 1/(μ−λ) ≈ 2.2 µs        // p99 lives in fsync + fan-out, not matching
§22, §25 — surveillance is O(k log n) on a trigger-price heap, not O(n) in open interest
15
INVARIANTS & FAILURE DOCTRINE

What the system
will never permit.

$ greenx invariants --assert --continuous
I1 ✓ Σ Qᵢ = 0 zero net position · every sequence number [PHASE 2]
I2 ✓ Σ Uᵢ = 0 zero-sum PnL conservation [PHASE 2]
I3 ✓ Σ bal + IF + fees = dep − wd funds conservation [PHASE 1 →]
I4 ✓ margin ⇐ P_mark only never last trade [PHASE 2]
I5 ✓ max(bids) < min(asks) no crossed book at rest [PHASE 2]
I6 ✓ replay(log) ≡ state bit-identical determinism [PHASE 1 →]
violation ⇒ halt affected surface · page engineering
FAILURE

Reference-venue outage

Health probes detect; opens halt, cancels queue, banner shows.

→ resume on stability · reconcile
FAILURE

Data staleness

Feed-age SLO breach gates quote-consuming features, discloses degraded mode.

→ failover · resnapshot
FAILURE

Scanner stall

Heartbeat lapse pauses crediting — the platform never credits blind.

→ catch-up from sealed block
FAILURE

Ledger↔venue drift

Reconciliation alarms; hard-halts the account above threshold.

→ log replay · dual-signed correction
FAILURE

Hot-wallet anomaly

Watermark and outflow monitors freeze withdrawals, isolate keys.

→ ceremony re-key · post-mortem
FAILURE

Sequencer leader loss

Quorum re-elects; the log is the single source of truth.

→ deterministic replay, identical state

Nothing in Phase 2 requires a decision that has not already been made here.

It requires only the turning of keys that Phase 1 installs. The module map fixes what exists; the reservation doctrine fixes how it grows; the mathematics fixes how it behaves under stress; the invariants fix what it will never permit.

GREENX DEX — OPEN PERPS FOR EVERYONE