Settlement
All trades matched within GoDark's MPC engine are settled against private collateral commitments in the GoDark shielded pool.

Settlement Overview
| Aspect | Detail |
|---|---|
| Settlement chain | Solana |
| Settlement mechanism | Proof-backed shielded-pool state transitions submitted on-chain |
| Signature requirement | 3-of-5 committee members must co-sign each settlement batch |
| Confirmation | Solana slot/block production is typically ~400ms; finalized settlement follows Solana finality. |
| Collateral | Deposited into a shielded pool and represented as private note commitments |
| Oracle prices | Public price feeds ingested from Solana; used for liquidation and funding rate calculations (see Margin & Liquidation) |
Your funds remain under on-chain program controls at all times. GoDark's MPC committee does not take custody of collateral; it produces matched outcomes that are settled as shielded-pool state transitions.
Settlement Flow
- Wallet creation — Sign up with your email to receive a Fireblocks embedded wallet.
- Deposit and shield — Deposited USDC is automatically shielded into GoDark's private collateral pool.
- Trading — Trades execute off-chain in the MPC matching engine. Matched outcomes are converted into private settlement updates.
- Committee approval — Settlement batches require 3-of-5 committee member authorization before on-chain submission.
- Shielded settlement — On-chain settlement consumes private input notes and creates new private output commitments. No per-user balance ledger is published.
- Ghost withdrawal — Withdrawing proves ownership of a private commitment and releases collateral to a fresh ephemeral recipient address designed to reduce public linkability back to the user's wallet.
Shielded Pool Model
| Property | Description |
|---|---|
| Custody | SPL tokens are held in aggregate program-controlled vault accounts. |
| Private accounting | User collateral is represented as private note commitments rather than readable per-user vault balances. |
| Solvency | Aggregate vault balances can be compared against the sum of unspent private notes for each mint. |
| Auditability | Public events expose enough structure to monitor activity and solvency without revealing user-level trade data. |
For the full model, see Shielded Pool.
Settlement Query Endpoints
| Endpoint | Description |
|---|---|
GET /settlement/status/:batch_id | Get batch status. Returns: { batch_id, status, tx_signature, trade_count, created_at } |
GET /settlement/stats | Get settlement stats. Returns: { total_settled, success_rate, pending_batches, failed_batches } |
Batch Settlement Mechanics
- Batching window: Configurable (1–2 seconds default)
- Committee authorization: Each batch requires 3-of-5 MPC committee members to approve before on-chain submission.
- Private state update: Settlement consumes private input notes and creates private output commitments.
- Proof-backed execution: On-chain verification checks ownership, conservation, and operation validity before state changes commit.
- No per-fill SPL movement: SPL moves at deposit and ghost-withdrawal boundaries; matched trades update shielded-pool state.
Settlement Finality
- Settlement transactions are submitted to Solana and confirmed on-chain.
- Once the settlement transaction reaches Solana finality, settlement is irreversible.
- Aggregate pool activity is auditable via the Solana ledger while per-user amounts, positions, and counterparties remain private.