Documentation

Overview

DARKPOOL is a private order-matching and settlement protocol for Elysium, Kinetiq's Arbitrum Orbit L2 on Hyperliquid (chain 99901, HYPE gas). Traders deposit into a vault, submit encrypted limit orders, and are matched in one-second sealed batch auctions. A settlement contract verifies every fill against what each trader signed. It reduces information leakage before execution. It does not make trading anonymous.

Order lifecycle

1. Deposit
Move WHYPE/HYPE or USDC into DarkPoolVault. Public: wallet, token, amount, time.
2. Unlock
Sign a fixed message (no transaction) to derive your view key and history key locally.
3. Sign
Sign the order as EIP-712 typed data: tokens, size, limit, expiry, epoch, fill constraints, random salt.
4. Seal
The browser reads the matcher's X25519 key from MatcherRegistry on-chain and encrypts the order with HPKE (RFC 9180), padded to 2 KB.
5. Submit
The ciphertext is posted under a random 128-bit handle. No sign-in, so the API cannot link the order to your wallet.
6. Match
The matcher verifies the signature, epoch, cancellation and vault balance, then includes the order in the next batch auction.
7. Settle
A relayer submits the matcher-signed batch. DarkPoolSettlement re-verifies everything and moves vault balances atomically.
8. Status
The matcher encrypts status updates to your view key. Your browser polls by handle and decrypts them.

Trust model

The privacy guarantee depends on who holds the matcher's decryption key. The current mode is published on-chain in MatcherRegistry and shown throughout the app.

Operator-trusted (S1)
The matcher is a separate process and is the only holder of the key. The API, database and relayer see only ciphertext. The matcher operator can read orders. This is the current mode.
Attested (S2)
The same matcher runs in a TEE (AWS Nitro or Intel TDX). The key is generated inside the enclave and its code measurement is registered on-chain. You then trust the hardware vendor and the reproducible build. Requires enclave hosting.
Key rotation
Rotations are timelocked (48 h on mainnet) and emit events, so you can cancel and withdraw before a new key takes effect. The guardian can revoke a key immediately, which only halts settlement.
Relayer
Pays gas only. It cannot alter matcher-signed batches. Anyone can resubmit one.
Elysium sequencer
A single sequencer (Conduit) sees transactions before inclusion. It can delay or censor, but it cannot change signed prices. Forced inclusion through HyperEVM remains available.

What is public and what is protected

Protected
Unfilled, cancelled and expired orders; their side, size, limit and timing; your order list (client-encrypted); the link between your wallet and submitted orders at the API.
Public on fill
The filled order's full signed struct, including total size and limit, the filled quantity, the batch clearing price, and the maker address (vault balance changes).
Always public
Vault deposits and withdrawals, on-chain cancellations (as opaque hashes), epoch bumps.
Seen by the API
Your IP address and request timing. IPs are used only for in-memory rate limits and are never logged. Use a VPN or Tor if that matters to you.
Mitigations
Split orders into independently salted parts (conceal size), fund the vault at a different time from trading, and use minimum fill sizes against probing.

On-chain guarantees

These hold even if the matcher is malicious. Each one has adversarial Foundry tests.

Limit price
Net of fees, no fill is worse than the price you signed (exact cross-multiplication).
Validity
No fill before validAfter, after expiry, after an on-chain cancel, or after an epoch bump.
Size
No overfill of sellAmount or of the buy cap; no fill below minimum except a completing one; per-batch cap and minimum interval for TWAP.
Uniform price
Every fill in a batch uses the same clearing price (1 atom rounding slack), so the matcher cannot price users differently.
Conservation
For each token, debits equal credits plus fees. The vault enforces this again independently.
Replay
The EIP-712 domain binds chain id and contract. Batch ids increase strictly. An order can fill at most once per batch.
Custody
Withdrawals cannot be paused. There is no admin path to user funds. The contracts are immutable.

Matching rules

Each batch is a uniform-price call auction. The clearing interval maximises matched volume. The price is the HyperCore reference mid clamped into that interval when one is available, otherwise the interval midpoint, snapped to a decimal tick within 1 bp so that fills convert exactly. The long side is allocated by limit price, then arrival time, with pro-rata at the marginal price. A maker's own crossing orders never match each other. Non-crossing two-sided quotes are allowed.

MEV and ordering

Elysium has no public mempool, and settlement executes at prices both sides signed, so there is no AMM curve to sandwich and no order for third parties to copy before settlement. Batching removes latency races inside a batch. Remaining exposure: the sequencer operator, and Timeboost express-lane holders once Timeboost ships, can observe settlement transactions before inclusion and delay them.

Contracts

DarkPoolVault
Custody, deposits (balance-delta checked), withdrawals (never pausable), netted settlement moves.
DarkPoolSettlement
Batch and OTC settlement, cancels, epochs, markets, fee (hard cap 30 bps).
MatcherRegistry
Matcher signer, HPKE key, trust mode and TEE measurement, with timelocked rotation.
Canonical tokens
WHYPE 0xbA87…5E81 and USDC 0xb47c…0B65 on Elysium mainnet, per Kinetiq's contract list.

Status labels

Mainnet
Contracts deployed on Elysium 99901 with canonical tokens.
Testnet
Elysium testnet 99801. Real infrastructure with valueless tokens.
Dev · mock
A local development chain with mock tokens. Nothing on it has value.
Not deployed
No DARKPOOL deployment exists for the connected network. Trading is disabled and nothing is simulated.

Known limitations

Operator trust (S1)
Until the attested enclave is live, the matcher operator can read orders and could trade on that information on other venues.
Filled-order linkage
Settlement reveals the maker wallet and the full signed order of every filled order. Shielded balances (S3) are research, not a commitment.
No on-chain reference yet
The HyperCore market-data precompile is not live. Until it is, the price is the auction midpoint and the reference band is not enforced on-chain.
Liveness
The matcher can ignore or delay orders. You can always cancel on-chain and withdraw.
Griefing
A trader who withdraws between matching and settlement makes that batch revert. The matcher retries without them and excludes them temporarily.
Smart-contract wallets
Supported for signing via ERC-1271. Key derivation assumes deterministic signatures, so some smart wallets need a different key backup.
Audit
Not yet audited. Do not deposit funds you cannot afford to lose.

Full research, architecture and threat model: darkpool/docs.