After 10 years of negotiations, Russia's Gazprom and China's CNPC have finally signed a historic gas deal which will provide the world's fastest growing economy with the natural gas it needs to keep pace for the next 30 years.

The total value of the contract is $400 billion, Gazprom CEO Aleksey Miller said. However, the price of gas stipulated in the document remains a "commercial secret."

Assuming the overall price of the contract includes only the cost of supplies of Russian gas, then the $400 billion price tag means China will pay about $350 per 1,000 cubic meters. Delivery price for the contract will be tied to market oil prices, Putin said from Shanghai on Tuesday.

Infrastructure investment from both sides will be more than $70 billion and will be the world's largest construction project, with Russia providing $55 billion up front and China $22 billion for pipelines on their respective territories.

This is Gazprom's biggest contract to date.

Russia will supply China 38 billion cubic meters of gas per year via the eastern 'Power of Siberia' pipeline, which crosses Siberia and reaches China's populous northeast regions. A separate route that could deliver gas to China's western provinces and provide diversification is also in the works, according to Putin.

A memorandum of understanding was signed in the presence of Russian President Vladimir Putin and President of China Xi Jinping on the second day of Putin’s two-day state visit to Shanghai.

PHOTO: Vladimir Putin and Xi Jinping celebrate 'gas deal of the century' between Russia, China http://t.co/IMxSdjuyRHpic.twitter.com/6L1iNDQwHM — RT (@RT_com) May 21, 2014

According to Miller, the deal was set to go through at 4:00pm Shanghai time when he understood "all fundamental issues were resolved."

RT producers were informed of the landmark energy deal prior to its signing after a conversation with Miller.

You heard it 1st here. The multi-billion gas deal between Russia and China HAS BEEN SIGNED!!! We were told by Gazprom CEO Miller @RT_com — Alexey Yaroshevsky (@Yaro_RT) May 21, 2014

The deal comes as a part of Russia’s larger-scale pivot to Asia and especially China as Western economies threaten sanctions over turmoil in Ukraine. Sanctions by the US and the EU have been mostly limited to visa bans and asset freezes on some of Russia’s top officials, while so far only threatening a so-called third round of real economic sanctions against Russian hydrocarbon businesses.

Just ahead of Putin's visit to Shanghai, Russian Prime Minister Dmitry Medvedev gave reassurance that the agreed price would be fair.

“One side always wants to sell for a higher price, while the other wants to buy for a lower price,” Medvedev said. “I believe that in the long run, the price will be fair and totally comparable to the price of European supplies.”

A major breakthrough in negotiations came on Sunday as Gazprom chief Aleksey Miller sat down with his CNPC counterpart, Zhou Jiping, in Beijing to discuss final details, including price formulas.

Although Europe is still Russia's largest energy market – buying more than 160 billion cubic meters of Russian natural gas in 2013 – Moscow will use every opportunity to diversify gas deliveries and boost its presence in Asian markets.

“I wouldn’t look for politics behind this, but I have no doubt that supplying energy to the Asia Pacific Region holds out a great promise in the future,” Medvedev said.

In October 2009, Gazprom and CNPC inked a framework agreement for the Altai project which envisions building a pipeline to supply natural gas from fields in Siberia via the western part of the Russia-China border.

In March 2013, Gazprom and CNPC signed a memorandum of understanding on Russian gas supplies to China along the so-called eastern 'Power of Siberia' route. When both pipelines are activated, Russia can supply Asia with 68 billion cubic meters of gas annually.

Last year, China consumed about 170 billion cubic meters of natural gas and is expected to consume 420 billion cubic meters per year by 2020.