r/oilandgas

▲ 3 r/oilandgas+1 crossposts

Why are diesel prices so high? How to calculate the diesel crack spread. It hit $98 a barrel Friday, triple the norm!

Diesel at the pump hit a record in September, and on Friday the G7 countries agreed to release up to 100 million barrels of diesel and crude. So why are diesel prices so high? Of course, crude is only part of the story. Oil closed Friday at $91.11 a barrel.

The bigger part is the crack spread. That's the gap between a barrel of crude and the diesel made from it. Here's how you can calculate it. The code below pulls daily futures prices for diesel and crude and multiplies diesel by 42 gallons (amount in a barrel), then subtracts the crude.

Output through Friday's close:

2019 average spread $24.43 a barrel
2020 average spread $12.93 a barrel
2021 average spread $18.80 a barrel
2022 average spread $54.72 a barrel
2023 average spread $40.59 a barrel
2024 average spread $26.70 a barrel
2025 average spread $31.99 a barrel
2026 average spread $68.46 a barrel
2026-10-02 diesel $4.50 a gallon, crude $91.11 a barrel, spread $97.94 a barrel

The gap is more than 3x what it used to be. It was $97.94 a barrel on Friday. From 2019 to 2025 it averaged ~$30. At that average, Friday's crude would put diesel futures near $2.88 a gallon instead of $4.50. These are futures prices, clearly not what you pay at the pump.

Info pulled through the FMP MCP server:

import asyncio, json
from statistics import mean
from fastmcp import Client  # pip install fastmcp

KEY = "YOUR_API_KEY"

async def closes(fmp, symbol):
    r = await fmp.call_tool("commodity", {"endpoint": "commodities-historical-price-eod-light",
        "symbol": symbol, "from_date": "2019-01-01", "to_date": "2026-10-02"})
    return {day["date"]: day["price"] for day in json.loads(r.content[0].text)}

async def main():
    async with Client(f"https://financialmodelingprep.com/mcp?apikey={KEY}") as fmp:
        diesel = await closes(fmp, "HOUSD")  # dollars per gallon
        crude = await closes(fmp, "CLUSD")   # dollars per barrel

    # a barrel is 42 gallons
    spread = {date: diesel[date] * 42 - crude[date] for date in diesel if date in crude}

    for year in range(2019, 2027):
        print(year, f"average spread ${mean(v for d, v in spread.items() if d.startswith(str(year))):.2f} a barrel")

    last = max(spread)
    print(f"{last} diesel ${diesel[last]:.2f} a gallon, crude ${crude[last]:.2f} a barrel, spread ${spread[last]:.2f} a barrel")

asyncio.run(main())

What do you guys think?

reddit.com
u/Bmoses99 — 11 days ago