Files
zeekayandHanzo Dev 70f6883235 Restore the regulated-markets papers; Lux holds the licences
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]>
2026-08-30 15:58:05 -07:00

114 lines
4.3 KiB
TeX

\section{System Architecture}
\label{sec:architecture}
\subsection{Deployment Model}
The ATS is implemented as a single Go binary (downstream-tenant ATS Go binary) running on Hanzo Base. Hanzo Base provides an embedded SQLite-compatible database with real-time subscriptions, authentication, and file storage. The binary packages all ATS functionality into a single deployable unit.
\begin{table}[H]
\centering
\caption{ATS system components.}
\label{tab:components}
\begin{tabular}{lrl}
\toprule
\textbf{Component} & \textbf{Count} & \textbf{Description} \\
\midrule
Collections & 32 & Data models (orders, securities, accounts, \ldots) \\
API routes & 64 & REST endpoints (/v1/\ldots) \\
Cron jobs & 19 & Scheduled tasks (settlement, compliance, \ldots) \\
Event hooks & 47 & Real-time triggers on collection changes \\
MPC signers & 3 & Threshold signature participants \\
\bottomrule
\end{tabular}
\end{table}
\subsection{Collection Schema}
The 32 collections partition the system state into distinct concerns:
\begin{table}[H]
\centering
\caption{Collection groups and their members.}
\label{tab:collections}
\begin{tabular}{lp{8cm}}
\toprule
\textbf{Group} & \textbf{Collections} \\
\midrule
Identity & accounts, investors, accreditations, kyc\_checks, aml\_screens \\
Securities & securities, offerings, partitions, documents, corporate\_actions \\
Trading & orders, executions, order\_books, quotes, rfqs \\
Settlement & settlements, transfers, mpc\_requests, mpc\_signatures \\
Compliance & compliance\_events, regulatory\_reports, audit\_logs, restrictions \\
Integration & alpaca\_accounts, alpaca\_orders, Partner\_checks, provider\_configs \\
System & configs, cron\_logs, webhooks, notifications \\
\bottomrule
\end{tabular}
\end{table}
\subsection{API Surface}
The 64 routes follow a consistent pattern under \texttt{/v1/}:
\begin{lstlisting}[language=Go,caption={Route registration pattern.}]
func RegisterRoutes(app *base.App) {
v1 := app.Group("/v1")
// Trading
v1.POST("/orders", createOrder)
v1.GET("/orders/:id", getOrder)
v1.DELETE("/orders/:id", cancelOrder)
v1.GET("/orderbook/:security", getOrderBook)
// Securities
v1.GET("/securities", listSecurities)
v1.GET("/securities/:id", getSecurityDetail)
v1.POST("/securities/:id/transfer", initiateTransfer)
// Settlement
v1.POST("/settlements/execute", executeSettlement)
v1.GET("/settlements/:id/status", getSettlementStatus)
// Compliance
v1.POST("/kyc/initiate", initiateKYC)
v1.GET("/compliance/restrictions/:investor", getRestrictions)
}
\end{lstlisting}
All routes require Hanzo IAM JWT authentication. The \texttt{owner} claim scopes all queries to the authenticated organization.
\subsection{Cron Schedule}
The 19 scheduled tasks maintain system invariants:
\begin{table}[H]
\centering
\caption{Cron job schedule.}
\label{tab:crons}
\begin{tabular}{llp{5.5cm}}
\toprule
\textbf{Job} & \textbf{Schedule} & \textbf{Function} \\
\midrule
settle\_pending & every 30s & Execute pending atomic settlements on Lux EVM \\
match\_orders & every 5s & Run matching engine against open order books \\
sync\_alpaca & every 1m & Synchronize state with Alpaca OmniSub \\
kyc\_poll & every 5m & Poll Partner for KYC/AML status updates \\
nav\_calculate & daily 00:00 UTC & Calculate NAV for fund securities \\
compliance\_scan & every 15m & Check all positions against restriction rules \\
dividend\_distribute & daily 06:00 UTC & Distribute dividends for eligible securities \\
report\_generate & daily 23:00 UTC & Generate regulatory reports (OATS, CAT) \\
mpc\_health & every 1m & Verify MPC signer liveness \\
lockup\_expire & every 1h & Release securities from expired lockup periods \\
accreditation\_check & daily 02:00 UTC & Verify investor accreditation currency \\
market\_data & every 10s & Record market data snapshots \\
fee\_sweep & daily 04:00 UTC & Sweep collected trading fees \\
position\_reconcile & every 30m & Reconcile on-chain state with ATS records \\
audit\_export & weekly Mon 01:00 & Export audit trail for compliance review \\
corporate\_action & every 1h & Process pending corporate actions \\
margin\_call & every 5m & Evaluate margin positions per \cite{lux-credit-protocol-spec} \\
signer\_rotate & monthly 1st 00:00 & Initiate MPC key rotation ceremony \\
backup\_state & every 6h & Backup ATS state to encrypted off-site storage \\
\bottomrule
\end{tabular}
\end{table}