Vela: A High-Performance Verifiable Spot Exchange
Abstract
Spot trading on decentralized exchanges (DEXs) remains materially inferior to centralized exchanges (CEXs) in throughput, latency, and market-maker tooling, ceding global spot liquidity to opaque, non-custodial intermediaries. We present Vela, a spot exchange engine designed from first principles to recover CEX-grade performance while preserving the verifiability and self-custody properties of a DEX. The core engine is an optimized Rust state machine running entirely in memory, achieving a median per-operation latency of 1.08 microseconds (p50) β 4.7 times faster than the prior state of the art β and 57,300 operations per second under a realistic mixed market-making simulation across ten simultaneous markets. Exchange state is maintained in a Merkle Patricia Trie whose root is periodically committed to an underlying blockchain, anchoring state integrity to an external consensus mechanism. Verifiability is achieved through an optimistic zero-knowledge proving scheme: state updates are assumed valid by default, with a seven-day challenge window during which any party may submit a proof of incorrect execution, and an on-demand fast-finality path for users requiring immediate settlement. We introduce two features novel to DEX design: (1) a market-maker credit system enabling capital-efficient cross-market quoting analogous to CEX credit lines, implemented natively within the matching engine's state transition function with atomic collateral enforcement; and (2) private L3 market data feeds authenticated via server-issued nonce challenges and wallet signatures, substantially reducing market-maker exposure to adverse selection. We describe the full architecture, five performance optimizations including a Delta elimination that reduces p99.9 tail latency by 73%, flamegraph profiling findings, and decentralization mechanisms including forced inclusion via a delayed inbox. The Vela engine is released as open-source software under the MIT license at github.com/arpjw/vela.
Community
0 commentsNo discussion yet
Be the first to share a question or observation.