Volatility Metrics for Asset Analysis: An Introductory Toolkit
A personal selection of metrics I use daily to understand risk and movement in DeFi markets—just as relevant in TradFi.
1. Introduction
Volatility is one of the most essential metrics in both traditional finance (TradFi) and decentralized finance (DeFi). Whether you're pricing options, managing liquidity risk, designing trading algorithms, or analyzing market dynamics, understanding how an asset's price moves—its variability—is fundamental.
In my daily research and development work, I rely on a variety of volatility estimators. Some are simple, others more advanced, but each provides a different lens on how markets behave. Over time, I compiled and implemented this growing toolkit into a personal repository that I use regularly for both crypto and TradFi projects.
This blog post walks through the volatility indicators implemented in my GitHub repo. It's designed to be practical, concise, and replicable—whether you're a quant researcher, DeFi builder, or just exploring market dynamics. The goal isn’t just to show formulas — it’s to build intuition, clarify when and why each method is useful, and help you apply them in real-world contexts (DeFi and TradFi alike).
In the next section, we'll set the stage by briefly reviewing what volatility actually measures and why different approaches exist.
2. How to Think About Volatility
At its core, volatility measures uncertainty. When prices fluctuate wildly, volatility is high. When prices are stable, it’s low. But this simple idea hides a lot of nuance — especially when we try to measure it.
There isn’t just one kind of volatility. Depending on what you're trying to capture, you might choose:
Historical Volatility:
Based on past returns — often using rolling windows. It’s simple and fast to compute.Realized Volatility:
A more precise version of historical volatility, typically using high-frequency data to better reflect short-term movements.Implied Volatility:
Extracted from options prices. It reflects the market’s expectations of future price moves, not what’s already happened.
Each of these has different strengths and weaknesses. Historical volatility is great for quick diagnostics and backtesting. Implied volatility reflects expectations, but requires a liquid options market. Realized volatility can give you a more accurate view of what's happening right now — if you have the data.
In DeFi, we often work without deep derivatives markets or tick-level data, which is why simple historical estimators still matter a lot. They give us a way to monitor protocol risk, anticipate stress scenarios, and build more robust incentive mechanisms.
Next, we'll dive into the actual indicators implemented in the repo, starting with classic rolling standard deviations and moving into more sophisticated estimators like Yang-Zhang and jump decomposition.
3. Volatility Metrics Implemented
In this section, we walk through each volatility estimator implemented in the repo. These indicators are callable as functions and many are demonstrated in the accompanying Jupyter notebook.
📉 Rolling Mean, Standard Deviation & Z-Score
Once we compute log returns, we often want to understand what “typical behavior” looks like over time. This is where rolling statistics come in — they let us compute moving averages and moving standard deviations over a fixed window (e.g. 14 days).
Rolling Mean tells us the average return over the past n days — it's a proxy for recent drift or bias.
Rolling Std Dev tells us how much variation we've seen — a direct proxy for recent volatility.
Z-Score tells us how unusual the current return is, compared to the recent average. It's useful for detecting outliers and sharp deviations.
⚒️ When to Use Them
Detecting shocks or abnormal moves
Defining thresholds (e.g. volatility filters)
Identifying mean-reverting vs trending regimes
🧾 Formula
If rtr_trt is the log return and www is the window:
💻 Code
window = 14
df["RollingMean"] = compute_rolling_mean(df["LogReturns"], window)
df["RollingStd"] = compute_rolling_std(df["LogReturns"], window)
df["ZScore"] = compute_z_score(df["LogReturns"], window)
📊 Visualization
Rolling volatility often increases during sharp price drops or rallies. Z-scores can help you identify statistically rare moves — typically when they go above 2 or below -2.


Normalized Candle Height & Range Over Price
🧠 What They Measure
Instead of looking at price returns, these metrics look at price ranges — the difference between the high and the low of each candle. This tells us how “tall” or “violent” each trading period was.
Normalized Candle Height measures the size of the daily (or hourly) candle relative to the closing price. It captures price movement within the candle, regardless of direction.
Range Over Price adds a lookback period, giving the metric a trend-aware quality — showing whether recent volatility is increasing or compressing over time.
These are great complements to return-based volatility, especially in markets with lots of intraperiod movement but little net change.
⚒️ When to Use Them
To capture intraday volatility and market “noise”
When return-based volatility underestimates movement (e.g., doji candles)
In DeFi protocols where candle range might trigger liquidation thresholds
🧾 Formula
For normalized candle height:
For range over price (trend-aware):
💻 Code
df["NormCandleHeight"] = normalized_candle_height(df["High"], df["Low"], df["Close"]) df["RangeOverPrice"] = range_over_price(df["High"], df["Low"], df["Close"], window)
📊 Visualization
You’ll often see a spike in these metrics during volatile events, even if the closing price doesn’t move much. This makes them useful for tracking hidden risk or whipsaws in market activity.


Rate of Change (ROC)
The Rate of Change (ROC) measures how much the price has moved compared to its value n periods ago. Unlike log returns, which look at immediate, step-by-step variation, ROC can highlight longer-term momentum or trend strength.
It’s especially helpful for identifying acceleration or deceleration in price movement.
⚒️ When to Use It
To detect emerging trends or reversals
To identify strong directional moves
As a momentum filter (e.g., enter a trade only if ROC > threshold)
🧾 Formula
Where www is the lookback window.
💻 Code
df["ROC"] = rate_of_change(df["Close"], window)
📊 Visualization
High ROC values (positive or negative) often appear during breakouts or breakdowns. ROC can stay elevated during strong trends and tends to revert when price consolidates.
Average True Range (ATR)
The Average True Range (ATR) is a classic volatility metric that captures the maximum range the price has covered in a single period, considering gaps between candles.
Unlike simple candle height, ATR also includes:
The difference between today’s high and low,
The difference between today’s high and yesterday’s close,
The difference between today’s low and yesterday’s close.
This makes ATR more robust for volatile assets that gap or wick aggressively.
⚒️ When to Use It
To measure absolute volatility in asset movement
In risk management, e.g., to size stop losses
To adapt strategies dynamically in trending vs. choppy markets
🧾 Formula
For a single period:
Then the ATR is a rolling mean:
💻 Code
df["ATR"] = average_true_range(df["High"], df["Low"], df["Close"], window)
📊 Visualization
ATR rises when markets are volatile — but it doesn’t care about direction. It's especially useful to compare different time periods or assets with different price scales.
Efficiency Ratio
Efficiency Ratio (ER) compares the direct distance traveled by the price to the total noise during that path. It’s like asking: “How straight was the move?”
If the price moved steadily up or down, ER is high.
If it chopped around and ended in the same place, ER is low.
It’s a signal-to-noise ratio for price trends.
⚒️ When to Use It
To identify clean trends (ER >> 1) or noisy chop (ER ≈ 0)
To filter out fake breakouts
To compare different assets' trending strength
🧾 Formula
💻 Code
df["EfficiencyRatio"] = efficiency_ratio(df["Close"], window)
📊 Visualization
ER spikes when an asset moves cleanly in one direction, and drops when price action is noisy or sideways. It’s one of the few metrics that highlights clarity, not just size.
4. Use Cases & Applications
Each volatility metric gives insight into a different aspect of market behavior. Here’s a quick summary of how they can be used in both traditional and decentralized finance:
These metrics can be combined or visualized in dashboards, stress testing tools, or even governance frameworks.
5. Conclusion
Volatility isn’t just about how much prices move — it’s about how they move.
In this post, we explored how different indicators capture unique dimensions of market behavior, from basic returns to candle structure and directional strength. Each metric brings a different lens — and when combined, they can provide a more complete view of market dynamics, whether you're working in TradFi, DeFi, or building your own crypto protocol.
In the next post, we’ll dive into more advanced tools like EWMA, GARCH models, and volatility clustering, and explore how to use them for risk forecasting and parameter optimization.