AS THEY contemplate high unemployment, foreclosed homes, shrivelled house prices and the arrogant follies of their investment bankers, Americans may cast envious glances across their northern border. Despite its umbilical links with America, Canada's economy suffered only a mild recession and is now well into a solid recovery. The Canadian dollar, having dipped sharply, is back up to rough parity with the greenback. The Bank of Canada has signalled that it may soon raise interest rates. When Stephen Harper, the prime minister, hosts the get-togethers of the G8 and G20 countries next month he will be able to boast to his visitors that his country's economy is set to perform better than that of any other rich country this year.

How has Canada avoided the plagues that are afflicting everyone else? The short answer is a mixture of good policies and good luck (see article). The main reason for the country's economic resilience is that neither its financial system nor its housing market magnified the recession. The banks remained in profit. House prices held up fairly well and are now rising. And for that regulators deserve a chunk of the credit.

Canada's banks face high capital requirements and a cap on their leverage, such that their assets cannot exceed 20 times their capital (a lot less than the corresponding figure for many Wall Street firms and European banks). Canadians who take out mortgages worth more than 80% of the value of the property must also take out insurance against default from a federal agency, the Canada Mortgage and Housing Corporation. The banks must insure the rest of their mortgage book with the corporation. It helped, too, that Canada has a single banking regulator. The big five banks snapped up the leading stockbroking firms in the 1990s, becoming universal banks. But, whether through luck or judgment, they never became too dependent on investment banking. And, mirabile dictu, their shareholders managed to ensure that bankers' bonuses were kept within modest bounds.

Many of these rules embody lessons learned the hard way from banking collapses in the mid-1980s. Something similar goes for the public finances. By 1995 Canada's chronic fiscal deficits, towering public debt and stagnant economy prompted the Wall Street Journal to call it “an honorary member of the Third World”. Years of deficit cutting followed. The result was that Mr Harper's government could easily afford the modest stimulus it applied in 2008. Government debt in Canada is still below 36% of GDP (and will soon fall), little more than half the (rising) ratio in the United States.

But there is also a large dollop of good fortune behind Canada's resilience. If parts of eastern Canada resemble Europe in economic terms, the west looks more like Brazil. Its mines, oil and gas producers and farmers have benefited from the commodity boom brought about by China's appetite for raw materials. This boom brings a problem: it is helping to drive up the Canadian dollar, which risks making life more difficult for manufacturers back east. And Canada's fiscal health will soon come under strain from the treasured but expensive public health-care system and an ageing population. There is little sign that the country's politicians are ready to deal with either.

The costs and benefits of conservative banking

How much of the Canadian model can, or should, be exported? Critics of the Canadian banks reckon that their conservatism was the flip side of a cosy oligopoly. The big five were barred from merging and partly protected from foreign interlopers. They shared out a profitable domestic market and gave up competing on price. And keeping tabs on the banks is much easier when all are relatively small by international standards and are based within a few hundred yards of each other and of regulators in Toronto.

The result is that Canadians pay more for financial services than others and there is little innovation. Even so, as taxpayers elsewhere dig deep to pay for their bankers' wheezes they might think that Canadians got a bargain. Replicating Canadian banking elsewhere would be hard. But when Americans and Europeans press Mr Harper at the G20 meeting to accept a tax on banks to curb their riskiness, he has reason to retort that Canadian-style regulation does the job better.