Based on gross domestic product at the end of 2015 published by the International Monetary Fund, the size of South Africa’s economy is $301 billion at the rand’s current exchange rate, while Nigeria’s GDP is $296 billion. That’s after the rand gained more than 16 percent against the dollar since the start of 2016, and Nigeria’s naira lost more than a third of its value after the central bank bank removed a currency peg in June.

Both nations face the risk of a recession after contracting in the first quarter of the year. The Nigerian economy shrank by 0.4 percent in the three months through March from a year earlier amid low oil prices and output and shortage of foreign currency. That curbed imports, including fuel. In South Africa, GDP contracted by 0.2 percent from a year earlier as farming and mining output declined.

“More than the growth outlook, in the short term the ranking of these economies is likely to be determined by exchange rate movements,” Alan Cameron, an economist at Exotix Partners LLP, said in e-mailed responses to questions on Aug. 2. Although Nigeria is unlikely to be unseated as Africa’s largest economy in the long run, “the momentum that took it there in the first place is now long gone.”