# Dynamic Hedging

A single option, represented by $V$, can be represented by a local expansion of its parameters:

#### $\Large \Delta V = \frac{\partial V}{\partial S} \Delta S + \frac{\partial V}{\partial \sigma} \Delta \sigma + \frac{\partial V}{\partial \tau} \Delta \tau + \frac{\partial V}{\partial r} \Delta r + \frac{1}{2} \frac{\partial^2 V}{\partial S^2} (\Delta S)^2 + \text{Higher Order Term}$

This gives us a framework to determine how the price of an option should change when the market environment (spot price, volatility etc.) deviates by small amounts, we determine all of the labelled sensitivities above, and then attempt to aggregate them at the AMM level, each asset at a time to determine the AMM sensitivity to various market parameters.

At any given block, the AMM maintains a portfolio of these collateralized options positions $\mathcal{P}$ for a fixed underlying market.

Suppose that $n_{i}$ denotes the number of options contracts that the AMM has open for option $i$ with expiry-strike vector $\left(T_{i}, K_{j(i)}\right)$. The aggregated delta position of the AMM at any block for a specific asset is given by the cumulative sum of all delta positions of open contracts on the market:

$\Large \Delta = -\sum_{i}^{n} \Delta_{i}$

Where $\Delta_{i}$ denotes the delta of a single contract, derived using the Black-Scholes model of option pricing. $\Delta_{i}$ is a decimal percentage, representing the first-order sensitivity of the option price to movements in the spot price.

Therefore, the statistic $\Delta$ corresponds to several spot tokens that the AMM is long or short.

If the AMM $\Delta = 1.2$ then for small movements in ETH spot price, the AMM pool net asset value would have an exposure which is locally proportional to $1.2$ ETH tokens.

To adjust for this, the AMM will calculate its $\Delta$ parameter and open up an inverse margined position of $-\Delta$ perpetual contracts on GMX. This ensures that the net exposure that the AMM has to the underlying token is $0$ and is therefore giving LPs delta-neutral yield.

Over time, the value of the $\Delta$ parameter will change according to changes in implied volatility $\sigma$, spot price and time to expiry. As a result, the AMM will periodically adjust these futures positions to zero out net $\Delta$ exposure.

The rebalancing of delta for exposed assets within the Diem AMM will be executed upon several key factors:

1- Leverage trading

To optimize capital efficiency within the AMM, enabling collateralization of more positions and maximizing fees earned, delta hedging is executed with leverage using external perpetual markets similar to GMX. The leverage ranges between 1.25x and 2.5x depending on each asset's volatility. This approach will allow for absorbing more volume and having additional availability for opening and closing positions.

2- Frequency period

Considering that the delta will vary over time, each market will have frequent rebalancing to the new AMM delta on the perpetual market, the initial period will be rebalancing every 2 hours with the possibility to get further adjustments based on the AMM performance over time on each market.

3- Force rebalancing

Recognizing that time-based delta hedging may not suffice, especially in certain markets that might face large price variations within short time durations, the hedging contract will monitor the ratio between AMM delta exposure to each asset, the total AMM value locked, and issue forced rebalancing in specific cases to minimize head wind risks for depositors.

4- Average delta

To prevent manipulation of force rebalancing in case of scam wicks that might get retraced in few minutes which will trick the hedging contract to rebalance in undesired times, delta calculated for the rebalancing will be based on the following logic:

$\Large Avg\Delta(AMM) = a*\Delta(S) + (1-a)*\Delta(V)$

Where :

$\Delta(S)$: Mark delta

$\Delta(S)$: Averaged Delta

S: Mark price

V: Average price over predefined period

a: Weighting parameter that varies between assets

This methodology should, in the long run, ensure AMM profitability and minimize market exposure for liquidity providers.

Last updated