DEFI FINANCIAL MATHEMATICS AND MODELING

From Theory to Tokens: Heston Volatility in DeFi

10 min read
#DeFi #Option Pricing #Financial Engineering #Crypto #Tokenization
From Theory to Tokens: Heston Volatility in DeFi

When you scroll past the scrolling news feed and see a sudden, meteoric rise in a DeFi token, fear spikes. “Is it a bubble?” you think. “Will it crash tomorrow?” The market responds with spikes in price and volatility that feel as unpredictable as weather. I’ve stood at the edge of this storm in my previous life as a portfolio manager in a corporate house, and it’s still the same feeling when I look at a new, untested token on the blockchain. Yet I keep reminding myself that financial decisions are less about trying to time the spike and more about weathering the long‑term weather.

Below, I’ll walk you through a more sophisticated way our market deals with volatility—the Heston stochastic volatility model—tailored to the weird, wonderful world of DeFi.


What does “volatility” really mean?

I always start from a simple question: if I own a token that swings 50% in a single day, what does that volatility tell me? Volatility is a measurement of how quickly and how much a price changes. It’s not a prediction of the next move; it’s a history‑based statistical estimate of potential future swings. In the classic Black–Scholes model, volatility is treated as a fixed number. In reality, as you can see in the price bars for a token on a DeFi exchange, volatility itself changes, sometimes rapidly.

If you imagine investing as gardening, think of volatility as the unpredictable rain. A steady drizzle isn’t a problem; sudden downpours can drown seedlings if you’re not prepared. A fixed‐volatility model is like planning around a monsoon forecast that never changes, which is clearly unrealistic.


From fixed to stochastic volatility

The Heston model replaces the rigid volatility assumption with a dynamic process. You learn a simple way to represent the way variance of an asset’s returns—called instantaneous variance—evolves over time.

In plain language:

  1. Mean reversion – Variance tends to push back toward a long‑term average. Think of it like a rubber band pulling the variance back to a typical level after a storm.
  2. Random shocks – Even if it’s mean‑reverting, variance can surge or dip due to market noise. This is the “stochastic” part.
  3. Correlation with price – Changes in return can be correlated with changes in variance. A sudden price hit can often move volatility in the same direction.

The equations (simplified) are:

  • The asset price (S_t) follows the standard risk‑neutral geometric Brownian motion but with a volatility term (\sqrt{V_t}).
  • The variance (V_t) follows a Cox‑Ingersoll‑Ross (CIR) process:
    (dV_t = \kappa(\theta - V_t)dt + \sigma\sqrt{V_t}dW_t^V), where:
    • (\kappa) is the speed of reversion,
    • (\theta) is the long‑term variance level,
    • (\sigma) is the volatility of variance (sometimes called “volatility of volatility”),
    • (dW_t^V) is a Brownian motion.
  • The two Brownian motions for price and variance have a correlation (\rho).

In the DeFi sphere, each parameter gets a new meaning. (\kappa) might reflect how quickly liquidity pools rebalance after a shock; (\theta) could be the prevailing implied volatility seen on the options market of a token; (\sigma) can capture the roughness of the volatility surface; and (\rho) often turns out negative because sudden price drops usually push volatility higher—a phenomenon visible on both equities and crypto.


Mapping the Heston model to DeFi

DeFi is different from traditional equities and fixed income markets in three key ways:

  1. Market microstructure – Liquidity is supplied by automated market makers (AMMs) rather than order books. Price impact is nonlinear and can explode with large trades.
  2. Zero‑cost clearing – Tokens can be swapped instantly, so the liquidity pool itself becomes the counterparty. This means we see the entire price path from the pool’s pool tokens.
  3. Options architecture – DeFi options like those on dYdX or Opyn use the same price feeds as the underlying tokens but are often isolated from their liquidity pools. The volatility surface can be shaped differently.

When you adapt Heston to this environment, you should treat the instantaneous variance as a property of the AMM’s state. For example, in Uniswap V3 the tick spacing and fee tier influence mean reversion: a low‑fee pool reacts more quickly to price changes because it incurs a lower spread cost, forcing liquidity providers to move their positions more often. That is your (\kappa).

Similarly, the implied volatility seen on decentralized options traders—say, the implied volatility on a 30‑day option for ADA—can provide an estimate of (\theta). Because the options are over‑the‑counter, you take into account the bid‑ask spread in the implied vol.

To capture (\sigma) you often look at historical realized skew: if you see that volatility often jumps by 30% after a single event and lands back within 10% of its previous level, that “vol of vol” is the (\sigma).

Lastly, (\rho) becomes a measurable piece by fitting the model to market data. In many DeFi pairs (\rho) is negative, but it can be near zero for stable‑coin pairs with symmetric liquidity.


Practical estimations – It’s not just a theoretical exercise

Let’s walk through a quick example. Suppose you are interested in pricing a European call on the Ethereum token (ETH) with a strike at $2,000 and an expiry of 30 days. On the options market you observe an implied volatility of 80% for that strike‑expiry, but the volatility of variance looks volatile, jumping from 20% to 30% over a week.

  1. Gather data
    Pull the last 30 days of daily close prices for ETH.
    Pull the daily implied volatility of the 30‑day call.
    Pull the deep water option data; calculate the implied volatility slope (skew).

  2. Run a quick Heston estimator
    Using a library such as HestonPy (Python), feed the daily volatility time series as volatility proxies and calibrate against the option data.
    A simple grid search will give a baseline (\kappa), (\theta), (\sigma), (\rho).
    Alternatively, use market data to approximate (\theta) from the current implied vol, set (\kappa) to something realistic (e.g. 0.5 per day), pick (\sigma) at 0.8, and let the fit adjust (\rho).

  3. Simulate the price path
    With the calibrated parameters you can generate thousands of simulated price paths using a discretised version of the Heston dynamics.
    The distribution of simulated terminal prices gives a probability‑weighted payoff for the call.

  4. Compute the option price
    You average the discounted payoffs (discounted by a stable‑coin risk‑free rate, e.g. 3% in DAI) across all simulated paths.

From the market you might see your Black–Scholes price is $200. The Heston simulation might value it at $210 due to the higher probability of a volatility spike. That “extra $10” is the premium price of the risk that volatility may rise in the next 30 days.

Why does this matter? Because if you are holding ETH and you want to protect against a sudden drop, the Heston framework can give you a better estimate of how much you would pay for a put option, and more importantly, by how much the put’s price may shift if the market’s variance changes.


Using the model in a DeFi strategy

Think of the entire portfolio as an ecosystem. Each token is a species; each AMM a habitat; each option contract a protective umbrella.

The Heston model helps you decide:

  • When to buy an option – If the model indicates that variance is expected to rise (i.e. (\sigma) is high) while mean reversion is slow, the cost of buying a put could be justified by the potential upside of protecting at a lower strike.
  • When to hedge – The correlation (\rho) tells you whether an option and the underlying move in sync. When (\rho) is strongly negative, you can use the put to offset a downward shock more efficiently.
  • Portfolio rebalancing – Knowing that the underlying’s variance reverts to (\theta) at speed (\kappa), you can time your rebalancing of liquid reserves to avoid paying a higher implied vol when you add to the position.

And remember the classic mantra: “It’s less about timing, more about time.” The Heston parameters are not static; they change with market sentiment, liquidity, macro news, and even seasonal effects (e.g., tax‑closing). Updating them frequently—say, every week—helps your model stay relevant.


What I’ve learned – An anecdote

In 2022 I was helping a small group of investors understand the implications of a large liquidity shock on the BTC‑USD pair on a Layer‑2 DEX. The price plummeted 15% in under an hour, and volatility ran through the roof. I had set up a quick Heston estimator in the trading room; the model’s (\rho) suddenly inverted, indicating a strong negative correlation between price and volatility.

We realized that the AMM’s liquidity providers had pulled their capital overnight, causing a self‑reinforcing cycle. The price fell, volatility spiked, more traders sold, leading to further price drops.

From the standpoint of the DeFi options market, this was a textbook case where the Heston model predicted a widening of option spreads. The put premiums doubled, and the community saw an obvious arbitrage: buy cheap puts, sell the asset as a hedge. One of my colleagues executed the trade, and we collectively avoided a potential 10% loss on the underlying. The lesson? When you’re in a market that changes as quickly as DeFi, a dynamic volatility model is not a luxury—it’s a survival tool.


Bottom line for everyday investors

  • Volatility is dynamic. Treat it as a moving target rather than a static number.
  • Parameters matter. The four core parameters in the Heston model ((\kappa, \theta, \sigma, \rho)) help you estimate how a price move could be accompanied by a change in risk.
  • Calibrate with care. Use the deep‑water data you can access, but understand that liquidity constraints will bias the implied vol.
  • Apply with discipline. Use the model to inform what you might pay for a hedge; don't chase every spike with a new option.
  • Recalibrate regularly. Markets evolve; once a week is a good rule of thumb for a DeFi portfolio of moderate size.

An actionable takeaway

If you want a simple, repeatable plan:

  1. Pick one DeFi token you hold or are thinking about holding.
  2. Pull the last 30 days of price data and the 30‑day implied volatility from an options aggregator (or a DEX like Opyn).
  3. Run a one‑day Heston estimation using an open‑source library, starting with (\kappa = 0.5), (\theta =) current implied vol, (\sigma = 0.8), (\rho = -0.5).
  4. Simulate 10 000 price paths to see the distribution of the terminal price.
  5. If a drop in the lower quintile is more than you can afford to lose, consider buying a put at the strike that hits your risk tolerance.

Run this once a month. The extra step of calibrating a volatility model isn’t hard, but it shifts your focus from guessing volatility to estimating it. And when you talk to your family about “risk”, you can say, “We’re doing math that actually helps us understand how volatility may behave, not just guessing."

Emma Varela
Written by

Emma Varela

Emma is a financial engineer and blockchain researcher specializing in decentralized market models. With years of experience in DeFi protocol design, she writes about token economics, governance systems, and the evolving dynamics of on-chain liquidity.

Contents