mirror of
https://github.com/lux-apps/papers.git
synced 2026-11-03 05:07:46 +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]>
59 lines
1.8 KiB
TeX
59 lines
1.8 KiB
TeX
\section{Traditional Venue Integration}
|
|
\label{sec:traditional}
|
|
|
|
\subsection{Alpaca OmniSub}
|
|
|
|
Alpaca serves as the primary traditional equity execution provider. The integration uses the Alpaca Broker API for account management and order routing:
|
|
|
|
\begin{lstlisting}[language=Go,caption={Alpaca provider implementation.}]
|
|
type AlpacaProvider struct {
|
|
client *alpaca.Client
|
|
mu sync.RWMutex
|
|
}
|
|
|
|
func (a *AlpacaProvider) Submit(
|
|
ctx context.Context, order Order,
|
|
) (*Execution, error) {
|
|
req := alpaca.PlaceOrderRequest{
|
|
Symbol: order.Symbol,
|
|
Qty: decimal.NewFromInt(int64(order.Quantity)),
|
|
Side: mapSide(order.Side),
|
|
Type: mapOrderType(order.Type),
|
|
TimeInForce: mapTIF(order.TimeInForce),
|
|
}
|
|
|
|
if order.Type == Limit {
|
|
req.LimitPrice = &order.Price
|
|
}
|
|
|
|
alpacaOrder, err := a.client.PlaceOrder(req)
|
|
if err != nil {
|
|
return nil, fmt.Errorf("alpaca submit: %w", err)
|
|
}
|
|
|
|
return &Execution{
|
|
OrderID: order.ID,
|
|
Venue: a.ID(),
|
|
ExternalID: alpacaOrder.ID,
|
|
Status: mapStatus(alpacaOrder.Status),
|
|
}, nil
|
|
}
|
|
|
|
func (a *AlpacaProvider) SettlementTime() time.Duration {
|
|
return 24 * time.Hour // T+1 for equities
|
|
}
|
|
\end{lstlisting}
|
|
|
|
\subsection{Settlement Reconciliation}
|
|
|
|
For orders executed on traditional venues, the SOR reconciles settlement between the off-chain execution and on-chain records:
|
|
|
|
\begin{enumerate}[nosep]
|
|
\item Traditional venue executes the order (T+0 execution).
|
|
\item SOR records execution in the \texttt{executions} collection.
|
|
\item Traditional venue settles (T+1 for equities).
|
|
\item SOR mints/burns tokenized wrapper on Lux EVM to reflect settlement.
|
|
\item On-chain state reconciled with off-chain position.
|
|
\end{enumerate}
|
|
|