By Angus McDowall

RIYADH, Feb 4 (Reuters) - A devaluation of Saudi Arabia's currency could cause such political instability that Riyadh has little choice but to stick to its promise to use vast foreign exchange reserves to defend the riyal's 30-year-old peg to the U.S. dollar.

Currency traders have been betting against the Saudi peg, and those of other regional oil producers, in the wake of oil's price collapse. Societe Generale said on Thursday it saw at least a 25 percent chance of a near-term devaluation or 40 percent if oil prices stay at current levels throughout 2016.

But in Saudi Arabia's largely dollar-denominated economy breaking the peg would immediately raise the price of goods, hitting living standards.

Combined with other pending painful economic reforms, this could lead to unrest in a country where the unwritten social contract swaps citizens' obedience and allegiance to the king for good government services and a share in oil wealth.

"Devaluation of the currency or depegging would self-inflict destructive economic pain. It would be catastrophic," said John Sfakianakis, a Riyadh-based economist.

Some diplomats living in Saudi Arabia say privately that a break in the peg is the single biggest political risk facing a country already embroiled in a war in Yemen and suffering periodic deadly attacks by militants.

The biggest Arab economy has only a small manufacturing base and almost all goods come as dollar-priced imports, so a cheaper riyal would instantly make normal Saudis feel poorer without providing any benefit to the wide economy via cheaper exports.

INSULATED

Saudi citizens have so far been mostly insulated from the impact of lower oil prices. The cost of fuel is cheap, even after a 50 percent rise in petrol prices, and the cuts in spending have yet to be felt in employment.

But change is coming. Riyadh promised in its 2016 budget statement to slow increases in the state payroll, meaning few new government jobs, and as Saudi private sector growth closely tracks government spending, this means few private sector jobs.

Threats to the economic basis for the Al Saud dynasty's legitimacy could barely come at a worse time. It is going through a prolonged and delicate shift to a new generation of rulers after six decades of rule by a line of brothers.

Riyadh's overarching regional rivalry with Iran has pushed Saudi Arabia into a war in Yemen that has cost the lives of 375 of its own citizens, while attacks by jihadists, including a mosque bombing last week, have killed dozens inside the kingdom.

The impact of a sudden rise in living costs and a collapse in purchasing power in such circumstances from a devaluation could be explosive.

"Especially at this time, because of the difficult reforms coming down the road, it would be very hard to sell to the public," said Jamal Khashoggi, head of al-Arab news channel.

ASSET CUSHION

The Saudi Arabian Monetary Agency (SAMA), the central bank, has vowed to maintain the peg of 3.75 riyals to the dollar come what may. With access to $609 billion of foreign exchange reserves built up during years of higher oil prices, it has a way to go until these are exhausted.

"We think the high level of reserves allows the Saudi Arabian Monetary Agency (SAMA) to maintain the current exchange rate regime for the time being," UBS research said.

"However, challenges are significant, since fiscal buffers might be exhausted within five to six years without any adjustments."

One-year dollar/riyal forwards SAR1Y= - contracts used by counterparties to lock in a future exchange rate - were around 550 points on Thursday, well down from the record 1000 points earlier this year as some banks and funds hedged against the risk that Rihadh would scrap the peg.

The previous record was 850 points hit during a bout of speculation against the riyal in 1999.

Still, some Saudis say friends or colleagues have started to transfer cash overseas - a sign of fears about the riyal's resilience.

Absent an agreement with a wide array of other oil producers to rein in output, Saudi Arabia appears set to continue its strategy of defending its share of the crude export market, meaning energy prices are likely to stay low.

Societe Generale's report said that unlike in past periods of stress, when Riyadh maintained its currency peg despite low oil prices, it was this time running far higher fiscal deficits in an energy market that had less room to recover.

"The probability of the pegs failing is one of ability and willingness to defend the regime at all costs. The market is testing the authorities' willingness, and rightfully so," the French bank said in a note.

(Additional reporting by Sujata Rao; Editing by Anna Willard) ((angus.mcdowall@thomsonreuters.com; Reuters Messaging: angus.mcdowall.thomsonreuters.com@reuters.net))

Keywords: SAUDI RIYAL/