Files
papers/lux-ats-architecture/sections/03-system-architecture.tex
zeekay cb1155764d paper(ssb-partnership): Salaam Somali Bank — Shariah-native, diaspora-linked, Africa-wide modernisation
19-page paper (luxcover format) covering:
- SSB profile + diaspora corridor + why now (Honeycoin / VALR comparables)
- Partnership hypothesis (Simplici.io + Lux Network + SF Private Pay)
- Africa-at-Home concentric-rings deployment model
- Shariah-to-Lux primitive mapping (Murabahah, Mudharabah, Musharakah,
  Ijaarah, Sukuk, Takaful as typed on-chain objects with AAOIFI-aligned
  invariants)
- 5 augmentation workstreams (Shariah-native onboarding, on-chain
  Shariah contracts, diaspora corridor, drought-linked parametric
  Takaful, trade-finance digitisation)
- Commercial + compliance posture + phased roadmap
2026-06-10 22:35:36 -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, simplici\_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 Simplici 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}