(Reuters) – Venture capital-backed investment in Canadian financial technology companies hit its highest level in almost two decades last year, even as the flow of funds into major fintech markets like the United States declined, according to sector data.

Fintechs, or companies that use innovative technology to revamp everything from banking to fraud security, globally draw billions in investment annually.

In Canada, fintech is revitalizing the startup scene and has attracted a new crop of Canadian venture capital funds looking to invest specifically in young fintech companies.

According to PitchBook, used by the U.S.-based National Venture Capital Association, venture capital financing in Canadian fintech was $137.7 million in 2016, up more than 35 percent on the year. Five years ago, it was $21.8 million and in 2000 it was $7.3 million.

Figures compiled by Thomson Reuters show a rise of nearly 74 percent from 2015 to 2016, to C$264.8 million ($197.41 million), its highest level since 2000, when venture capital investment in Canadian financial technology firms reached C$317.9 million.

The data vary as some investors do not disclose full information, while methodologies can differ on how the information is collected, how many companies are tracked, what is considered fintech and what constitutes a venture deal.

The figures pale in comparison to the United States, where investments reached $4.27 billion in 2016. But the trend in Canada is on the rise, compared with a decline in the U.S. and Britain.

Investments declined at least 30 percent in the U.S. in 2016, while in the UK they fell nearly 25 percent and Singaporean fintech investment sank 65 percent.

Weaker activity in the U.S. and UK was partly due to market uncertainty around the U.S. election and the Brexit vote in the UK to leave the European Union, as well as smaller deal sizes, according to data provider CBInsights and KPMG.

“From a global stage, Canada is a relatively small market,” said Adam Nanjee, who heads the fintech group in Toronto’s MaRS research hub.

“But it’s one of the best markets to build a company around innovation because we have a great test market, great infrastructure for financial services.”

The province of Ontario has among the highest concentrations of tech firms outside Silicon Valley, according to the provincial government, thanks in part to cheaper costs and the cluster of Toronto and Waterloo area universities producing engineers and developers.

The re-invigorated startup community lured home Canadians – such as the founder of online investment startup Wealthsimple, Mike Katchen – keen to trade promising careers for a more supportive and less cut-throat environment.

“There’s no loyalty whatsoever (in Silicon Valley). You’re going to overpay for somebody, they’re going to stay with you for six months and they leave for the next gig,” said Christian Lassonde, founder of Canadian-based investor Impression Ventures.

“Trying to build a successful company in the Valley has actually gotten too hard.”

California-based Lightspeed Venture Partners, early investors in Snapchat and Nest, has been tracking Canadian fintechs for potential investments.

Lightspeed, which has yet to invest in fintech in Canada, is monitoring startups including League, which offers alternative employee health plans, and FundThrough, a lending service for small businesses.

“What we look for are companies … that may start with the Canadian economy, but are thinking beyond Canada,” said Lightspeed partner Arif Janmohamed.

Other foreign players are also taking note. Goldman Sachs invested in Toronto-based Finance it in 2015 and nanoPay in 2016, for example. Meanwhile, Japan’s NTT Data Corp, one of the world’s largest technology services companies, and MaRS announced a partnership in November to help Canadian startups expand into Japan and give NTT access to technology being developed by Canadian startups.

Maturing big-name startups such as Shopify, Wattpad, and Hootsuite helped pave the way, said Wealthsimple’s Katchen, for the next “cohort of companies that are coming of age on the international stage.”

(Reporting by Solarina Ho; Editing by Alan Crosby)