THE good times for Gazprom once seemed like they would never end. The world’s largest natural-gas producer, founded out of the old Soviet gas ministry, enjoyed sky-high gas prices for years. The gas flowed along pipelines into Europe; the profits flowed back. Gazprom began work on a $1.9 billion headquarters in St Petersburg and acted as a bottomless wallet for Russia’s rulers. Whatever problems it encountered, it could “drown with money”, as Natalia Volchkova of the New Economic School in Moscow puts it.

All this is now under threat. Its ageing gasfields are in decline. Thanks to America’s shale boom, gas is more plentiful on the world market. Gazprom’s European customers are realising that they have other choices. The prices it can charge are falling, and with them the firm’s prospects.

Years of easy money have made Gazprom fat and slow. It dominates its domestic market, producing 75% of Russia’s gas. It enjoys a monopoly over exports of the stuff. Until recently, it had a tight grip on western Europe, where it supplies around 25% of gas. It retains an even tighter grip on former Soviet-bloc countries in eastern Europe. For a long time, this insulated Gazprom from shifts in global gas markets.

Gazprom is not a normal company. It serves two masters. As a firm that issues shares to outside investors, it should in theory strive to maximise profits in the long run. But since it is majority-owned by the Russian state, it pursues political goals, too.

In practice, it serves one master more assiduously than the other. As President Vladimir Putin consolidated his power in the early 2000s, he built Gazprom into a main instrument of Russia’s new state capitalism. He appointed allies to top positions. He used Gazprom as a tool of foreign policy, for example by cutting off gas supplies to Georgia, Ukraine, Belarus and Moldova during political rows. Gazprom’s deep pockets have helped Mr Putin at home, too. It sells gas cheaply in Russia, so that the poor do not freeze in winter. Oddly for an energy company, it has bought television stations and newspapers, all of which are now friendly to the Kremlin. Mikhail Krutikhin of RusEnergy, a consultancy, says, “Gazprom has one manager: Putin.” With friends in high places, Gazprom has enjoyed low taxes and privileged access to gasfields. But its costs are startlingly high. It treats its executives generously: a 2008 tender, for example, included a solarium and a special bath for horses. It buys supplies in an idiosyncratic fashion, too. The Peterson Institute for International Economics, a think-tank, reckons that although Gazprom posted nominal profits of $46 billion in 2011, it lost $40 billion to corruption and inefficiency. And some projects favoured by Mr Putin are of questionable economic value. For example, he is dead set on building a $21-billion South Stream pipeline between southern Russia and Austria via eastern Europe. This project has political appeal because it would bypass troublesome Ukraine as the main transit route for gas to Europe. But given weak prices and demand, it is “commercial idiocy”, says Mr Krutikhin. The opening in 2011 of Nord Stream, an offshore pipeline to Germany, was a diplomatic coup for Mr Putin, but it is still running far below capacity.

These days, Gazprom is finding itself in an unfamiliar situation: it has more problems and less money with which to drown them. On March 4th its shares hit a four-year low. Investors reckon Gazprom is worth only a third as much as it was in 2008. By one broker’s calculation its market capitalisation of $110 billion is barely half the value of its assets.

And this is where you’ll bring me a coffee

Of pipes and power

The central battleground for Gazprom is Europe, its traditional stronghold and the source of 40% of its revenues. Gazprom is fighting to preserve its old pricing system, whereby big European customers sign long-term contracts linked to the price of oil. But those customers now have the option of buying liquefied natural gas (LNG) that America no longer needs to import.

Gas on the spot market is often much cheaper than Russian gas delivered under long-term contracts. Norway’s Statoil, a nimbler state-controlled energy firm, has cut its prices and grabbed market share. Gazprom has slowly and reluctantly offered price cuts too, which it expects will cost it $4.7 billion this year. Citi, a bank, calculates that every drop in European gas prices of $1 per million British thermal units reduces Gazprom’s profit by $4 billion. Gazprom’s managers act as if this is a temporary inconvenience. They insist that the old system of oil indexation is here to stay.

Because so many of its customers are tied to contracts, the full effects of the global gas glut on Gazprom’s bottom line will not be felt straight away. But it is already cramping investment. Last August Gazprom and its partners, France’s Total and Norway’s Statoil, decided to freeze a colossal offshore project in the Barents Sea, which was intended to produce gas destined for export to America.

The final threat to Gazprom’s old way of doing business is legal. An antitrust probe launched by the European Commission alleges that Gazprom is using its dominant position in central and eastern Europe to restrict competition and hike prices. If it loses the case, it could face a fine of up to $14 billion and lose the mighty lever of being able to charge some European countries more than others.

An adverse ruling might also threaten its strategy of trying to dominate the European gas market by owning both the supplies and the means of distributing them. Gazprom has quietly bought gas pipelines and storage facilities. It has tried to strike deals whereby it lends money to impoverished European utilities in order to secure their custom. If this strategy stops working, Gazprom will no longer be such a potent foreign-policy tool for the Kremlin.

The Miller’s tale

For years, Gazprom’s bosses were in denial about threats to its business model. Alexey Miller (pictured), the chief executive, called the shale-gas boom a “myth”. Of late, however, Mr Putin appears to have woken up. He admitted last year that there has been a “real shale revolution” and said Russia must find “mutually acceptable forms of co-operation” with consumers.

Gazprom’s future may involve more robust competition even at home. Two domestic rivals have emerged: Novatek, a gas producer part owned by Gennady Timchenko, an old acquaintance of Mr Putin’s, and Rosneft, a state-owned oil firm led by Mr Putin’s trusted adviser, Igor Sechin. Put together, non-Gazprom firms now account for a quarter of all Russian gas production. The rise of Novatek and Rosneft do not suggest that the Kremlin “set out to create competition”, says Ms Volchkova, but rather that it decided not to block it, as it might have earlier.

Novatek, which is developing a vast gasfield in the Yamal peninsula with France’s Total, wants the Kremlin to revoke Gazprom’s export monopoly. No decision has been made yet, but the Kremlin could decide to loosen the monopoly by liberalising LNG exports while keeping Gazprom as the only exporter of piped gas.

In the short term, Gazprom’s troubles in Europe could protect it from its rivals at home. The Kremlin is likely to react defensively to pressure from hard-bargaining European customers and regulators. It may opt to shelter Gazprom at the expense of Novatek and others. But the overall message is clear: Gazprom cannot count on its gilded position lasting forever.

That means it must think about what sort of company it will be in the years to come. If things don’t go Gazprom’s way, it can still threaten to withhold supplies. It hopes to avoid such a scenario, says Sergei Komlev of Gazprom’s export division, but the company “has the right not to deliver gas if we don’t like the price.”

Act too much like a bully, however, and customers will shop around. Besides buying more LNG, some EU countries are keen to start fracking on their own territory. Exploratory drilling proceeds apace in eastern Europe, though fracking is still banned in France, Bulgaria and the Czech Republic.

Gazprom badly needs to find two things: new sources of gas, and new markets. Neither will be easy. Its gasfields are running down. The International Energy Agency, a rich-world energy club, reckons Russia’s gas producers must spend $730 billion by 2035 merely to replace most of their current production of 655 billion cubic metres a year. But much of Gazprom’s 35 trillion cubic metres of reserves are in barely accessible places such as the Yamal Peninsula, the Far East and Eastern Siberia. Gazprom will have to pay much more to get this gas out of the ground. Can it do that? The omens are not good.

In 2011 it invested $40 billion with little to show for it. Production has not grown since 2001. Meanwhile Gazprom is losing its technological edge. Some insiders predict that the company will be able to sell gas at high prices to Europe for long enough to raise the necessary cash to invest in developing new gasfields. That sounds optimistic. If the firm were better run, it would have found ways to move more gas to Asia, where prices are much higher than in Europe (let alone America).

One way would be to liquefy the gas and ship it. But Gazprom has been slow: despite pumping a sixth of the world’s gas, it has just a 20th of the LNG trade. A planned $7 billion LNG facility in Vladivostok will help, but Gazprom will need to invest billions to ramp up production.

The other way to get gas to Asia would be via pipeline. The obvious destination is China, which sits on Russia’s doorstep and is potentially the world’s biggest market for gas. The two countries have haggled unsuccessfully for a decade. In February they revealed they had agreed to everything related to pipeline exports apart from the price. China has signed up to import gas from Central Asia, Australia, the Middle East and west Africa; almost everywhere, in fact, except Russia. China refuses to pay Asian prices; Gazprom won’t budge.

Creating a more nimble, commercially minded Gazprom would require massive political will. The firm has traders around the world who could take advantage if Gazprom started producing lots of LNG. It has built-in advantages, like access to once-frozen Arctic routes for shipping LNG. It might even try to woo more investment from the world’s big oil firms, though they may prefer to invest in easier countries than Russia.

The rational approach, many analysts agree, would be to split Gazprom’s pipeline business from the production and sale of gas. This would ensure that economically senseless pipeline projects are not subsidised by exports. Beyond that, Gazprom would probably benefit from being split into a handful of separate gas producers which would then compete to extract and market smaller “corridor” gasfields close to existing ones or pipelines. These fields have plenty of gas but are too small for Gazprom to bother with. A bit of competition might help to control runaway costs.

Gazprom still has many advantages, from vast gas reserves to gas-hungry neighbours. But it has exploited them so ineptly that one analyst likens the firm to “a dinosaur on jet-powered rollerblades”. For now, only Mr Putin can change that. If he waits, soon neither he nor Gazprom will have much choice.