Show HN: I simulated closing the Strait of Hormuz on real oil trade data

Posted by eliotho 1 day ago

Counter82Comment34OpenOriginal

OP here: I created this visualization tool as the byproduct of a supply chain class I taught at Columbia. The pedagogical exercise grew into a full blown visualization and paper about global oil trade.

The model: The mechanics are the same as the financial network Eisenberg-Noe: Instead of banks, every country consumes oil interconnected via bilateral trading. Shocks propagate throughout the network, depleting oil reserves when bottleneck nodes (such as the Strait of Hormuz) are blocked.

Insights: The interesting part is the mechanics of how the crisis unfolds: for example, France receives 0 oil from Hormuz directly, yet their reserves are depleted faster because other countries reactively increase their safety oil stock, increasing oil price, making stockouts more expensive for everyone.

The model also gives price dynamics which are interesting on their own: the price increase is not immediate, it follows sequentially as countries reserves deplete.

Some caveats: 1. For producer nodes, depletion means their export slack is reduced/exhausted. 2. No sanctioned trade (UN Comtrade data)

Technical Details: The visualization is 600 lines of flask plus js frontend (LLM assisted visualization with ground-truth matching the original numerical exercise of the paper)

Paper with proofs/theory: https://arxiv.org/abs/2607.17491

Comments

Comment by anigbrowl 21 minutes ago

An interesting fact to consider is that the US stockpile (the Strategic Petroleum Reserve) is reported as the total of sour (high sulfur) and sweet (low sulfur) crude oil. The sweet stock makes up about 1/3 of the reserve and hardly varies at all. This is because US refineries are virtually all configured for sour crude: due to a mistaken belief in the 1990s that sweet crude was running out, the industry bet the farm on sour crude refining, and if sour crude runs low, it's extremely economical to switch.

As a result, almost all the draw from the SPR is of sour crude (currently ~5 million barrels/week). However, you can't just use up all the reserve because as levels get lower brine must be pumped into the storage chambers to retain pumping pressure, and the more brine that is pumped, the more the output quality declines.

The weekly reports indicate a total in the SPR of about 300mbb, of which ~100 are sweet and 200 sour. But for the reasons above, output becomes unusable one the sour levels fall to ~140-150mbb, at which point there is almost certainly a severe diesel supply shock. At current drawdown rates, that would be sometime around October/November, right in the middle of harvest season when demand for diesel is highest.

There's more complexity to this than I want to type out in a HN comment, but not that much more. Draw your own conclusions.

Comment by HarHarVeryFunny 1 day ago

What concrete predictions does your model make?

What developments in pricing/other would indicate that your model is wrong or incomplete?

Nice website regardless, but I'm a bit skeptical that the dynamics of the global oil/energy market can be accurately predicted.

Comment by maxerickson 10 minutes ago

It's making crude predictions.

Comment by eliotho 1 day ago

>What concrete predictions does your model make?

Well, the model is less of a prediction and more of a stress testing tool. But under the hypothetical closure scenarios it shows the timing the oil reserves of distant countries exhaust, as well as the systemic effects on pricing (the France paradox).

>What developments in pricing/other would indicate that your model is wrong or incomplete? The model has a stylized way of incorporating pricing as a function of the total supply. In practice, when countries ration their oil that's beyond the scope of the model. That being said, the implied pricing trajectory is estimated and could be tested (the staircase graph showing prices constant while countries absorb the shock with their reserves and rebalanced whenever there is a reserve depletion).

>Nice website regardless, but I'm a bit skeptical that the dynamics of the global oil/energy market can be accurately predicted. Thank you! Indeed, but I think having at least a stylized testing tool might be useful for policymakers :$ (assuming decisions are ever data-driven lol)

Comment by bragr 1 hour ago

>In practice, when countries ration their oil that's beyond the scope of the model.

Does your model assume that demand is constant regardless of price? We're already seeing a reduction in demand over the last several months.

https://finance.yahoo.com/energy/articles/global-oil-demand-...

Comment by eliotho 1 hour ago

There are two versions of the model: -The one rendered by default (called Endogenous), with endogenous price that affects the demands according to the price elasticity slider. Reflecting how reactive are the nodes demand wrt price -With fix price (called Fixed): that in the oil market doesn't apply, but it's an interesting baseline to consider oil purely as flow. And as a modeling tool, this allows the model to capture small supply chains that don't have price setting power.

Comment by toomuchtodo 1 hour ago

> China's decrease of 1.5 million barrels per day, representing a 9% decline, was by far the largest globally, the report said.

Some global demand destruction is occurring, but that of China is them switching to large internal strategic reserves.

https://youtu.be/BkA0bkb6ZO0 (whole video is worth the watch)

Comment by eliotho 1 hour ago

And this is what the model price formation assumes, and in fact, the silent mechanism that makes the crisis worse. Reserves silently deplete for each country, and each epoch where they exhaust is when the price rebalancing occurs IN A SUDDEN SPIKE, affecting other nodes that are not even connected to Hormuz, which is one of the conclusions of the paper. Either directly or indirectly all countries feel the pain: the question is who can stand the game of chicken the longer before intervening

Comment by toomuchtodo 1 hour ago

The suspense is terrible, I hope it lasts. Great work on the project!

Comment by eliotho 43 minutes ago

Thank you! Much appreciated. On the suspense, we are all riding the same train :$

Comment by firasd 3 hours ago

Very interesting. Here in India people were very concerned about potential cooking gas shortages (LPG) when the disruptions began which is also a good example of usually-overlooked dependencies on the the Strait

Comment by eliotho 2 hours ago

and the interesting thing is that the common factor is that all these crises (oil, financial, gas) spread silently until a node collapses and there is a domino effect over the whole network

Comment by Normal_gaussian 1 hour ago

I don't know if I'm doing something wrong, but if I set Capacity Retained to 100% then no matter what I set the other values to a bunch of countries deplete their reserves.

This feels wrong; but I'm inclined to think I'm missing something.

Comment by eliotho 1 hour ago

Fair point. Actually this is both a semantics oversight on my part and also expected behaviour. at 100% retained there's no shock, but the model's countries target consumption plus a large safety buffer, and some can't fill that target even in peacetime, so they draw reserves at baseline, the shock scenarios show the additional damage relative to that baseline

Comment by entropie 1 hour ago

Good stuff.

Maybe you can make a playback speed option for the simulation/play button? I fail to follow up.

Comment by eliotho 1 hour ago

Thank you. Yes, in desktop there is one (that might still be going a little bit too fast), but in mobile it might not be that easy to find. Perhaps I will slow down the speed in mobile by default and change the location (should be in the bottom right corner, the 2 wk/s can be changed to 1 wk/s)

Comment by kingjimmy 2 hours ago

Are emergency stockpiles calculated correctly? China should not be the first to be exposed.

Comment by repeekad 2 hours ago

China hides its stockpile numbers, and estimates are only what we can see. After buying loads of sanctioned oil for stockpiles, they are perfectly positioned to take advantage of trumps blunders in the straight and likely will get to set the price of oil if they aren’t already..

Comment by eliotho 2 hours ago

Which is the interesting game-theoretic aspect of the whole conflict. China really hasn't revealed their hand

Comment by eliotho 2 hours ago

For the importer nodes those are IEA mandates. In the specific China case, the UN Comtrade data doesn't report sanctioned oil (Iran)

Comment by tamimio 2 hours ago

But in reality this won’t happen, because China won’t be happy and will force Iran to a deal like last time or they will lose all the parts and intelligence tech they are providing to them.

Comment by eliotho 2 hours ago

Exactly, which is what makes the simulation interesting because nobody really knows China's reserves clock.

But with the tool, you can put your guess number and see that the game of chicken also has an expiration date for them

Comment by upcoming-sesame 2 hours ago

Can't Iran be selective and only allow Chinese ships through?

Comment by chairmansteve 1 hour ago

The USA could block Chinese ships. Or maybe disable the loading jetties.

Comment by eliotho 1 hour ago

This works as the same feature reversed. Will think of a way of adding something like this

Comment by DANmode 8 minutes ago

Ah yes, open war with a superpower.

Why haven’t the USA done that already?

It’s so obvious!

Comment by eliotho 2 hours ago

This is a nice idea. I will build this a feature on the scenarios menu. And it would give an estimate of how much time doing this buys China under different configurations

Comment by alephnerd 2 hours ago

> because China won’t be happy and will force Iran to a deal like last time...

Iran's political leadership is amenable to negotiating but their incumbent military leadership which now calls the shots aren't [0][1].

The current incumbents in the IRGC and Artesh are now vets who were deployed on the frontlines in Syria, Lebanon, Yemen, and Iraq and are deeply anti-Western as a result.

> or they (Iran) will lose all the parts and intelligence tech they (China) are providing to them...

This is why Iran has been leveraging Russia as well [2][3].

Russia is trying to link the Ukraine War with the Iran War ("stop giving Ukraine targeting capabilities and we'll stop giving it to Iran").

Iran's military leadership doesn't trust China because they undermined Iran's position on Hormuz by backing the UAE [4], and because hardliners still harbor negative views of China and Eastern culture as undermining the precepts of the Islamic Revolution [5][6][7] and still calling them "uncultured orientals" (شرق زدۀ بی فرهنگ)

[0] - https://quwa.org/pakistan-defence-news/pakistan-iran-mediati...

[1] - https://quwa.org/podcasts/pulse-check/the-islamabad-talks-ar...

[2] - https://www.reuters.com/world/middle-east/iran-strikes-cia-f...

[3] - https://mecouncil.org/wp-content/uploads/2025/06/IB-10_25-Ir...

[4] - https://www.straitstimes.com/asia/china-maintains-stance-on-...

[5] - http://www.imam-khomeini.ir/fa/c78_117016/%DA%A9%D8%AA%D8%A7...

[6] - https://ensani.ir/fa/article/93161/%D8%B4%D8%B1%D9%82-%D9%88...

[7] - https://psri.ir/?id=a7q4sdl4

Comment by sebzuddas 2 hours ago

What modelling approach are you using, and where can I learn more about it? Really cool, btw.

Comment by eliotho 2 hours ago

Thanks, the modeling is similar math to the financial banking networks paper by Eisenberg and Noe Systemic Risk in Financial Systems (used as a stress tool by regulators after the 2008 financial crisis). My adaptation is combining this with the inventory management part in my article: https://arxiv.org/abs/2607.17491

Comment by runlaszlorun 2 hours ago

Very cool. I'll def check this out more later on.

Comment by eliotho 1 hour ago

Much appreciated, server seems to be (fingers crossed) going strong so far

Comment by 3 hours ago

Comment by 1 day ago

Comment by refulgentis 3 hours ago

I really do appreciate the effort but the data doesn’t reflect current conditions, and it’s falsified given it’s been virtually closed for months, certainly the same as 30% throughout that is the models default parameter, and we didn’t see ex. prices at $150/barrel 3 weeks in, or a host of other things it predicts.

EDIT: I’m not saying it doesn’t matter the strait is closed - it does! - it’s just, what are we to do with a model that generically tells us oil barrel prices is at $150 3 weeks in, when we are months in?

Comment by eliotho 3 hours ago

That's kind of the point because it hasn't been totally 100% closed. There's both sanctioned and unsanctioned oil flowing, which is the point of the scenarios in the simulation. Also it's more of a simulation/stress tool at a sustained closure than a prediction one