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]>
65 lines
1.7 KiB
TeX
65 lines
1.7 KiB
TeX
\section{Market Data Aggregation}
|
|
\label{sec:marketdata}
|
|
|
|
\subsection{Consolidated Quote}
|
|
|
|
The SOR maintains a consolidated quote across all venues for each security:
|
|
|
|
\begin{lstlisting}[language=Go,caption={Consolidated quote aggregation.}]
|
|
type ConsolidatedQuote struct {
|
|
SecurityID SecurityID
|
|
NBBO NBBO
|
|
Venues []VenueQuote
|
|
Timestamp time.Time
|
|
}
|
|
|
|
type NBBO struct {
|
|
BidPrice decimal.Decimal
|
|
BidSize uint64
|
|
BidVenue ProviderID
|
|
AskPrice decimal.Decimal
|
|
AskSize uint64
|
|
AskVenue ProviderID
|
|
}
|
|
|
|
func (r *Router) consolidateQuotes(
|
|
secID SecurityID,
|
|
) (*ConsolidatedQuote, error) {
|
|
var quotes []VenueQuote
|
|
var mu sync.Mutex
|
|
var wg sync.WaitGroup
|
|
|
|
for _, p := range r.providers {
|
|
if !p.Supports(secID) {
|
|
continue
|
|
}
|
|
wg.Add(1)
|
|
go func(prov Provider) {
|
|
defer wg.Done()
|
|
q, err := prov.Quote(context.Background(),
|
|
QuoteRequest{Security: secID})
|
|
if err != nil {
|
|
return // skip unavailable venues
|
|
}
|
|
mu.Lock()
|
|
quotes = append(quotes, VenueQuote{
|
|
Provider: prov.ID(), Quote: *q,
|
|
})
|
|
mu.Unlock()
|
|
}(p)
|
|
}
|
|
wg.Wait()
|
|
|
|
nbbo := computeNBBO(quotes)
|
|
return &ConsolidatedQuote{
|
|
SecurityID: secID,
|
|
NBBO: nbbo,
|
|
Venues: quotes,
|
|
Timestamp: time.Now().UTC(),
|
|
}, nil
|
|
}
|
|
\end{lstlisting}
|
|
|
|
The market data infrastructure descends from Arca's \texttt{miners/binance-recorder}, which recorded and replayed exchange data feeds for market analysis. The Lux SOR extends this to aggregate real-time quotes from all 16 providers.
|
|
|