Here’s how China managed to lose $500 billion in reserves in one year

China lost $500 billion in foreign-exchange reserves in 2015.

$500 billion!

If that sounds like a lot of money to you (it is!), here is a helpful explainer from Macquarie Research on how that money left the country.

Dissecting China’s capital outflows
CEIC, Macquarie Research

Chinese pay down foreign debt: This was the main driver and accounted for one-third of total outflows. Chinese firms wanted to get rid of their foreign debt as the US dollar became stronger. (The currency move made the debt more expensive to service.) The yuan’s deep dive last August accelerated that.

Error and omission: This covers everything that isn’t classified in other items in the balance of payments, and includes things like underground capital flows and trade misreporting. That added up to $188 billion.

Chinese ramp up foreign assets: Chinese residents rushed to boost their foreign holdings in 2015 as the value of the yuan fell.

Foreigners withdraw money from Chinese banks: Foreign residents took out $123 billion from local banks in China last year, driven by the yuan depreciation. This also reflects the broader trend of capital flowing from emerging markets to developed markets.

Securities investment: There are two things going on here. First, Chinese residents invested more abroad over the year to diversify their portfolios and hedge against further yuan depreciation. Second, foreign investors started to pull money out after the market crashed in the third quarter of 2015.

Direct investment: Chinese companies started gobbling up foreign companies, bumping up the nation’s capital outflows.

The outflows have slowed through the early stages of 2016. Chinese officials have cracked down on underground banking and asked banks to clamp down on those who tried to get around a cash withdrawal limit of $50,000 a year through “smurfing,” or asking friends or family members to move money in small amounts.

Here is Macquarie:

On balance, we believe the risk of capital flight is low in the near term. On one hand, more than half of the carry trade position has left. On the other hand, the government could still use capital controls to limit Chinese residents to move money out of China. Of course, money could still leave under direct investment (ODI) and security investment (using the existing QDII quota) or even misreporting of exports/imports. But these channels are still small and they are under the scrutiny of regulators as well.