Cuba’s strategic pivot toward the United States got specific on Thursday, as the White House announced new regulations easing travel and other restrictions for Americans wishing to go to the island. This same week, oil prices flirted with levels of $40 per barrel. Americans don’t usually think of these stories as being in any way related. But Venezuelans do.

When the historic thaw between Cuba and the U.S. was announced last month, one detail jumped out at Venezuelans. Secret negotiations had begun, we were told, a year and a half before. In Caracas, everyone could do the math: The talks started right after Hugo Chávez, the leader of Venezuela’s socialist revolution and Cuba’s staunchest ally, died.

Few could mistake the timing for a coincidence, or be confused about the message being sent: Havana had sized up Venezuela’s untested new leadership and hedged against the possibility the countries’ close relationship wouldn’t last much longer.

But it took the recent freefall in oil prices for Havana to take the plunge and finalize the deal. The reason is that the considerable help Venezuela sends Cuba is in the form of barrels, not dollars. As oil prices fall, the value of Venezuela’s aid falls. In the final quarter of last year, Cuba’s state finances began to look worse and worse.

With the fall in oil prices, the original worries about the stability of Venezuela’s post-Chávez leadership have only increased, raising the prospect of Venezuelan aid stopping altogether.

Only very fast growth in Cuba’s two other major dollar-earners — tourism and remittances — could possibly compensate for a loss of Venezuelan oil. Only a dramatic opening to the U.S. could prevent a full-scale social and political crisis that could imperil the government’s stability. Raul Castro is a calculating politician, and detente with the U.S. is a move calculated to help his regime survive.

It’s easy to lose sight of just how central Venezuela’s oil largesse has been to the Cuban state’s financial strategy. Following a landmark 2003 “Cooperation Agreement,” Venezuela has been sending 115,000 barrels a day to the island. The Cubans re-export some of the crude that Venezuela sends them to other countries, pocketing some $765 million in 2014. That’s a vital source of fresh dollars for an island that doesn’t have a lot of other good options for earning hard currency.

But surely that’s a fraction of the value of the Venezuelan oil deal to Cuba: The much bigger piece is getting the island’s whole energy import bill more or less paid for. Without Venezuelan shipments, Cuba would have to scrounge up billions in foreign currency it doesn’t possess to pay for the oil it needs to keep buses and trucks on the road and power stations running (at least some of the time). When you figure in those savings, you see that Venezuela’s oil was worth more than $3.6 billion to the Cuban treasury in 2014.

By some measures, Venezuela’s oil subsidy is the Cuban state’s single largest source of revenue. It’s worth a billion dollars more than the $2.6 billion the country reportedly earns from tourism annually.

Apart from tourism, the only source of Cuba’s foreign income in the same league as Venezuela’s oil freebies is the remittances Cuban exiles in the U.S. send back home, which have been estimated at an impressive $3 billion in 2014.

Even without any cut in the volumes sent, the value of Venezuela’s in-kind aid to Cuba has already fallen by almost half in the last six months: if prices stay around $50 per barrel, Cuba will earn $365 million less from Venezuelan oil re-exports in 2015 than it did last year. That shortfall is worth about twice the value of Cuba’s entire sugar industry.

You start to see why the alarm bells went off in Havana when the price of oil started to fall. It’s not just that the re-export business is a lot less juicy with oil at $50 per barrel than at $110. It’s that the Cuban elite is well aware that Venezuelan volumes may not hold up for much longer. If the collapse in oil prices is bad news for Cuba, it’s a kind of cataclysm for its benefactor.

In 2015 Venezuela faces a historic fiscal emergency, with international bond markets taking it virtually for granted that the country will default on its foreign debt. The Cubans understand that Venezuela’s president, Nicolás Maduro, will come under strong pressure to pinch every penny over the coming year, with his own government stability very much on the line. If worse comes to worse, the Maduro regime could collapse altogether, leaving the Cubans entirely in the lurch.

You can imagine the kind of scenario planning Finance Ministry officials in Havana must have been busy doing these last few months. What happens if the Venezuelans cut their shipments to, say, 80,000 barrels a day? Or to 50,000 barrels? What if the price of oil falls farther still?

It’s easy to construct plausible scenarios where Cuba’s sideline as an oil re-exporter dries up, leaving the island scrambling to scrounge up dollars to pay for energy imports. Below, I’ve gamed out four such scenarios, with a comparison to the baseline numbers from 2014.

How can Cuba make up these shortfalls, and quickly? There are two obvious targets: tourism and remittances.

Tourism has grown into a $2.6 billion a year industry over the last two decades. It’s telling that the largest source of tourists into Cuba remains Canada, a relatively small country a relatively long flight away that nonetheless contributed 1.1 million of the 2.9 million tourists who hit Cuba’s beaches last year. The reason is simple: as long as U.S. visitors remained barred from the island, Canada was the biggest rich, cold country in Cuba’s general proximity.

That gives us a rough sense of the huge potential of the American tourist market to the island. There are 10 times as many people in the U.S. as in Canada — and it can be a shorter flight. If a million Canadians go to Cuba each year, why shouldn’t 10 million Americans do the same?

I estimate the average tourist is worth roughly $700 to Cuban state coffers. This is really a rough estimate: I took the number of tourist dollars — from this topline estimate — divided by the number of tourists, and subtracted 20 percent, which I assume goes to airlines and hotel and tour operators. Keep in mind that the $700 per tourist is essentially all profit to the Cuban government. The state does incur costs in running the tourism industry, but these costs are minimal because of the country’s unique dual-currency system.

So with this estimate of profit at $700 per tourist, it would take some 480,000 extra tourists next year to make up the fiscal hit just from the recent drop in oil prices. If Venezuela cuts down on its subsidy volumes further or oil prices fall lower, those numbers climb quickly. If Venezuelan aid stops altogether, Cuba would have to more than double the size of its tourism industry to make up the difference.

Of course, Cuba wouldn’t make up the entire shortfall just on the back of the tourist industry: added mining and agricultural exports would probably be part of the mix. But whichever combination of sugar, nickel and warm beaches Havana settles on to manage the transition, access to the U.S. market will be a must if adjustment is to be carried out in a reasonable amount of time.

It’s little wonder then that in negotiating for a rapprochement with the U.S., relaxing travel restrictions for Americans wanting to go to Cuba was near the top of Havana’s wishlist.

The only other plausible source of extra revenue on this scale is remittances from the Cuban exile community in Miami and beyond. This is a dicier proposition, as the money relatives send creates a space for independence from state control that Havana’s old-line Stalinist leaders clearly fear. But in an economy that’s still as thoroughly state-controlled as Cuba’s, there’s little doubt that remittance money “trickles up” from individual pockets to the state, as people spend their foreign currency in the state-owned “convertible peso” shops that have a monopoly on the sale of a whole range of consumer goods, from PCs to refrigerators.

Which is why Havana negotiated for — and got — much looser rules for remittances from stateside Cubans. The new limit quadrupled to $2,000 per year and the licensing regime was greatly simplified.

From Havana’s point of view, these are all clearly second-best solutions. If the regime had had the choice to keep itself in power by continuing to pocket the proceeds from Venezuelan oil re-exports, it probably would have gone for that. But the recent oil price collapse forced its hand.

Cuba’s communist elite knows a thing or two about surviving in power after a major foreign paymaster collapses. When it happened in 1991, it caught the regime totally unprepared, and led to a period of privations normally only seen in wartime. It’s not a mistake they’re likely to want to make twice.