Chinese president Xi Jinping pledged $4 billion in loans to Venezuela while visiting president Nicolás Maduro this week. The agreement will raise Caracas’s existing debts to Beijing by almost 25%, to over $20 billion—money that the country may find it increasingly difficult to repay.

China has lent its South American partner more than $40 billion since 2008 to help Caracas shore up its ailing economy, which is expected to slip into a recession this year and has suffered from shortages ranging from medicine to toilet paper. Venezuela has been paying that money back mostly with oil, but that is getting harder to do.

Every day, about 500,000 barrels of Venezuelan oil are exported to China, half of which go to pay off the country’s loans from Beijing. As of last month, outstanding debt totaled $17 billion, according to Venezuela’s vice president for the economy. The Maduro administration plans to pay off the additional loans by producing and exporting more oil—an additional 100,000 barrels (paywall) a day. Venezuela sits on the world’s largest proven oil reserves.

But Venezuela has had trouble meeting production targets in the past, and production has been falling over the past decade, in part because of strikes in 2002-03 and the government reinvesting less in the industry. Output of petroleum and other liquids and condensates has fallen to 2.49 million barrels a day last year, from a little under 3 million in 2004, according to the US Energy Information Administration’s estimates.

EIA no-caption

This has meant Venezuela has had to cut back on its shipments and sales to other major markets, namely the United States. Last year, Venezuela’s state oil company Petróleos de Venezuela sent more oil to Asia than North America for the first time, with sales to Asia rising 11% while sales to North America, mainly to the US, alling 12%. In April, Venezuelan oil exports to the US were at the lowest point in 18 years.

“Sales to China may be increasing,” Fernando Sanchez, vice president of the Society of Venezuelan Petroleum Engineers told Bloomberg that same month. “But the company doesn’t earn money from them. The US is where they sell oil for money.”

So far, Sino-Venezuelan ties seem as stable as when Hugo Chávez, an ally of Beijing’s, was still leading the country. Aside from an embarrassing rendition of Venezuela’s national anthem, Xi’s state visit to Caracas went on without a hitch. The two state leaders signed about 38 economic agreements, deals to explore mining reserves, expand public transport, and launch another Venezuelan satellite. But with an increasing amount of Venezuelan oil going to repay its debts to China, the relationship may not stay unstrained for long.