I N A CONTROL room at the headquarters of Ctrip, China’s largest online travel agency, dozens of fluorescent lines flash every second across a big digital map of the world. Each line represents an international flight sold on Ctrip’s platform. The top destinations on the morning of March 11th, when your correspondent visited, were Seoul, Bangkok and Manila. A live ranking for hotel reservations put Liverpool in first place among European cities, Merseyside’s rough-hewn charms briefly trumping Venice and Barcelona (and apparently benefiting from a special offer).

In this century’s first decade Chinese citizens averaged fewer than 30m trips abroad annually. Last year they made 150m, roughly one-quarter of which were booked via Ctrip. That is not just a boon for hotels and gift shops the world over. It is a factor behind a profound shift in the global financial system: the disappearance of China’s current-account surplus.

As recently as 2007 that surplus equalled 10% of China’s GDP , far above what economists normally regard as healthy. It epitomised what Ben Bernanke, then chairman of the Federal Reserve, called a “global saving glut”, in which export powerhouses such as China earned cash from other countries and then did not spend it. China’s giant surplus was the mirror image of America’s deficit. It was the symbol of a world economy out of kilter.

No longer. Last year China’s current-account surplus was just 0.4% of GDP . Analysts at Morgan Stanley predict that China could be in deficit in 2019—which would be the first annual gap since 1993—and for years to come. Others, such as the International Monetary Fund, forecast that China will maintain a surplus, though only by the slimmest of margins. Either way, it would be a sign that the global economy is better balanced than a decade ago. It could also be an impetus for China to modernise its financial system.

The basic explanation for the change is that China is buying much more from abroad just as its exporters run into resistance (see chart). Its share of global exports peaked at 14% in 2015 and has since inched down. The trade war with America adds to the headwinds. At the same time, imports have soared. China’s surplus in goods trade in 2018 was the lowest for five years.

The tale of trade in services, especially tourism, is even more striking. When Beijing hosted the Olympic games in 2008, foreign visitors splashed out a little more in China than Chinese did abroad. Since then the number of foreign arrivals in China has stagnated, while Chinese outbound trips have surged. Not only that: Chinese travellers have proved to be big spenders, as anyone who has queued for a VAT refund at London’s Heathrow airport knows only too well. In 2018 China ran a $240bn deficit in tourism, its biggest yet. Some of the current-account fluctuations are cyclical. Chen Long of Gavekal Dragonomics, a research firm, notes that the price of oil and semiconductors, two of China’s biggest imports, was high last year. If they come down, a current-account surplus could swell up again. Yet deeper forces are also at work. At bottom, a country’s current-account balance is simply the gap between its savings and its investment. China’s investment rate has stayed at a lofty 40% or so of GDP . But its savings rate has fallen to about the same, from 50% of GDP a decade ago, as its people have learned to love opening their wallets (or rather, tapping their mobile payment apps). An ageing population should lead to a further drawdown of savings, because fewer workers will be supporting more retirees. The disappearance of the surplus is, in this sense, a reflection of China growing richer and older. There is, nevertheless, some concern about the implications. In emerging markets big current-account deficits can be a warning sign of financial instability, indicating that countries are living beyond their means and relying on fickle foreign investors to fund their spending. But China is in no such danger. Any deficit is expected to be small, as a fraction of GDP , in the coming years. What is more, the government still has a fat buffer of $3trn in foreign-exchange reserves. That should buy it time.

The crucial question is how China uses this time. By definition any country that runs a current-account deficit needs to finance it with cash from abroad. In an economy with a wide-open capital account and a freely floating currency, inflows and outflows balance without the central bank giving it much thought. But in China the government keeps a tight grip on both its capital account and its exchange rate.

So now that it is facing the prospect of current-account deficits, it has little choice but to relax its grip, in order to bring in more foreign funding. It is moving in that direction. China has long controlled access to its capital markets by issuing strict quotas to foreign investors, with a preference for institutions such as pension funds. But in recent years it has opened more channels, notably through carefully managed links to the Hong Kong stock exchange.

These moves, though incremental, have been enough in aggregate to persuade compilers of leading stock and bond indices, important benchmarks for global investors, to bring Chinese assets into their fold. Last month MSCI said it would more than quadruple the weight of mainland-listed shares in its emerging-markets stocks index to 3.3%. Next month China will enter the Bloomberg Barclays bond index, which could fuel roughly $100bn of inflows into Chinese bonds within two years.

In a new book on China’s bond market, the IMF argues that this could foster a virtuous cycle. More active investing in bonds would support the government’s goal of using interest rates as a bigger weapon in its monetary-policy arsenal (instead of old-fashioned administrative guidance). With a more flexible exchange rate to boot, China would end up with a more modern, efficient financial system—proof that a current-account deficit can, handled well, be a welcome development.

But there are clear limits to how far China is willing to go. Efforts to lure in foreign investors have not been matched by moves to make it easier for its citizens to invest abroad. Yi Gang, the newish governor of the central bank, has repeatedly vowed to maintain the “basic stability” of the yuan. Louis Kuijs of Oxford Economics thinks the constraint is ultimately philosophical. The Chinese government is wary about ceding too much control to the market. “It implies a relatively slow opening up,” he says.

Another element of China’s approach to managing a deficit is therefore to stop it from getting too big in the first place. Guan Tao, a former central-bank official, says that China has to improve its competitiveness in services. With a better tourism industry, better universities and better hospitals, China would, he believes, attract more foreigners and keep more of its own spending at home.

Think of it as the second act for the Great Wall. It never much worked as a fortification for China: over the course of its two-plus millennia in existence, barbarian invaders repeatedly breached it. But now its role is to lure in tourist hordes. In this battle it has a better chance of success.