Files
papers/lux-lightspeed-dex/sections/01-introduction.tex
zeekay de41e5d072 papers: replace fabricated DEX perf claims with measured numbers; document decomplected architecture
Retract the fabricated '581M/597ns / 100M+/s / 434M GPU / planet-scale' headline (a
time.Sleep sim + x40 fudge that measured nothing) across the corpus. Flagship lux-lightspeed-dex
rewritten (decomplected d-chain engine / dexvm atomic proxy / Go wrapper / 0x9010 CLOB facade;
measured GB10 104-126M & M4 Max ~250M fills/s byte-parity-gated; Knuth-D division lever; Block-STM
settlement; P3Q->starkfri rollup to Z-Chain). Technical papers (precompile-engineering, gpu-crypto-stack,
evmgpu-benchmark, p3q-corona, smart-order-routing, fhe-mpc-hybrid) carry the measured impl + cross-ref
the flagship. >1B/s framed honestly as N-node aggregation, never single-GPU. All compile.
2026-06-17 17:15:10 -07:00

77 lines
4.3 KiB
TeX

\section{Introduction}
Decentralized exchanges (DEXs) trade away performance for trustlessness. The
constant-product automated market maker (AMM) that dominates on-chain trading
prices every swap against a bonding curve, settles at block cadence, and exposes
order flow to reordering. The result is high slippage, slow finality, and value
extracted from users by adversarial transaction ordering~\cite{daian2020}.
High-frequency trading---resting limit orders, price-time priority, marketable
order execution in microseconds---has no native home on a public chain.
The obstacle is structural, not merely a matter of faster hardware. A general-purpose
EVM chain matches orders \emph{inside} a smart contract: every cross walks storage,
pays opcode-dispatch overhead, and is re-executed by every validator. Throughput is
bounded by the slowest validator's serial EVM, and latency is bounded by block time.
Bolting a faster matching engine onto such a chain does not help if the engine still
runs once per validator under the EVM's execution model.
\subsection{Approach: the DEX is a chain}
We do not add a DEX to a chain. \textbf{The DEX is a chain}---the \textbf{D-Chain},
a single-operator consensus chain whose sole purpose is matching and settling orders.
It has its own consensus, its own \texttt{zapdb} persistence, and an execution-root
state commitment in the style of the Lux XVM. It is the one and only place where
orders match and where DEX state lives. Matching runs against a native C++/GPU engine
behind a deterministic Go reference; the GPU path is gated to be byte-identical to the
reference (Section~\ref{sec:gpu-matching}).
Everything else is kept orthogonal:
\begin{itemize}
\item \textbf{Atomic proxy} (\texttt{chains/dexvm}): a \emph{stateless} component
on the public Lux network. It relays orders to the D-Chain over ZAP and moves
value in and out atomically via shared-memory import/export---the same mechanism
the X-Chain and C-Chain use to exchange assets. It holds no order book and no DEX
state (Section~\ref{sec:architecture}).
\item \textbf{Client wrapper} (\texttt{luxfi/dex}): a Go client SDK and ZAP
gateway. It carries no matching logic of its own.
\item \textbf{EVM CLOB facade} (precompile \texttt{0x9010}): a Uniswap-V4-style
\texttt{PoolManager} surface that is a \emph{central limit order book}, not an AMM.
It is an EVM/Solidity adapter into the unified D-Chain and is inert unless a venue
configures a D-Chain endpoint (Section~\ref{sec:precompile}).
\end{itemize}
The public open-source \texttt{luxd} validates the P-, C-, and X-Chains and other
sovereign L1s and \emph{excludes} the D-Chain, which is gated behind a build tag and
carries zero private dependencies. A private venue build links the C++/GPU engine.
This is the public/private seam: the open network never depends on the proprietary
matcher, and the proprietary matcher never leaks into the open network.
\subsection{Contributions}
\begin{enumerate}
\item A \textbf{decomplected} DEX architecture with one home per concern: matching
and state on the D-Chain, atomic value transport in the proxy, the client in the
wrapper, and an inert-by-default EVM facade (Sections~\ref{sec:architecture},
\ref{sec:precompile}).
\item A \textbf{consensus-determinism} discipline that runs the matcher in
\texttt{Block.Verify} against a versioned overlay and carries fills in the block
bytes, eliminating wall-clock and randomness from the consensus path
(Section~\ref{sec:determinism}).
\item A \textbf{measured}, byte-parity-gated GPU CLOB matcher: 104--126\,M fills/s
on an NVIDIA GB10 and $\sim$250\,M fills/s on an Apple M4 Max, byte-identical to a
CPU oracle, with an honest analysis of the $>$$10^{9}$/s question
(Section~\ref{sec:gpu-matching}).
\item A \textbf{market-sharded Block-STM} settlement path with a measured
conflict-detection rate, byte-identical CPU and GPU commit order
(Section~\ref{sec:settlement}).
\item A \textbf{rollup to the Z-Chain} that verifies one proof per $K$ trades, with
measured P3Q (ML-DSA) and \texttt{starkfri} (STARK/FRI) verification rates and an
honest separation of settlement \emph{finality} from matching throughput
(Section~\ref{sec:rollup}).
\end{enumerate}
All performance figures in this paper are measured on stated hardware and gated by
byte-exact parity against a reference oracle. Where a number is a projection, we label
it as such.