Nintendo is on fire.

Shares in the Japanese gaming giant surged 3.2% on Wednesday to hit their highest closing level since 2010.

Gains for the year have now reached 30% on hopes that Nintendo (NTDOY) will unlock new levels of revenue with its Switch console, in-game purchases and an online multi-player service that will launch this fall. The stock has far outpaced Japan's Nikkei, which has added only 3% over the same period.

Switch -- which users can hook up to a TV or carry around with them -- has been setting sales records since it launched in early March. It's been helped by the simultaneous release of the game "Legend of Zelda: Breath of the Wild," which sold 2.8 million copies in less than a month.

The only console to have a stronger first month was Sony's PS4 in November 2013, according to analysts at Jefferies.

Switch sales are expected to continue at a brisk pace as Nintendo rolls out more blockbuster games, culminating with the launch of the first Mario game for the console -- "Super Mario Odyssey" -- during the holiday shopping season.

Piers Harding-Rolls, the head of games research at IHS Markit, said the main risk for Nintendo is that it won't be able to keep pace with demand for the console.

Investors are excited by the impending launch of an online platform that will let Switch owners play against users around the world. Sony (SNE) and Microsoft (MSFT) had similar services for years, but Nintendo was behind the curve.

Nintendo is also poised to benefit from a major new revenue stream: Mobile in-game purchases, or small payments made by gamers who want to unlock new levels or features.

"They're basically making a more robust digital content strategy," said Harding-Rolls, who said there are high expectations for the company's mobile games.

Related: This virtual reality startup is now worth $1 billion

Nintendo isn't the only gaming company that has excited investors.

Shares in video-game companies like Take-Two Interactive (TTWO), Electronic Arts (EA) and Activision Blizzard (ATVI) have all rallied by between 38% to 60% this year.

Making games for the big Sony and Microsoft consoles is a major business for them, and they're looking to expand their mobile gaming offerings.

Harding-Rolls said the companies are taking slightly different approaches, but they have all made successful moves to generate revenue through subscription services and in-game purchases.

Take-Two, the company behind the popular game Grand Theft Auto, saw shares hit an all-time high on Tuesday after the company said its sales surged 52% in the first three months of 2017.