Pakistan’s currency rose the most in more than five years amid higher export-related payments and optimism the beleaguered nation is inching toward securing the International Monetary Fund bailout. 

The rupee rose 4%, the most in over five years, to close at 228.8 on Wednesday, according to central bank data compiled by Bloomberg. The currency tumbled about 15% in July, the biggest monthly slide since Bloomberg started compiling data in 1989. 

The currency got a boost after data on Tuesday showed the nation’s trade deficit almost halved to $2.6 million in July as import curbs reduced dollar demand. Pakistan has completed all tasks that were required before the loan review, IMF country representative Esther Perez Ruiz said in a statement on August 2, stoking optimism the nation may be able to avert a potential debt default. 

“Exporters were generally waiting for a peak and once a few started processing export payments, many others jumped in,” supporting the rupee, said Suleman Rafiq Maniya, head of advisory at Vector Securities Pvt. “Further clarity on the IMF also helped sentiment.”

The nation’s imports dropped by about 13% from a year ago to $4.9 billion compared to a record $7.9 billion a month ago, data released on Aug. 2 showed. Pakistan’s FX market has seen a big export payment after a long time, said Faisal Bilwani, head of international sales at Alfalah CLSA Securities Pvt.

Pakistan’s rupee declined temporarily but is expected to appreciate in line with fundamentals over the next few months, the central bank and finance ministry said in a rare joint statement released near midnight on July 31.

“Pakistan by having an IMF program, by introducing a significant tight budget and depressing demand for imports has weathered the storm,” finance minister Miftah Ismail said in an interview to Bloomberg on August 2.