SINGAPORE owes its existence, and its prosperity, to its place at the heart of intra-Asian trade. In more than 50 years of independence, the city-state has striven mightily to attract investment from all over the world. Such has been its success, indeed, that others hope to imitate its open, low-tax model. In Britain, for example, there has been talk of the country turning into a “European Singapore” once withdrawal from the EU is complete. (It would be a nice start if London’s Tube operated with anything like the same efficiency as Singapore’s subway network.)

The current mood in Singapore, however, is far less buoyant than you might imagine. Singapore has survived and thrived by steering a middle course between America and China. It has been alarmed both by the isolationist rhetoric of President Donald Trump and by recent, highly unusual, public spats with China.

Global trade growth has slowed in recent years. Despite signs of a pickup, this has had a big effect in a city that has the world’s second-busiest port and that (according to Barclays, a bank) is the country most exposed to the global value chains created by multinational companies. Annual GDP growth in 2016 was just 1.8%, the slowest rate since 2009. Even in this famously open economy, the government has been allowing in fewer foreign workers in the face of pressure from the voters.

The city still has enormous potential as a regional financial centre. Thanks to its political stability and strong legal and regulatory systems, Singapore looks like a natural haven—an Asian Switzerland. In particular, Indian offshore wealth is being attracted to the city, which hopes to be a hub for the budding market in masala bonds (rupee-denominated debt issued outside India).

Singapore has a rare AAA credit rating. The IMF last year described its banks as “well capitalised”, with adequate provisions for bad loans, despite worries about their exposure to oil-and-gas firms. Singapore is now the third-biggest trading centre for foreign exchange in the world (having overtaken Tokyo in 2013). It also has a growing derivatives market with daily over-the-counter volume of $400bn, as of October 2015. Finance comprises 13% of the country’s GDP, considerably more than the 8% share it contributes to Britain’s.

But Singapore faces a strong challenge as a regional finance hub from Hong Kong, which benefits from far stronger links to the Chinese economy. Hong Kong has the upper hand over Singapore in terms of investment banking, particularly in corporate-finance businesses such as mergers and acquisitions. Hong Kong’s capital markets are much deeper; the local economy in Singapore is simply not large enough to generate the same volume of business. Many of South-East Asia’s businesses are family-owned and rely on banks (or reinvested profits) rather than the markets for finance. Singapore’s daily stockmarket turnover in 2016 was around S$1.1bn ($797m), down by 19% on 2013 and less than a tenth of the Hong Kong stock exchange’s daily volume.

Indeed, the magnetic pull of China may only increase if America under Mr Trump retreats from its Asian role. Multinationals may feel that they simply have to locate more resources in Hong Kong than Singapore for the sake of proximity to the regional superpower.

Singapore’s long-term prospects may depend on how two trends resolve themselves. Asians are becoming wealthier and are looking for other ways to invest their money aside from bank deposits and property. As Asian economies become more important to the world economy, so banks, insurance companies and fund managers will look to increase their operations in the region. As the thief Willie Sutton said when asked why he robbed banks: “That’s where the money is.”

At the same time, however, technology means that investors can manage their money with the click of a mouse or the swipe of an app. And they can do so at very low cost. Vanguard, an index-tracking fund manager, attracted more global mutual-fund inflows last year than its ten largest rivals combined. Index-tracking managers don’t need to have a regional base in a gleaming office tower in Singapore or Hong Kong.

This city is trying to ride this trend by becoming known as a hub for “fintech”, whereby new, technology-driven groups take aim at established, high-cost finance firms. But this is a tricky tightrope to walk. Fintech may cannibalise existing financial businesses without generating many additional jobs. The next 50 years may present Singapore with even greater challenges than its first half-century.

Economist.com/blogs/buttonwood