Technical note · 2026

Vela Exchange

A Rust exchange research system spanning deterministic price-time matching, signed order flow, ledger integration, real-time feeds, and experimental proof machinery.

Status Research concluded Environment Testnet research Funds No real funds
01 / Overview

An exchange built as a systems problem

Fast matching is only one part of an exchange. Vela explored how order handling, financial state, market data, and verification fit together.

The Rust workspace brings together a price-time priority order book, wallet-signed requests, HTTP and WebSocket interfaces, a conditional PostgreSQL ledger commit path, a Sepolia contract demo, and local commitment and proving experiments.

Implemented in code

Deterministic matching, signed API requests, market data feeds, local state roots and batch records.

Conditional path

A configured PostgreSQL ledger can commit matched financial effects before customer acknowledgement.

Research only

External proving, public data availability, on-chain dispute enforcement and forced inclusion.

02 / Measurements

Measured engine performance

Recorded May 20, 2026 on an Apple M3. These isolated results have not been reproduced on the current code and do not represent exchange capacity.

realistic_mm_workload times single-threaded engine.process() calls. It excludes networking, signatures, database commits, custody, and settlement.

Realistic MM workload, p500.38 μsper in-process request
Historical engine rate2.5M/sisolated operations, not trades

Order-path operations

Historical Phase 3 measurements / Apple M3
BenchmarkTime (p50)Throughput
realistic_mm_workload0.38 μs / request2.5M ops/sec
post_order_gtc9.13 μs—
cancel_order10.16 μs—
fill_order3.80 μs—
fok_rollback802 ns—
hft_nonce_window (20 orders)27.98 μs715k orders/sec
credit_auto_cancel4.10 μs—

Overhead and components

Historical isolated measurements / Apple M3
BenchmarkTime (p50)
fee_calculation_overhead/with_fees3.81 μs
fee_calculation_overhead/zero_fees3.43 μs
latency_percentiles/post_order_raw (p50)1.019 μs
component_breakdown/user_metadata_clone58.2 ns
component_breakdown/nonce_window_accept19.5 ns
component_breakdown/engine_process_post_order1.95 μs
03 / System design

From signed request to committed state

The core is a Rust workspace. In ledger-backed mode, a successful financial response waits for the database commit. In demo mode without a ledger, balances are non-authoritative.

  1. 01AuthenticateWallet-signed order intent enters the Axum API.
  2. 02MatchThe ordered stream runs through the Rust limit order book.
  3. 03Commit if configuredBalanced ledger effects and an outbox event become durable.
  4. 04RespondHTTP and WebSocket clients receive the resulting events.

Research side path: local state roots → batch records and local data availability → experimental prover.

Core

Matching engine

Price-time priority books hold FIFO resting orders within ordered price levels. GTC, post-only, IOC and FOK use fixed-point arithmetic, nonce checks, reservations, fees and discardable delta buffers.

Interface

API and feeds

Axum handles signed orders and cancellations, market data, account views and WebSocket topics. Short-lived account-bound sessions protect private reads; feed sequences support gap detection.

Local state

State and recovery

Hot books and account state live in memory. Local roots, snapshots and write-ahead records support research inspection and demo recovery. Configured ledger balances replace recovered snapshot financial values.

Conditional

Ledger commit

When configured, balanced idempotent effects and an outbox event post in one serializable PostgreSQL transaction. The API publishes proposed financial state only after that commit.

Local research path

Committer

Ordered requests and fills become hashed batch records. The current data-availability adapter writes locally; a hash alone cannot ensure public access to batch data.

Experimental

zkVM adapter

Deterministic replay and an SP1-compatible adapter sit behind configuration. The default provider is PlaceholderProver; no on-chain verifier is deployed.

04 / Engine details

Mechanisms inside the engine

Market-maker limits

Aggregate quoting limits can evict older resting orders across markets. A rolling 20-entry nonce window accepts overlapping signed requests without accepting a duplicate nonce. This is engine behavior, not a production credit facility.

Deterministic updates

Fixed-point values, ordered price levels and copy-on-write deltas keep order handling reproducible. Batch dispatch groups independent market work; shared financial state still needs careful merge rules.

Market data

WebSocket topics carry book, trade, market and authenticated account events. Reference charts can use external spot prices while testnet orders execute against Vela's separate synthetic book.

Exploratory extensions

The repository also contains feature-gated or incomplete work on committees, TEE attestation, perpetual margin math, FIX sessions and agent interfaces.