Chris Hansen saw it coming.

Mr. Hansen, who runs San Francisco hedge fund Valiant Capital Management, had an early conviction the novel coronavirus would wreak havoc on the global economy.

Mr. Hansen and his team homed in early on the risks the virus posed and placed wagers accordingly, said people familiar with the firm. In late January, Valiant boosted its bet against stock indexes as it became more concerned about the virus.

In February, Valiant started placing bets against, or shorting, levered companies it viewed as likely to be hurt from an economic slowdown caused by the virus. As the market plummeted, Valiant posted gains on those bets, including some on cruise lines, international airlines and travel companies. By early March, the fund had begun shorting less obvious candidates, believing those with weak balance sheets and companies it viewed as fraudulent would be caught out in a prolonged slump.

By the end of March, Valiant was up 36% for the year before fees, said the people familiar with the firm. The return stands in contrast to a 19.6% drop in the and a 21.3% decline in the MSCI All World Index, a broad global index measuring the performance of stocks around the world.