Some of the world’s poorest oil-producing countries are slipping behind on payments for billions of dollars in oil-for-cash loans from commodity trading houses, putting them at risk of default. The so-called prepayment deals, in which a trading house advances a nation money to be repaid with future oil shipments, have been popular among some African and Middle East oil nations as the only way to raise funds. But they have also proved controversial: in some cases they create an opaque source of debt that governments find hard to pay back when oil prices plunge.

The Kurdistan region of northern Iraq is now struggling to repay a $500 million loan from commodity giant Glencore Plc, according to documents reviewed by Bloomberg News. Glencore and rival trader Trafigura Group Ltd. are also in talks to restructure oil-for-cash loans of about $1.5 billion with the Republic of Congo, according to people familiar with the matter. And Chad, one of the poorest countries in the world, is using a clause in its oil-for-cash contract worth more than $1 billion to reduce payments.

Global Witness, a non-governmental organization, has called the loans a “gamble on the future oil price”, warning countries that they can become an “open-ended liability for future governments and generations.” As the loans are repaid with cargoes of oil, when the market price plunges, countries need to divert more barrels to keep up with the payments. In a worst-case situation, like in 2016 for Chad, it could mean devoting a country’s entire petroleum output to repaying the loans.