Rene Johnston via Getty Images A for-sale sign in front of a home in the Toronto borough of East York.

Toronto has risen to second place in an annual ranking of the major cities with the highest risk of a housing bubble burst, while the risk of a bubble burst in Vancouver has fallen ― because prices are deflating. The ranking from Swiss bank UBS looked at 24 major cities on four continents and concluded Toronto has the second-highest risk of a bubble, behind Munich, Germany. That’s up one spot from third place last year. Vancouver, meanwhile, slid to sixth place, from fourth last year. That’s due to falling house prices in the city, which have made real estate less overvalued. Those are the only two Canadian cities surveyed.

UBS Toronto ranks second and Vancouver sixth in the latest housing bubble index from Swiss banking giant UBS.

“In just a couple quarters, year on year price growth rates have reversed from 10 per cent to minus-7 per cent. Sky high valuations and overstretched affordability have made the market vulnerable to even minor demand shifts,” UBS said about Vancouver. But Toronto’s prices haven’t seen the sort of correction Vancouver’s have seen. UBS noted house prices in the city nearly tripled between 2000 and 2017. Worldwide, UBS is predicting the “end of the boom,” with the average price among the cities surveyed at a standstill for the first time since 2012. “Valuations in Vancouver, San Francisco, Stockholm and Sydney have fallen sharply. New York and Los Angeles are lower as well, while Singapore is almost unchanged.” Watch: The best communities in Canada for housing. Story continues below.

To measure the risk of a bubble, UBS analysts look at a number of indicators, including the change in the ratio of house prices and rents to incomes in each city, as well as the change in the value of mortgages, and the value of construction, relative to the overall economy. When the analysts took the broad view, they found investing in real estate in these major cities has paid off for pretty much anyone who has done it in recent decades, bubble risk or not.