TradingDesk-Sim
After spending a few months in physical refined metals trading, I got the big picture of how the mysterious physical commodities world works from the inside.
In Aug 2026, I created TradingDesk-Sim as a simulator game with inspiration from how I saw allocation decisions being made live on the desk.
The initial motivation was for it to be a way for me to digest the technical knowledge that I had learnt, as a sort of self-assigned “graduation thesis”/ take away summary. It has since led me down a bigger rabbit hole.
After I got AI models to play the game, it became apparent that a very realistic real-life simulator could be extremely useful training material for AI models or benchmarking. Multiple iterations were then made to TradingDesk-Sim to enhance its realism, and it has reached a point where I start to feel reluctant to share the full playable version on the open web.
In place of a human playable game simulation, I had some fun creating a video walking through the project instead. The voice-over narration is generated based on a 55 second clip of my voice.
Follow the Entire Project via these Blog Posts:
-
TradingDesk-Sim (what you are reading now)
I created a game simulating physical commodities trade allocations, consisting of signed term contracts and monthly spot opportunities, along with hedge mechanisms (QP based on month averages), simulated freight, storage, interest rates, and possible events.If you are not yet familiar with how physical commodities trading works, I have written a short 101 below.
-
Physical Commodities Trade Allocation as an Optimisation Game: Part 1
I tried to make local models running on my mac mini play the game, but they kept crashing. -
Physical Commodities Trade Allocation as an Optimisation Game: Part 2
I then made more powerful models play the game, and discovered that models are smart time traveling cheaters (i.e. I discovered look ahead bias). -
Physical Commodities Trade Allocation as an Optimisation Game: Part 3
To address look ahead bias, I created synthetic years and ended up building a “Synthetic Year Generator” engine to systematically produce new years, which can be used for training/ eval purposes.
Physical Allocation Decisions 101
In a typical set up, your desk will have a few long term purchase and sales contracts which were previously negotiated. Ideally these existing contracts would have locked in good prices, but it is also possible that they are not profitable/ not the most profitable.
Opportunities then arise during the year with new contracts that a trader can sign, from talking to counterparties day-to-day. These new opportunities will come with the latest premiums and QPs, which could be better/ worse deals than your long term contracts given how the benchmark prices have moved. A trader should have an idea of how they could allocate these new contracts, and will then decide whether to enter into them.
Sales and purchases are typically priced to LME + premium or CME + premium, and typically the trades are consolidated across the desk so that hedging is done on the net position for each QP. So really, how much money is made lies mostly in the negotiated premium. Sometimes though, when e.g. CME spread blows out vs LME, it is also possible to do very lucrative trades where the paper spread is locked in first, followed by physical deliveries shipping from LME to CME.
The first few iterations of the game simulates the 2025 copper price conditions for LME and CME, freight spikes, and vessel delays. I particularly wanted to create a simulation for 2025 copper prices because was a particularly interesting year for copper with tariff headlines, which gave rise to more arb opportunities than in a normal year. (Later on, I created a simulation engine which generated synthetic years from a catalogue of possible events).
For commodities like coal, allocation decisions can be more complicated because of the possibility to blend different grades of coal. For refined metals like copper cathodes and aluminium ingots, it is a lot simpler because blending is not possible, and the most you could do is something like quality sorting by bundle numbers against a COA.
The binding constraint in making allocations is making sure the correct volume of acceptable brands are assigned to customers for timely delivery. The layer on top of that would be figuring out the best allocation within the constraints to maximise profits, especially when there are changes to your original plans (e.g. due to vessel delays) or market conditions (e.g. spike in freight, sudden changes in benchmark prices).
Financing is also a big part of physical trading. In fact, some trades exist purely because of the trader’s ability to meet the specific working capital needs of the counterparties, and payment terms are key points of discussions with the credit team. In the default game, payment terms is simplified to be 100% to suppliers once cargo is at named location, and 100% from customers on delivery day. The game uses previous 5 days CSP for provisional invoices, with final pricing when QP finishes.