mirror of
https://github.com/lux-apps/papers.git
synced 2026-10-30 18:15:21 +00:00
A July commit removed eight papers on the premise "no license — DEX/non-custodial only". That premise is wrong: Lux operates an ATS, a broker-dealer, a transfer agent and a bank, and this material is resold at lux.financial. The merge that brought main in preserved the removal because the commit stated a reason, which is how a stale reason outlives the fact it rested on. Back, at the versions main carried — main never received the removal, so its copies are the later ones: the ATS architecture, the security-token standard, smart order routing, institutional custody, MPC custody, post-quantum securities, the SSB partnership and the CoinBridge brief. 83 files. Co-authored-by: Hanzo Dev <[email protected]>
54 lines
1.8 KiB
TeX
54 lines
1.8 KiB
TeX
\section{ZAP Wire Protocol}
|
|
\label{sec:zap}
|
|
|
|
\subsection{Binary Serialization}
|
|
|
|
Orders transmitted between the SOR and execution providers use the ZAP binary wire protocol \cite{lux-zap-wire-protocol} for minimal serialization overhead:
|
|
|
|
\begin{table}[H]
|
|
\centering
|
|
\caption{ZAP order message format.}
|
|
\label{tab:zap-format}
|
|
\begin{tabular}{llrl}
|
|
\toprule
|
|
\textbf{Field} & \textbf{Type} & \textbf{Bytes} & \textbf{Description} \\
|
|
\midrule
|
|
magic & uint16 & 2 & Protocol identifier (0x5A41) \\
|
|
version & uint8 & 1 & Protocol version \\
|
|
msg\_type & uint8 & 1 & Message type (order, cancel, exec, \ldots) \\
|
|
flags & uint16 & 2 & Bit flags (side, TIF, compliance) \\
|
|
security\_id & bytes32 & 32 & Security identifier \\
|
|
order\_id & bytes16 & 16 & Order identifier \\
|
|
price & uint64 & 8 & Price in basis points \\
|
|
quantity & uint64 & 8 & Quantity in base units \\
|
|
timestamp & uint64 & 8 & Nanosecond timestamp \\
|
|
partition & bytes32 & 32 & Partition identifier \\
|
|
checksum & uint32 & 4 & CRC-32C checksum \\
|
|
\midrule
|
|
\multicolumn{2}{l}{\textbf{Total}} & \textbf{114} & \\
|
|
\bottomrule
|
|
\end{tabular}
|
|
\end{table}
|
|
|
|
At 114 bytes per order message, ZAP achieves serialization latency under 1 microsecond on modern hardware, compared to 50--200 microseconds for JSON-based protocols.
|
|
|
|
\subsection{Latency Comparison}
|
|
|
|
\begin{table}[H]
|
|
\centering
|
|
\caption{Serialization latency comparison.}
|
|
\label{tab:latency}
|
|
\begin{tabular}{lrrr}
|
|
\toprule
|
|
\textbf{Protocol} & \textbf{Message Size} & \textbf{Serialize} & \textbf{Deserialize} \\
|
|
\midrule
|
|
ZAP (binary) & 114 B & 0.8 $\mu$s & 0.6 $\mu$s \\
|
|
Protocol Buffers & 180 B & 3.2 $\mu$s & 2.8 $\mu$s \\
|
|
FlatBuffers & 192 B & 1.5 $\mu$s & 0.4 $\mu$s \\
|
|
JSON & 420 B & 52 $\mu$s & 38 $\mu$s \\
|
|
FIX (text) & 350 B & 28 $\mu$s & 22 $\mu$s \\
|
|
\bottomrule
|
|
\end{tabular}
|
|
\end{table}
|
|
|