Canada’s largest lenders have boosted their capital enough in the past two years to withstand a 35 per cent decline in housing prices in Ontario and British Columbia and 25 per cent in the rest of the country, according to Moody’s Investors Service.

Canada’s six biggest banks and Quebec’s Desjardins Group “incrementally improved" their capital buffers to absorb $14.3 billion in mortgage losses from such an economic shock, which would also include a 10 per cent loss for foreclosure costs, the New York-based ratings company said Wednesday in a report. Losses in Moody’s worst-case scenario have risen from $12.2 billion in 2016 due to a decline in insured home loans and higher mortgage debt from surging home prices in Vancouver and Toronto.

The lenders, which include Toronto-Dominion Bank, Royal Bank of Canada and Bank of Nova Scotia, have "materially higher" levels of regulatory capital, measured by Common Equity Tier 1 ratio, that "would enable them to absorb marginally higher expected losses in their mortgage exposures," Moody’s said.

The adverse scenario would consume about 70 basis points of regulatory capital for the seven companies -- up from 60 basis points two years earlier -- though the higher capital strength more than offsets the increased losses, Moody’s said.

Canadian Imperial Bank of Commerce, which has the largest relative exposure to domestic mortgages, would have the biggest drop in regulatory capital among the lenders tested, with its Common Equity Tier 1 ratio dropping 120 basis points to 10 per cent in the stress-test scenario. Bank of Montreal and Desjardins would take the smallest hit, with a half percentage point drop in regulatory capital, the report said.

Canadian mortgage debt has increased about 6 per cent a year over the past three years, reaching almost $1.8 trillion at the end of April, with growth "largely due" to significant increases in home prices particularly in Toronto and Vancouver, Moody’s said in its report. Almost half of domestic banking assets are home loans.

Still, residential credit quality remains "strong," Moody’s said, adding that an easing debt burden and a strong employment levels are "positive signals."