Files

64 lines
1.7 KiB
TeX

\section{Security}
\subsection{Validator Incentives}
\textbf{Staking}: Validators lock 1M LUX (\$10M at \$10/LUX).
\textbf{Rewards}:
\begin{equation}
R_v = R_{\text{base}} + R_{\text{fees}} + R_{\text{MEV}}
\end{equation}
where:
\begin{itemize}
\item $R_{\text{base}}$: 5\% annual inflation
\item $R_{\text{fees}}$: 0.05\% of volume
\item $R_{\text{MEV}}$: Fair distribution of any captured MEV
\end{itemize}
\textbf{Slashing conditions}:
\begin{enumerate}
\item Incorrect ordering (detected via zk-SNARK)
\item Downtime $>$1\% (SLA violation)
\item Censorship (refusing valid transactions)
\item Collusion (coordinated frontrunning)
\end{enumerate}
\textbf{Penalty}: 10\% of stake burned + ejection from validator set.
\subsection{Circuit Breakers}
\textbf{Volatility protection}: Halt trading if price moves $>$10\% in 1 minute.
\begin{lstlisting}[language=Go]
func (dex *LuxDEX) CheckCircuitBreaker(pair TradingPair) error {
priceNow := dex.GetPrice(pair)
price1MinAgo := dex.GetHistoricalPrice(pair, time.Now().Add(-1*time.Minute))
change := math.Abs(priceNow - price1MinAgo) / price1MinAgo
if change > 0.10 {
dex.HaltTrading(pair, 5*time.Minute)
return ErrCircuitBreakerTriggered
}
return nil
}
\end{lstlisting}
\textbf{Resume}: After 5-minute cooldown or manual governance override.
\subsection{Oracle Integration}
For price feeds, we use \textbf{decentralized oracles} (Chainlink, Pyth):
\begin{itemize}
\item 50ms update frequency
\item Aggregated from 20+ data sources
\item Outlier rejection (median of medians)
\item On-chain verification
\end{itemize}
\textbf{Use case}: Mark prices for liquidations, funding rates.