Settlement

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

Settlement Flow

Settlement Overview

AspectDetail
Settlement chainSolana
Settlement mechanismProof-backed shielded-pool state transitions submitted on-chain
Signature requirement3-of-5 committee members must co-sign each settlement batch
ConfirmationSolana slot/block production is typically ~400ms; finalized settlement follows Solana finality.
CollateralDeposited into a shielded pool and represented as private note commitments
Oracle pricesPublic 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

  1. Wallet creation — Sign up with your email to receive a Fireblocks embedded wallet.
  2. Deposit and shield — Deposited USDC is automatically shielded into GoDark's private collateral pool.
  3. Trading — Trades execute off-chain in the MPC matching engine. Matched outcomes are converted into private settlement updates.
  4. Committee approval — Settlement batches require 3-of-5 committee member authorization before on-chain submission.
  5. Shielded settlement — On-chain settlement consumes private input notes and creates new private output commitments. No per-user balance ledger is published.
  6. 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

PropertyDescription
CustodySPL tokens are held in aggregate program-controlled vault accounts.
Private accountingUser collateral is represented as private note commitments rather than readable per-user vault balances.
SolvencyAggregate vault balances can be compared against the sum of unspent private notes for each mint.
AuditabilityPublic 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

EndpointDescription
GET /settlement/status/:batch_idGet batch status. Returns: { batch_id, status, tx_signature, trade_count, created_at }
GET /settlement/statsGet settlement stats. Returns: { total_settled, success_rate, pending_batches, failed_batches }

Batch Settlement Mechanics

Settlement Finality