Energy Trading 101

A Software Engineer's Introduction to UK Energy Markets

FUNDAMENTALS

Before diving into ETRM systems, position aggregation algorithms, or mark-to-market calculations, software engineers need to understand why energy trading exists. This guide introduces the fundamental concepts that underpin all commodity trading: spot vs forward markets, hedging, physical vs financial settlement, and the players who make markets work. No prior knowledge assumed.

As a software engineer who has worked at several UK energy trading firms (Centrica EMT, LimeJump, Shell Energy, Schroders), I've learned these concepts are the foundation for understanding what we're actually building. Whether you're architecting an ETRM system or building Python analytics pipelines, this knowledge shapes every design decision.


What Is Trading? (And What It Isn't)

When most people hear "trading," they picture frantic shouting on exchange floors or high-stakes gambling. The reality is quite different—and far more economically important.

The Core Economic Function

Trading exists to transfer risk from those who don't want it to those who will accept it for a price. That's it. Everything else—the screens, the terminology, the infrastructure—is in service of that fundamental function.

Consider a wheat farmer in June, six months before harvest. The farmer has no idea what wheat prices will be in December. If prices fall, the farm might not cover its costs. But the farmer can't afford to wait and hope—they need to plan budgets, service loans, and pay workers.

At the same time, a bakery chain needs to buy wheat in December. If prices spike, the bakery's margins disappear. They, too, need certainty to plan their business.

Both parties face price risk—uncertainty about future prices. A trader's job is to facilitate the transfer of that risk. The farmer can lock in a sale price today (eliminating downside risk), and the bakery can lock in a purchase price (eliminating upside risk). Someone—perhaps a speculator, a market maker, or another hedger with offsetting needs—takes the other side of these trades.

Trading vs Hedging vs Speculation

These terms are often conflated, but they describe different activities:

  • Hedging: Using derivatives to offset existing physical exposure. A wind farm selling power futures isn't speculating—they're locking in revenue from power they'll actually generate.
  • Speculation: Taking directional price bets without underlying physical exposure. A fund betting that gas prices will rise next quarter is speculating—they have no gas production to hedge.
  • Market Making: Providing liquidity by quoting both buy (bid) and sell (offer) prices, profiting from the spread between them.

All three activities are legitimate and serve economic purposes. Speculators, for instance, provide the liquidity that allows hedgers to find counterparties. Without someone willing to take the other side, the farmer and bakery couldn't hedge at all.

Why Markets Need Traders

Markets without traders are inefficient and illiquid. Traders provide three critical services:

  1. Liquidity: The ability to buy or sell without moving prices dramatically. A liquid market means you can hedge 10 MW of power at 2pm without waiting hours for a counterparty.
  2. Price Discovery: Aggregating information from thousands of participants to reveal the "fair" price. When a cold weather forecast emerges, traders bid up gas prices within minutes—signalling scarcity before physical shortages occur.
  3. Risk Management: Allowing producers and consumers to lock in prices, budget with certainty, and avoid bankruptcy from adverse price moves.
For Software Engineers: This explains why energy trading systems need different performance profiles for different markets. Day-ahead auctions are batch processes (orders submitted by 09:20, results at 09:30), where reliability and automation matter more than latency. But intraday continuous trading is a different story—trades execute in real-time on an order book, and latency directly impacts execution quality. The vast majority of exchange orders come from automated trading applications connected via APIs, highlighting the importance of robust integration architecture.

Spot vs Forward: Why Lock In Prices Today?

The simplest trade is a spot trade: I buy wheat today, you deliver it today, I pay today. Spot markets are immediate and straightforward.

But what if I don't need the wheat until December? I could wait and buy spot in December—but then I'm exposed to price risk. If a drought hits, prices might double. Enter forward and futures markets.

Forward Contracts

A forward contract lets you agree on a price today for delivery in the future. In June, the farmer and bakery agree: "In December, you'll sell me 1,000 tonnes of wheat at £200/tonne." No money changes hands yet (except perhaps margin), and no wheat is delivered. They've simply locked in the price.

Come December, if spot wheat is £250/tonne, the bakery is delighted—they pay only £200. The farmer regrets the hedge (they could have sold for £250 on the spot market) but still covers their costs. If spot wheat is £150/tonne, the farmer is delighted—they get £200 instead of £150. The bakery regrets the hedge but their budget still works.

Crucially, neither party is trying to "win"—they're both trading profit upside for certainty.

Futures Contracts

Futures are standardised forward contracts traded on exchanges (like ICE, EEX, EPEX SPOT, or Nord Pool). Instead of the farmer and bakery negotiating bilaterally, they trade standardised contracts:

  • Fixed sizes (e.g., 1 MW, 1,000 barrels, 10,000 MMBtu)
  • Fixed settlement dates (e.g., end of December, every month, every quarter)
  • Cleared through a central counterparty (the exchange guarantees both sides, eliminating counterparty risk)

The advantage? Liquidity. Instead of finding one specific counterparty, you can trade with anyone on the exchange. Prices are transparent, and you can exit positions easily by taking an offsetting trade.

Why Energy Producers and Consumers Hedge

Example 1: Wind Farm (Natural Long Power)

A wind farm will generate approximately 50 GWh next quarter. At today's forward price of £80/MWh, that's £4 million in revenue. But what if power prices drop to £50/MWh due to a mild winter? Revenue falls to £2.5 million—potentially below operating costs.

The wind farm sells power futures (goes short financially) to lock in £80/MWh. Now:

  • They generate 50 GWh and sell it on the spot market at whatever price prevails (say, £50/MWh, earning £2.5m)
  • Their short futures position gains £30/MWh × 50 GWh = £1.5m (they sold futures at £80, then bought back to close at £50, profiting from the £30 drop)
  • Total revenue: £2.5m (spot) + £1.5m (futures gain) = £4m. They've locked in £80/MWh.

Example 2: CCGT Plant (Natural Long Power, Short Gas)

A gas-fired power plant needs to buy gas to generate power. It's naturally long power (it will generate and sell) but short gas (it needs to buy fuel). To hedge, the plant sells power futures (locking in revenue) and buys gas futures (locking in fuel costs).

The difference between power revenue and gas costs (minus carbon costs) is called the spark spread. Learn more in our Spark Spread and Power Plant Economics guide.

For Software Engineers: This is why ETRM systems track positions across multiple commodities. A CCGT plant's position isn't just "long 100 MW of power"—it's a three-legged position: long power, short gas, short carbon. Your position aggregation algorithms must understand these relationships. See our Position Aggregation and Delta Exposure guide for implementation details.

Physical vs Financial Settlement

Not all commodity contracts require actual delivery. Some are cash-settled—at expiry, the parties simply exchange money based on the difference between the contract price and the spot price.

Cash-Settled Contracts

Suppose you buy a cash-settled gas future at 80p/therm for December delivery. At expiry, the spot price is 90p/therm. You don't receive any gas—instead, you receive a cash payment of 10p/therm × contract size. If you'd sold the future, you'd pay out 10p/therm.

Cash settlement is common for:

  • Financial hedgers: A wind farm doesn't need to physically deliver power to a specific buyer—it just sells into the grid and uses futures to lock in prices financially.
  • Speculators: A hedge fund betting on power prices has no ability to deliver or receive physical power.
  • Baseload contracts: Standardised products like "monthly baseload power" are often financially settled against an index (the average of spot prices over the month).

Physically-Settled Contracts

In some cases, you must deliver or receive the physical commodity:

  • Gas at NBP (UK hub): Many bilateral OTC contracts require actual gas flows through the National Transmission System (NTS).
  • LNG cargoes: Buying an LNG cargo means a tanker will arrive at a regasification terminal. You need storage capacity, port slots, and logistics. Learn more in our Global Gas Market: Ships and Storage guide.
  • Oil pipelines and storage: Physical oil contracts require tank capacity and pipeline bookings.

Physical settlement imposes operational risk. If you're long a physical gas contract and can't take delivery (your storage is full, your pipeline is down), you're in breach—and penalties can be severe.

For a deeper dive into these distinctions and the three dimensions of physical arbitrage (location, time, quality), see our Physical vs Financial Energy Trading guide.

For Software Engineers: This means your ETRM system needs to handle two completely different workflows. Financial contracts need cash settlement calculations (mark-to-market P&L, margin calls). Physical contracts need logistics tracking (nominations, delivery confirmations, storage bookings). The data models are fundamentally different.

Market Structure: Exchanges vs OTC

Commodity trading happens in two broad venues: exchanges (centralised, standardised) and OTC (bilateral, customised).

Exchanges

Exchanges like ICE (Intercontinental Exchange), EEX (European Energy Exchange), EPEX SPOT, and Nord Pool provide centralised platforms for trading standardised contracts:

  • Standardised contracts: Fixed sizes (1 MW, 1,000 therms), fixed tenors (monthly, quarterly, yearly), fixed settlement dates
  • Central clearing: The exchange's clearinghouse becomes the counterparty to every trade, guaranteeing settlement and eliminating counterparty risk
  • Transparent pricing: Prices are published in real time. Everyone sees the same bid and offer prices
  • High liquidity: Because contracts are standardised, many participants can trade the same product, creating deep markets

Key UK Exchanges:

  • Nord Pool (N2EX): The dominant day-ahead exchange for GB power, handling approximately 120 TWh annually—roughly 30% of UK power consumption. Both EPEX and Nord Pool operate as competing Nominated Electricity Market Operators (NEMOs) in Great Britain.
  • EPEX SPOT: Runs GB day-ahead (60-minute and 30-minute auctions) and intraday continuous markets. Part of the EEX Group.
  • ICE: Major platform for UK gas (NBP), European gas (TTF), and carbon allowances (UKA, EUA).

OTC (Over-the-Counter)

OTC trading happens bilaterally between two counterparties, often via brokers or electronic platforms. Contracts are negotiated and customised:

  • Customised terms: You can tailor volumes, delivery points, settlement dates, and special clauses (e.g., force majeure, volume optionality)
  • Bilateral risk: No clearinghouse. You face direct counterparty risk—if the other party defaults, you're exposed. This is managed through credit checks, collateral agreements (CSAs), and ISDA master agreements
  • Less transparent: Prices aren't publicly visible. You negotiate or request quotes from brokers
  • Lower liquidity: Finding counterparties for non-standard deals takes time

The reality: 70-90% of power and gas trading volumes are bilateral OTC deals, with exchange-traded contracts accounting for 10-30%. Exchanges provide price transparency and liquidity for standardised hedging; OTC handles the messy reality of physical assets and tailored risk management.

For Software Engineers: Your trading platform needs to integrate with both. Exchange integration means consuming API feeds from Nord Pool, ICE, EPEX, EEX—but each exchange has its own protocol. EPEX uses an AMQP-based M7 API for continuous trading and MATS API for auctions. Nord Pool provides REST APIs and FTP data feeds. ICE commonly uses FIX protocol. EEX uses their EOBI feed. OTC integration means building bilateral messaging (emails, broker platforms, phone calls transcribed to trade tickets), credit checking workflows, and ISDA contract management. These are entirely different architectural patterns.

The Players: Business Models in Energy Trading

Energy markets bring together diverse participants, each with different motivations:

Producers and Generators

  • Gas producers: Own gas fields (e.g., North Sea fields). Naturally long gas—they'll extract and sell it
  • Wind and solar farms: Generate power when the wind blows or sun shines. Naturally long power
  • CCGT and other thermal plants: Generate power by burning gas or coal. Naturally long power, short fuel

Why they trade: To hedge output prices and lock in revenue.

Consumers and Offtakers

  • Industrial consumers: Factories, data centres, steelworks. Consume large volumes of power and gas
  • Utilities and suppliers: Supply residential and commercial customers. Aggregate demand from millions of homes

Why they trade: To hedge purchase prices and lock in costs.

Integrated Utilities

Firms like Centrica, SSE, and EDF own both generation assets and supply businesses. This creates complex portfolios—their generation makes them long certain commodities, while their supply business makes them short those same commodities.

Why they trade: To balance their portfolio and optimise across mismatches.

Pure Traders and Market Makers

These firms don't own physical assets or serve customers—they just trade, seeking profit from price moves, spreads, and volatility. While they don't hedge physical assets, they provide the liquidity that allows producers and consumers to hedge efficiently.

Front Office Roles

Regardless of business model, energy trading desks typically have three core roles:

  • Traders: Execute transactions, manage positions, make buy/sell decisions in real time. They own the P&L
  • Analysts (Quants): Forecast prices using fundamental models (supply-demand balance, weather, outages). They provide the intelligence traders act on
  • Structurers: Design complex deals (tolling agreements, virtual power plants, swing options). They create bespoke products for clients
For Software Engineers: Understanding these roles clarifies who you're building tools for. Traders need low-latency dashboards and execution systems. Analysts need forecasting pipelines and data science platforms. Structurers need pricing engines for exotic derivatives. Each role has different latency requirements, data needs, and UX expectations.

What Makes Energy Different from Other Commodities?

Energy markets share features with other commodities (wheat, copper, oil), but several characteristics make them uniquely complex.

Electricity Can't Be Stored (Economically)

Unlike wheat or oil, electricity must be consumed instantly. You can't warehouse it. Supply and demand must balance every second, or the grid frequency deviates from 50 Hz (in the UK/Europe), risking blackouts.

This creates:

  • Extreme volatility: Power prices can spike from £50/MWh to £500/MWh in minutes if a plant trips offline during peak demand
  • Negative prices: During high wind + low demand (e.g., 3am on a Sunday), power prices can go negative—generators pay to offload power rather than shut down (because restarting is expensive)
  • No inventory buffer: Traders can't buy cheap power today and store it for tomorrow (except via batteries, which are expensive and capacity-limited)

Learn more about these dynamics in our Physical Foundations of Energy Commodities guide.

Location Matters: Transmission Constraints

Electricity flows through physical wires. If a transmission line is congested, power from Scotland can't reach England, even if Scottish power is cheaper. This creates basis risk—price divergence between locations.

In the UK, this manifests as Scottish wind curtailment—when Scottish wind farms generate more than the B6 boundary (the transmission line to England) can carry, National Energy System Operator (NESO) pays them to turn off, then pays English gas plants to turn on. This costs consumers billions annually.

Weather Drives Everything

Energy demand and supply are extraordinarily weather-sensitive:

  • Demand: Cold snaps increase heating demand. A 5°C temperature drop can shift UK power demand by 3-5 GW
  • Supply: Wind and solar output vary with weather. A calm, cloudy day means near-zero renewable generation, forcing expensive gas plants online

This is why traders obsess over weather forecasts, and why building accurate forecasting models is critical.

Regulation Is Everywhere

Energy markets are heavily regulated:

  • Carbon markets: Fossil generators must buy allowances for CO₂ emissions (UK ETS, EU ETS)
  • Green certificates (REGOs): Renewable generators receive Renewable Energy Guarantees of Origin—one REGO per MWh. UK suppliers must surrender REGOs to Ofgem for Fuel Mix Disclosure compliance
  • Capacity markets: Governments pay generators to remain available during peak demand
  • Trade reporting: EMIR, REMIT, sanctions screening

Unlike trading wheat, where regulatory overhead is minimal, energy trading requires dedicated compliance teams and sophisticated software to ensure adherence.


The Technology Stack: From ETRM to Python Pipelines

At the heart of any modern trading firm sits an ETRM (Energy Trading and Risk Management) system. This is the firm's central nervous system—a hulking, often bafflingly complex piece of software which serves as the official record for every trade. Think of it as the ultimate source of truth.

But the ETRM is just table stakes. The real competitive advantage—the "edge"—comes from the ecosystem of bespoke software built around it:

  • Position Dashboards: Giving traders a live, slice-and-dice view of their portfolio. How much gas are we exposed to next month? What's our power position in the UK versus Germany?
  • P&L Reports: Calculating profit and loss in real-time. See our Mark-to-Market P&L Calculation guide for implementation details.
  • Risk Engines: Running simulations and stress tests. What happens to our portfolio if gas supplies are cut and a nuclear plant trips simultaneously?
  • Fundamental Analytics Pipelines: Systems designed to hoover up vast quantities of data about the real world to predict price movements.

A Concrete Example: Building a Wind Forecasting Edge

Let's walk through how a Python analytics pipeline creates real, tangible competitive advantage.

The scenario: You're a developer on the UK power trading desk. The traders want an edge in predicting wind generation. Wind is now a huge component of the UK's energy mix, but it is volatile, making short-term power prices swing wildly.

Step 1: Ingestion

Your pipeline needs data from multiple sources:

  • Weather Data: Python script calling a weather API every hour, downloading high-resolution forecasts for wind speed, direction, and air density across UK offshore wind farms (Hornsea, Dogger Bank). Orchestrated with Airflow.
  • Grid Data: Streaming consumer (Kafka) connecting to Elexon feed, giving live, second-by-second wind generation data.

Step 2: Processing & Modelling

  • ML model in Python (pandas, scikit-learn) learning the relationship between wind speed and turbine power output (the "power curve")
  • System takes new weather forecasts, runs them through the model, generates UK wind generation forecast for next 48 hours (30-minute intervals)
  • Pipeline constantly compares forecast against live Elexon data to measure accuracy and auto-recalibrate

Step 3: Alerting & Visualisation

Live, interactive dashboard showing your internal forecast versus National Grid's public forecast, with automated alerts:

ALERT: [11:45 AM] Our model predicts a 500MW drop in wind generation at 3:00 PM vs. market expectation. High probability of a price spike.

Step 4: The Trade

Trader sees the alert, believes the model (it has a track record), immediately buys electricity contracts for 3:00-3:30 PM delivery. If the pipeline is right, price spikes, firm makes profit. Your code converted weather data into a profitable trading decision.

Architecture Note: This isn't batch processing. Gate closure (1 hour before delivery in the UK) is a hard deadline. After gate closure, you can't trade that settlement period. If your system crashes 10 minutes before gate closure, traders can't execute critical hedges, facing potentially massive imbalance exposure. This drives architecture decisions: redundant systems, hot standby databases, circuit breakers, rigorous peak-hour testing. Downtime during gate closure windows can cost hundreds of thousands of pounds in a single settlement period.

Essential Trading Terminology

Key terms you'll encounter constantly:

  • Long position: You own something or have bought a contract. If prices rise, you profit
  • Short position: You have a commitment to deliver or you've sold a contract. If prices fall, you profit
  • Bid/offer (ask) spread: Difference between highest price a buyer will pay (bid) and lowest price a seller will accept (offer). Market makers profit from this spread
  • Mark-to-market (MTM): Valuing positions at current market prices, even if you haven't closed them. Your "unrealised P&L" changes daily as prices move
  • Basis: Price difference between related markets (e.g., NBP gas vs TTF gas, UK power vs French power). Basis risk is the risk that this spread moves against you
  • Contango: Forward curve where future prices are higher than spot (upward-sloping). Common for storable commodities
  • Backwardation: Forward curve where future prices are lower than spot (downward-sloping). Common when near-term demand is high
  • Nomination: Telling the system operator your expected physical flows. Gas shippers nominate volumes; power generators nominate dispatch schedules
  • Balancing/imbalance: Difference between what you contracted to deliver/receive and what you actually did. System operators charge imbalance penalties to incentivise accuracy
  • Settlement period: Time unit for trading and settlement. In GB power, it's 30 minutes (48 periods per day)

Continue Your Energy Trading Education

You now understand the fundamentals: why trading exists, how hedging works, and the basic mechanics of spot vs forward markets. Continue learning with our comprehensive guide series:


Summary: Key Takeaways

  • Trading exists to transfer risk—from producers and consumers who can't bear it to speculators and market makers who will, for a price
  • Forward and futures markets let participants lock in prices today for future delivery, enabling predictable budgets and hedged portfolios
  • Hedging isn't gambling—it's offsetting physical exposure with financial positions to reduce P&L volatility
  • Exchanges (ICE, EEX, EPEX) provide liquidity and transparency; OTC markets allow customisation but carry counterparty risk
  • Energy is different: electricity can't be stored, location matters, weather drives supply and demand, regulation is pervasive, and physical constraints bind
  • The competitive edge comes from bespoke software: Python analytics pipelines, real-time dashboards, ML-powered forecasting models
  • As a software engineer, understanding these fundamentals shapes every design decision—from data models to latency requirements to UX patterns