Protocol workbench

Order Matching And Settlement Flow

A read-only view of one mechanism, outside the article layout.

Guided simulation

Trace Sybilla from wallet session to proof-backed withdrawal

Follow the real Sybilla path: SessionAuth, notes, relation-linked intents, SurrealDB maker query, Rust matching_loop, events_chain traversal, Cairo replay, and vault withdrawal prep.

Interactive system map

From wallet session to relation graph to withdrawal proof

This follows the real Sybilla shape: Argent authorizes a temporary key, SurrealDB links users, markets, intents, trades, notes, and event-chain records, then Cairo replays that ordered history before the vault withdrawal.

Sybilla flow

SessionAuth -> relations -> matching_loop -> proof replay

resting makers
SessionAuthArgent signs temp keysigned_message recordCairo later swaps verifier keyVault depositclick to fundcreates notes rowResting makers-12 @ 99, -15 @ 101intent_user + intent_marketSurrealDB relationsgraph, not flat rowsaddress_user: address -> userintent_user: intent -> userintent_market: intent -> markettrades: old intent -> new intentnotesawaiting depositkey, owner, amount, is_activeSigned BUY intentclick after depositsession key signs price + qtyOrderbookbest ask: 99 x 12intentpriceqtyMKR B10115MKR A9912next ask: 101 x 15Balance / PnL gateclick after BUYnotes + open positionsMaker querydirection + price + marketsign_felt(quantity) = -1price <= taker_priceid NOT IN tradesRust matching_loopclick after queryconsume maker Apartially consume maker BMaker residueafter matchnew resting intentTrade relationsafter matchmaker, taker, trade_priceTaker result+20 openno residual orderevents_chainclick after matchprevious out -> new outtraverse after last WithdrawCairo input vectorevents + withdraw sigevent count + variantspublic_key + amount + recipientCairo applyreplays collateralverify signaturescompute PnL + withdrawal boundVault withdrawprogram_output calldatafact registered first