Why I'm Building a Quantitative Risk Engine for French Electricity Prices
May 23, 2026, 12:55 p.m.
I'm pursuing a master's in applied mathematics. I don't work at a trading desk. I don't have a Bloomberg terminal. But I have access to 35,494 real price observations from the French day-ahead electricity market, a PostgreSQL database, and a clear question I want to answer rigorously.
That question is: in the worst reasonable case, how much will electricity cost next week?
This post explains why that question matters, why it's hard, and what it takes to answer it properly.
The market nobody talks about
If you work in finance, you probably think about equity prices, bond yields, or FX rates. Electricity spot prices are a different animal entirely.
On EPEX Spot, the pan-European day-ahead electricity exchange, French prices over the past two years have ranged from -478 €/MWh to +473 €/MWh, with a mean of 61 €/MWh and a standard deviation of 45 €/MWh. That's a coefficient of variation of 74%. For comparison, the annualized volatility of the S&P 500 during a normal year is around 15-20%.
This isn't noise. It's structure.
Why electricity prices behave like nothing else
Electricity cannot be stored at scale. What is produced at any instant must be consumed at that same instant. If production exceeds consumption, the grid collapses. RTE, the French transmission system operator, maintains balance in real time, every second of every day.
This physical constraint produces a market with properties unlike any other:
Extreme spikes. A cold snap hits France in January. Industrial demand surges. Gas peaker plants come online at high marginal cost. Prices hit 400 €/MWh. A few days later, temperatures normalize, and prices fall back to 60.
Negative prices. A sunny Sunday in spring. Low industrial demand. Solar panels flood the grid. Nuclear plants, which represent 70% of French generation, cannot ramp down quickly. There is suddenly too much electricity and nowhere to put it. Producers are willing to pay consumers to absorb the surplus. The price goes to -478 €/MWh. That's not a typo. At that moment, someone was paying 478 euros per megawatt-hour consumed.
Mean-reversion. Unlike equity prices, electricity prices cannot drift indefinitely. When prices spike, expensive generation comes online and pushes them back down. When prices collapse, production cuts and demand response pull them back up. The physics of supply and demand enforce a return to equilibrium.
The problem this creates for real actors
Consider a steel mill consuming 50 MWh per hour, 24 hours a day. Over a week:
50 MWh × 24h × 7 days = 8,400 MWh
At the average spot price of 61 €/MWh, the weekly electricity bill is around 512,000 €. But if prices spike to 200 €/MWh for two days during a cold wave, that bill exceeds one million euros.
This company has two options: buy at spot and absorb the volatility, or buy a forward contract to lock in a price. Deciding which option makes economic sense, and at what price a hedge is worth it, requires knowing the distribution of probable future prices.
Without a model, you're guessing. With a model, you have a number.
Why standard financial models don't apply here
The Black-Scholes framework, the foundation of most option pricing, assumes prices follow a geometric Brownian motion. Under this model, prices can drift upward indefinitely. Amazon went from $1 to $3,000. That's fine for equities.
Electricity doesn't work that way. A price of 800 €/MWh is physically impossible to sustain for more than a few hours. The market self-corrects. The mean-reversion is not a statistical artifact. It is a direct consequence of how supply and demand interact in a market where the commodity cannot be stored.
The appropriate model is the Ornstein-Uhlenbeck process, first proposed for commodity pricing by Schwartz (1997):
dS(t) = κ(μ - S(t))dt + σ dW(t)
The term κ(μ - S(t)) is the restoring force. When the price S(t) is above the long-run mean μ, this term is negative, it pulls the price down. When it's below, it pulls up. The strength of this pull is governed by κ, the mean-reversion speed.
This is the simplest model that captures what electricity prices actually do.
What the project builds
The pipeline has three components.
Data collection. 35,494 French day-ahead prices at 15-minute granularity, from January 2024 to April 2026, collected via the ENTSO-E Transparency Platform API and stored in PostgreSQL. Real data, not synthetic.
Calibration. The three OU parameters, κ (mean-reversion speed), μ (long-run equilibrium), σ (volatility), are estimated by maximum likelihood on the historical series. The MLE exploits the fact that the OU discretization produces a Gaussian transition density, making the log-likelihood tractable.
Monte Carlo simulation and VaR. Once calibrated, the model generates N = 10,000 simulated price trajectories over a 7-day horizon. The 95th percentile of the resulting distribution is the Value at Risk, the maximum cost in 95% of scenarios. A single actionable number.
What this is not
This is not a data visualization dashboard. Plenty of those exist.
This is a quantitative risk engine: it takes a price history as input and produces a probability distribution over future prices as output, with a risk measure attached. The kind of tool a commodity trading desk or an energy-focused fund would use to size their hedges.
Building it from scratch, API integration, database modeling, stochastic calibration, Monte Carlo engine, REST API, frontend, is the point. Not because every component is novel, but because understanding how they fit together is where the real knowledge lives.
Why I'm building it
I'm transitioning toward quantitative finance. Not because it's fashionable, but because it's the intersection of the mathematics I find genuinely interesting, stochastic processes, probability, optimization, and problems with real economic consequences.
Electricity markets sit at this intersection in a particularly sharp way. The math is non-trivial. The stakes are concrete. And the data is public.
The project is open source at github.com/fork71enthropy/ElectricityPricing2026_FR.
References: Schwartz, E. (1997). The Stochastic Behavior of Commodity Prices. Journal of Finance. Lucia, J. & Schwartz, E. (2002). Electricity Prices and Power Derivatives. Review of Derivatives Research.