Files
papers/lux-liquid-staking/sections/02-protocol-architecture.tex
zeekay abf99d05fc papers: reorganize into per-paper dirs, add Antje Worring as co-author
Restructured from flat .tex/.pdf files into per-paper subdirectories.
Added Antje Worring as co-author on all papers.
Synced PDFs to pdfs/ for download site.
2026-04-18 21:50:07 -07:00

59 lines
2.3 KiB
TeX

\section{Protocol Architecture}
\label{sec:architecture}
\subsection{System Components}
The LLS protocol consists of four smart contracts deployed on Lux C-Chain:
\begin{definition}[LLS Contract System]
\begin{enumerate}
\item \textbf{StakingPool}: Receives LUX deposits, delegates to validators, manages unstaking.
\item \textbf{sLUX Token}: Rebasing ERC-20 tracking proportional ownership of the staking pool.
\item \textbf{wsLUX Token}: Non-rebasing ERC-20 wrapping sLUX at a fixed exchange rate.
\item \textbf{InsurancePool}: Holds reserve funds to cover slashing losses.
\end{enumerate}
\end{definition}
\subsection{Deposit Flow}
\begin{algorithm}[H]
\caption{LUX Deposit and sLUX Minting}
\label{alg:deposit}
\begin{algorithmic}[1]
\Procedure{Deposit}{user, amount}
\State \textbf{require} amount $\geq 1$ LUX
\State Transfer $\mathsf{amount}$ LUX from user to StakingPool
\State $\mathsf{shares} \gets \mathsf{amount} \cdot \mathsf{totalShares} / \mathsf{totalPooled}$
\If{$\mathsf{totalShares} = 0$}
\State $\mathsf{shares} \gets \mathsf{amount}$ \Comment{First deposit: 1:1 ratio}
\EndIf
\State Mint $\mathsf{shares}$ sLUX to user
\State $\mathsf{totalShares} \gets \mathsf{totalShares} + \mathsf{shares}$
\State $\mathsf{totalPooled} \gets \mathsf{totalPooled} + \mathsf{amount}$
\State Queue delegation to selected validators
\EndProcedure
\end{algorithmic}
\end{algorithm}
\subsection{Withdrawal Flow}
\begin{algorithm}[H]
\caption{sLUX Withdrawal}
\label{alg:withdraw}
\begin{algorithmic}[1]
\Procedure{RequestWithdrawal}{user, shares}
\State $\mathsf{amount} \gets \mathsf{shares} \cdot \mathsf{totalPooled} / \mathsf{totalShares}$
\State Burn $\mathsf{shares}$ sLUX from user
\State $\mathsf{totalShares} \gets \mathsf{totalShares} - \mathsf{shares}$
\State Create withdrawal request $(user, \mathsf{amount}, \mathsf{timestamp})$
\State Initiate undelegation for $\mathsf{amount}$ LUX
\EndProcedure
\Procedure{FinalizeWithdrawal}{requestId}
\State \textbf{require} $\mathsf{block.timestamp} \geq \mathsf{request.timestamp} + \tau_{\text{unbond}}$
\State Transfer $\mathsf{request.amount}$ LUX to $\mathsf{request.user}$
\State $\mathsf{totalPooled} \gets \mathsf{totalPooled} - \mathsf{request.amount}$
\EndProcedure
\end{algorithmic}
\end{algorithm}