mirror of
https://github.com/lux-apps/papers.git
synced 2026-10-30 18:15:21 +00:00
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.
116 lines
3.2 KiB
TeX
116 lines
3.2 KiB
TeX
\section{Options Protocol}
|
|
|
|
|
|
\subsection{European vs American Options}
|
|
|
|
We support both European (exercise at expiry) and American (exercise anytime) options:
|
|
|
|
\begin{definition}[Option Contract]
|
|
An option $O$ is characterized by:
|
|
\begin{equation}
|
|
O = \{S, K, T, \sigma, r, \phi, \text{style}\}
|
|
\end{equation}
|
|
where $S$ is spot price, $K$ is strike, $T$ is time to expiry, $\sigma$ is implied volatility, $r$ is risk-free rate, $\phi \in \{\text{call}, \text{put}\}$, and style $\in \{\text{European}, \text{American}\}$.
|
|
\end{definition}
|
|
|
|
\subsection{Black-Scholes Pricing}
|
|
|
|
For European options, we use Black-Scholes formula:
|
|
|
|
\begin{align}
|
|
C &= S \cdot N(d_1) - K \cdot e^{-rT} \cdot N(d_2) \\
|
|
P &= K \cdot e^{-rT} \cdot N(-d_2) - S \cdot N(-d_1)
|
|
\end{align}
|
|
|
|
where:
|
|
\begin{align}
|
|
d_1 &= \frac{\ln(S/K) + (r + \sigma^2/2)T}{\sigma\sqrt{T}} \\
|
|
d_2 &= d_1 - \sigma\sqrt{T}
|
|
\end{align}
|
|
|
|
\begin{lstlisting}[caption={Black-Scholes Implementation}]
|
|
library BlackScholes {
|
|
using FixedPoint for uint256;
|
|
|
|
function calculateCallPrice(
|
|
uint256 S, // Spot price
|
|
uint256 K, // Strike price
|
|
uint256 T, // Time to expiry (in years)
|
|
uint256 sigma, // Implied volatility
|
|
uint256 r // Risk-free rate
|
|
) public pure returns (uint256) {
|
|
uint256 d1 = calculateD1(S, K, T, sigma, r);
|
|
uint256 d2 = d1.sub(sigma.mul(sqrt(T)));
|
|
|
|
uint256 Nd1 = normalCDF(d1);
|
|
uint256 Nd2 = normalCDF(d2);
|
|
|
|
uint256 discountFactor = exp(r.mul(T).neg());
|
|
|
|
return S.mul(Nd1).sub(K.mul(discountFactor).mul(Nd2));
|
|
}
|
|
|
|
function calculateD1(
|
|
uint256 S,
|
|
uint256 K,
|
|
uint256 T,
|
|
uint256 sigma,
|
|
uint256 r
|
|
) private pure returns (uint256) {
|
|
uint256 numerator = ln(S.div(K)).add(
|
|
r.add(sigma.pow(2).div(2)).mul(T)
|
|
);
|
|
uint256 denominator = sigma.mul(sqrt(T));
|
|
return numerator.div(denominator);
|
|
}
|
|
}
|
|
\end{lstlisting}
|
|
|
|
\subsection{Implied Volatility Calculation}
|
|
|
|
We calculate IV using Newton-Raphson iteration:
|
|
|
|
\begin{equation}
|
|
\sigma_{n+1} = \sigma_n - \frac{V_{\text{BS}}(\sigma_n) - V_{\text{market}}}{\text{vega}(\sigma_n)}
|
|
\end{equation}
|
|
|
|
Convergence criterion: $|\sigma_{n+1} - \sigma_n| < 10^{-6}$.
|
|
|
|
\subsection{Greeks Calculation}
|
|
|
|
Option sensitivities guide risk management:
|
|
|
|
\subsubsection{Delta ($\Delta$)}
|
|
Price sensitivity to underlying:
|
|
\begin{align}
|
|
\Delta_{\text{call}} &= N(d_1) \\
|
|
\Delta_{\text{put}} &= N(d_1) - 1
|
|
\end{align}
|
|
|
|
\subsubsection{Gamma ($\Gamma$)}
|
|
Delta sensitivity to underlying:
|
|
\begin{equation}
|
|
\Gamma = \frac{\phi(d_1)}{S \cdot \sigma \cdot \sqrt{T}}
|
|
\end{equation}
|
|
|
|
\subsubsection{Theta ($\Theta$)}
|
|
Time decay:
|
|
\begin{align}
|
|
\Theta_{\text{call}} &= -\frac{S \cdot \phi(d_1) \cdot \sigma}{2\sqrt{T}} - r \cdot K \cdot e^{-rT} \cdot N(d_2) \\
|
|
\Theta_{\text{put}} &= -\frac{S \cdot \phi(d_1) \cdot \sigma}{2\sqrt{T}} + r \cdot K \cdot e^{-rT} \cdot N(-d_2)
|
|
\end{align}
|
|
|
|
\subsubsection{Vega ($\nu$)}
|
|
Volatility sensitivity:
|
|
\begin{equation}
|
|
\nu = S \cdot \phi(d_1) \cdot \sqrt{T}
|
|
\end{equation}
|
|
|
|
\subsubsection{Rho ($\rho$)}
|
|
Interest rate sensitivity:
|
|
\begin{align}
|
|
\rho_{\text{call}} &= K \cdot T \cdot e^{-rT} \cdot N(d_2) \\
|
|
\rho_{\text{put}} &= -K \cdot T \cdot e^{-rT} \cdot N(-d_2)
|
|
\end{align}
|
|
|