technical note

The Mathematics of Market Entropy

A technical explanation of how market disorder, volatility instability, and price-path roughness can be converted into a single entropy score.

Market entropy is not a prediction of price direction. It is a measurement of structural uncertainty. The score estimates how disorderly recent market behaviour has become by analysing return dispersion, volatility instability, and path roughness.

Composite Score

E_final = 0.50E_r + 0.25E_v + 0.25E_f

The score is weighted toward return entropy because return dispersion is the clearest measure of short-term market uncertainty. Volatility instability and roughness are added to capture regime shifts and jagged price behaviour.

Return Calculation

r_t = ln(P_t / P_{t-1})

Log returns are used because they are additive over time and behave better mathematically than raw percentage changes.

Shannon Return Entropy

H = -Σ p_i log₂(p_i)E_r = H / log₂(N) × 100

Recent returns are grouped into buckets. If most returns fall into a small number of buckets, entropy is low. If returns are spread widely and evenly across many buckets, entropy is high.

An orderly market usually has returns clustered near zero. A chaotic market spreads returns across large positive and negative buckets.

Volatility Instability

σ_t = std(r_{t-w}, ..., r_t)Δσ_t = |σ_t - σ_{t-1}| / σ_{t-1}E_v = normalise(mean(Δσ_t)) × 100

Volatility alone does not equal entropy. A market can be volatile but still structured. This metric measures whether volatility itself is unstable.

Path Roughness / Fractal-Style Score

L = Σ |ln(P_t) - ln(P_{t-1})|D = |ln(P_T) - ln(P_0)|R = L / max(D, ε)E_f = normalise(log(1 + R)) × 100

A smooth trend has a low roughness ratio because the path length is close to the net displacement. A chaotic market has a high roughness ratio because price moves back and forth aggressively while making little clean directional progress.

Entropy Classification

Score rangeStateMeaning
0-30Low EntropyStructured, smoother, easier to model
31-60Medium EntropyMixed behaviour, partial structure
61-80High EntropyChaotic, unstable, harder to forecast
81-100Extreme EntropyDisorderly, violent, highly unpredictable

Scientific Interpretation

Entropy measures uncertainty, not bullishness or bearishness.

High entropy does not mean price will fall. Low entropy does not mean price will rise.

Low entropy means recent behaviour is more structured. High entropy means recent behaviour has more possible outcomes. Rising entropy may indicate instability before a major move, while falling entropy may indicate consolidation or structural reformation.

Solana Market Interpretation

Solana token markets often compress a large amount of behaviour into very short windows. Meme coins, low-liquidity launches, pump-style markets, whale concentration, MEV/sniper activity, liquidity pool instability, DEX routing, and fragmented liquidity all create conditions where market structure can change quickly.

In this context, entropy is useful because it does not require a directional thesis. It asks whether recent behaviour is becoming more or less ordered, and whether the observed path still resembles organic market discovery.

Implementation Notes

const finalEntropy = 0.5 * returnEntropy + 0.25 * volatilityInstability + 0.25 * roughnessScore;