Sub topic 2
Measuring Volatility: Returns, Standard Deviation and Annualizing
Prerequisites and the basic measurement
This chapter assumes you understand cryptocurrency prices, percentages, simple averages, and basic Python. Volatility is a measure of how widely returns vary over time. It measures the size of price changes, not whether the price moves up or down.
A return is the percentage change between two prices. A simple return is:
(new price / old price) - 1
For example, a move from $100 to $110 is a 10% return. A move from $110 to $100 is about a −9.09% return.
A log return is:
ln(new price / old price)
ln is the natural logarithm. Log returns are useful because returns across multiple periods can be added. For small price changes, a log return and a simple return are very similar.
Standard deviation of returns
Standard deviation measures how far observations usually fall from their average. In this context, it measures how much returns vary around their mean return.
The usual workflow is:
- Calculate one return for each pair of consecutive prices.
- Calculate the average return.
- Measure each return's distance from that average.
- Square those distances and average them.
- Take the square root.
For a sample of observed returns, use the sample standard deviation. Its variance divides by n - 1, where n is the number of returns. This corrects for the fact that your data is only a sample of possible future returns.
import math
prices = [100, 104, 98, 110, 105, 120, 90]
returns = [math.log(b / a) for a, b in zip(prices, prices[1:])]
mean = sum(returns) / len(returns)
variance = sum((r - mean) ** 2 for r in returns) / (len(returns) - 1)
daily_vol = math.sqrt(variance)
annual_vol = daily_vol * math.sqrt(365)
print(f"Daily volatility: {daily_vol:.2%}")
print(f"Annualized volatility: {annual_vol:.2%}")The result is expressed as a percentage. A daily volatility of 5% does not mean the asset will move exactly 5% each day. It describes the typical scale of daily returns in the sample.
Annualizing crypto volatility
Financial analysts often annualize daily volatility with:
annualized volatility = daily volatility × √number of periods per year
Crypto markets trade every day, so a common assumption is 365 daily periods. Traditional stock calculations often use 252 trading days instead.
This calculation assumes that daily returns are reasonably comparable and that their dependence does not greatly change the result. Crypto returns often violate these assumptions. Volatility can cluster, meaning calm periods and turbulent periods appear in groups. A single annualized number can therefore hide important changes in current conditions.
| Measure | What it tells you | Important limitation |
|---|---|---|
| Daily volatility | Typical variation in daily returns | Depends on the chosen time window |
| Annualized volatility | A yearly scale based on daily data | Assumes the daily pattern can be scaled |
| Mean return | Average return in the sample | Past average is not a forecast |
Exercise
A token has a daily volatility of 4%. Using 365 days, what is its approximate annualized volatility?
Show answer
4% × √365, which is about 76.4%.