Russia is set to close a natural gas supply deal with China that Russian Prime Minister Dmitry Medvedev says will be 30 years, and valued around $400 billion. 

Vladimir Putin, Medvedev's boss, will speak with executives in Shanghai today in order to close the deal. Medvedev told Bloomberg Television, "It's time we reached an agreement with the Chinese on this issue. It is very likely that there will be a contract, which means long-term contracts." It has been in the works for over ten years, with price as the major point of contention.

Simon Powell, head of oil and gas research at CLSA Ltd. in Hong Kong, told Bloomberg, "We expect the Sino-Russia gas deal to be finally ratified during President Putin’s visit and the pricing terms will not be too demanding for China."

Because of the sanctions Russia faces from the United States and Europe, Russia was put in a position where they could offer China a lower price to ensure a long term, profitable deal that would not be touched by existing sanctions. China was the only country on the United Nations Security Council not to actively disapprove of Putin's behavior towards Ukraine. 

During Putin's trip to Shanghai, OAO Gazprom (the world's leading producer of natural gas) hopes to sign a deal with China National Petroleum Corp. China and Russia have a very lucrative trade partnership; they did $94.5 billion in business with Russia in 2013. 

The deal is just "one digit away" from completion, says Chief Executive Officer of Gazprom Alexey Miller, "There's just one issue, which is the so-called P-zero, or basic starting price in the formula." This digit is so important that Putin is personally handling its negotiation. Once this is complete, likely this week, Gazprom will begin building a major pipeline to China. 

The pipeline will cost $22 billion and carry 1.34 trillion cubic feet of natural gas per year. If all goes well, Russia will begin supplying China with gas in 2019. It will carry 25 percent of China's current gas consumption, though by 2019, the proportion could be closer to 10 percent. 

As for the cost that has caused all of the negotiation trouble, Russia will charge China $335 per thousand cubic meters, or $9.50 to $10 per thousand cubic feet. Gazprom charges Europe an average of $380.50 per thousand cubic meters, so China is getting a good deal. Right now, China pays Turkmenistan $10 per thousand cubic feet. 

While Gazprom and Russia obviously stand to profit exceptionally from the deal, it also functions as a shrewd political move. “The Kremlin is keen to show both the European Union politicians, western companies and the domestic audience that it is not restrained by the the threat of sanctions and has plenty of energy and trade partnership options with China,” said Chris Weafer, a founder of Macro Advisory in Moscow.