mirror of
https://github.com/lux-apps/papers.git
synced 2026-11-03 05:07:46 +00:00
Sweep across the non-Tier-1 paper catalogue (Tier-1 owned by parallel
agent and excluded). All 113 processed papers already had luxcover
wired up; this commit fixes 14 build breakers and produces fresh
PDFs across the catalogue.
Fixes:
- lux-blockchain-scaling-laws: em-dash inside lstlisting -> --
- lux-corona-pq: stale \input pointing at 03-the-corona-scheme renamed
to 03-the-corona-scheme (file already renamed on disk)
- lux-lattice-cryptography-primer: same Corona->Corona rename
- lux-formal-verification-lean4: Lean source uses unicode (×, ∀, ∃, ∈,
∧, ∨, ∩, ≠, ⟨, ⟩, ·, ¬) inside lstlistings. Added a literate map
so listings render the math glyphs without UTF-8 fault.
- lux-id-did-specification: ✓/✗ in tabular replaced with \ding{51}
/ \ding{55} (pifont). Added pifont package.
- lux-ntt-simd-implementation: middle-dot in Go assembly listings;
added literate {·}{\textperiodcentered}.
- lux-ntt-transform: μ, ×, –, — in regular text (no T1 fontenc).
Replaced with $\mu$/$\times$/--/--- via unicode->latex sweep.
- lux-perpetuals-derivatives, lux-quantum-consensus,
lux-quasar-consensus, lux-tee-computing-mesh: same unicode->latex
sweep across body text. Also fixed broken math segment
`$L_{avg} = 10$\times$$` -> `$L_{avg} = 10\times$`.
- lux-zchain: emoji glyphs in roadmap table replaced with
parenthetical text.
- lux-triple-proof-consensus: dropped duplicate \usepackage{geometry}
that clashed with luxcover (geometry option clash).
- pq: defined missing \Rq macro.
PDFs rebuilt for the full Tier-2/3 set.
Excluded (Tier-1, parallel agent): lp-073-pulsar, lp-stricte2epq,
dag-evm-formal, lp-010-quasar-stm-{3,4}, lp-020-quasar-consensus,
lux-institutional-custody, lux-nist-mptc-submission, pqsafe-il5,
pq-rns, plus shared/ and lps/.
84 lines
3.4 KiB
TeX
84 lines
3.4 KiB
TeX
\section{Perpetual Futures Protocol}
|
|
|
|
|
|
\subsection{Contract Specification}
|
|
|
|
Perpetual futures are derivative contracts without expiration, maintaining price convergence with underlying assets through funding payments. Our implementation extends GMX2's position management with enhanced mechanics.
|
|
|
|
\begin{definition}[Perpetual Position]
|
|
A perpetual position $P$ is defined as:
|
|
\begin{equation}
|
|
P = \{S, C, E, F_e, L, t_o, \text{isLong}\}
|
|
\end{equation}
|
|
where $S$ is position size, $C$ is collateral, $E$ is entry price, $F_e$ is entry funding rate, $L$ is leverage, $t_o$ is opening time, and \text{isLong} indicates direction.
|
|
\end{definition}
|
|
|
|
\subsection{Funding Rate Mechanism}
|
|
|
|
Funding rates incentivize price convergence between perpetual and spot markets. We calculate funding every 8 hours using:
|
|
|
|
\begin{equation}
|
|
F_t = \frac{P_{\text{mark}} - P_{\text{index}}}{P_{\text{index}}} \cdot \frac{1}{T_{\text{funding}}} + \beta \cdot I_t
|
|
\end{equation}
|
|
|
|
where $P_{\text{mark}}$ is mark price, $P_{\text{index}}$ is index price, $T_{\text{funding}} = 8$ hours, $\beta$ is interest rate component, and $I_t$ is prevailing interest rate.
|
|
|
|
\begin{algorithm}
|
|
\caption{Dynamic Funding Rate Calculation}
|
|
\begin{algorithmic}[1]
|
|
\STATE \textbf{function} calculateFundingRate($\text{token}$)
|
|
\STATE $\text{timeDelta} \gets \text{block.timestamp} - \text{lastFundingTime}[\text{token}]$
|
|
\IF{$\text{timeDelta} < \text{fundingInterval}$}
|
|
\RETURN $0$
|
|
\ENDIF
|
|
\STATE $\text{intervals} \gets \text{timeDelta} / \text{fundingInterval}$
|
|
\STATE $\text{openInterest}_{\text{long}} \gets \text{getOpenInterest}(\text{token}, \text{true})$
|
|
\STATE $\text{openInterest}_{\text{short}} \gets \text{getOpenInterest}(\text{token}, \text{false})$
|
|
\STATE $\text{imbalance} \gets |\text{openInterest}_{\text{long}} - \text{openInterest}_{\text{short}}|$
|
|
\STATE $\text{totalOI} \gets \text{openInterest}_{\text{long}} + \text{openInterest}_{\text{short}}$
|
|
\STATE $\text{utilization} \gets \text{imbalance} / \text{totalOI}$
|
|
\STATE $\text{baseFunding} \gets \text{utilization} \cdot \text{maxFundingRate} \cdot \text{intervals}$
|
|
\STATE $\text{pricePremium} \gets (\text{markPrice} - \text{indexPrice}) / \text{indexPrice}$
|
|
\STATE $\text{fundingRate} \gets \text{baseFunding} + \text{pricePremium} \cdot \text{premiumFactor}$
|
|
\RETURN $\min(\text{fundingRate}, \text{maxFundingRate} \cdot \text{intervals})$
|
|
\end{algorithmic}
|
|
\end{algorithm}
|
|
|
|
\subsection{Mark Price vs Index Price}
|
|
|
|
Mark price prevents market manipulation during liquidations:
|
|
|
|
\begin{equation}
|
|
P_{\text{mark}} = P_{\text{index}} \cdot (1 + \text{EMA}(\text{basis}, \alpha))
|
|
\end{equation}
|
|
|
|
where basis = $\frac{P_{\text{perp}} - P_{\text{index}}}{P_{\text{index}}}$ and $\alpha = 2/(N+1)$ for $N$-period EMA.
|
|
|
|
Index price aggregates multiple spot exchanges:
|
|
|
|
\begin{equation}
|
|
P_{\text{index}} = \text{median}\left(\sum_{i=1}^{n} w_i \cdot P_i\right)
|
|
\end{equation}
|
|
|
|
with outlier filtering: $|P_i - P_{\text{median}}| < 3\sigma$.
|
|
|
|
\subsection{Leverage Options}
|
|
|
|
We support leverage from 1$\times$ to 100$\times$ with tier-based requirements:
|
|
|
|
\begin{table}[h]
|
|
\centering
|
|
\begin{tabular}{|c|c|c|c|}
|
|
\hline
|
|
\textbf{Leverage} & \textbf{Initial Margin} & \textbf{Maintenance Margin} & \textbf{Max Position} \\
|
|
\hline
|
|
1$\times$ - 10$\times$ & 10\% & 5\% & \$10M \\
|
|
11$\times$ - 25$\times$ & 4\% & 2\% & \$5M \\
|
|
26$\times$ - 50$\times$ & 2\% & 1\% & \$1M \\
|
|
51$\times$ - 100$\times$ & 1\% & 0.5\% & \$100K \\
|
|
\hline
|
|
\end{tabular}
|
|
\caption{Leverage tiers and margin requirements}
|
|
\end{table}
|
|
|