Takaisin blogiin

Fixed vs Floating Exchange Rates: A Developer's Guide to Currency Regimes (2026)

V
Vlado Grigirov
May 03, 2026
Exchange Rates Currency API Forex Education Developer Guide Finexly

Fixed vs Floating Exchange Rates: A Developer's Guide to Currency Regimes (2026)

If you've ever queried a currency API and noticed that USD/HKD barely moves while USD/JPY swings 200 pips before lunch, you've already met the difference between fixed and floating exchange rates in the wild. The two regimes look identical from the outside — both return a number from the same JSON response — but they behave radically differently, and the apps you build on top of them need to know the difference.

This guide explains fixed vs floating exchange rates from a developer's point of view. We'll cover how each regime works, which currencies sit in each camp in 2026, how to detect a regime programmatically using a currency API, and how to write code that doesn't fall over the moment a peg breaks. By the end you'll know exactly what to expect from every rate your app touches — and what defensive code to ship before you find out the hard way.

What Is a Fixed Exchange Rate?

A fixed exchange rate (also called a pegged exchange rate) is one where a country's central bank deliberately holds the value of its currency at a target level against another currency, a basket of currencies, or — historically — a commodity like gold.

The peg is enforced through one of two mechanisms:

  1. Active intervention — the central bank buys or sells its own currency in the open market using foreign exchange reserves whenever the rate drifts away from the target.
  2. Currency board — the domestic currency is fully backed by reserves of the anchor currency at a fixed ratio. Every unit issued is matched 1-to-1 (or at the pegged ratio) by reserves on the central bank's balance sheet.

The Hong Kong dollar, for example, has been pegged to the US dollar at roughly HKD 7.80 = USD 1.00 since 1983 under a currency board. The Saudi riyal has held at SAR 3.75 = USD 1.00 since 1986. Both are textbook hard pegs.

Hard Pegs, Soft Pegs, and Crawling Pegs

Not all fixed regimes are created equal. The IMF classifies pegs along a spectrum:

  • Hard peg — fully fixed at a single rate, defended without exception (HKD, SAR, AED, BHD).
  • Conventional peg — fixed at a target rate within a narrow band (typically ±1%), with central bank intervention to hold it (DKK to EUR, JOD, OMR).
  • Crawling peg — the target rate moves on a pre-announced schedule, usually to manage inflation differentials (historically used by Vietnam and several Latin American countries).
  • Stabilized arrangement — the rate stays inside a narrow band for at least six months even though no peg is officially declared (the IMF de-facto category).

For developers this matters because the volatility profile of each regime is different — a hard peg moves by basis points, a crawling peg moves by a known amount per day, and a stabilized arrangement can change classification at any time.

What Is a Floating Exchange Rate?

A floating exchange rate is set by the foreign exchange market — supply and demand from traders, importers, exporters, central banks, hedgers, and speculators all push the price around in real time. There is no target rate and no intervention obligation.

Most major currencies float: USD, EUR, GBP, JPY, AUD, CAD, NZD, CHF, NOK, SEK, MXN, BRL, ZAR, and most other freely-traded units. Together they account for the vast majority of the roughly $7.5 trillion in daily FX turnover the BIS reported in its 2022 Triennial Survey — and that share has only grown since.

Pure Floats vs Managed Floats

In practice, "floating" exists on a continuum:

  • Free float / pure float — the central bank does not intervene at all. The currency goes where the market takes it. The US dollar, euro, and Australian dollar are textbook free floats.
  • Managed float (dirty float) — the central bank intervenes occasionally to dampen excess volatility or push back against one-way moves, but does not defend any specific level. The Japanese yen is a famous managed float; the Bank of Japan has stepped in publicly during 2022, 2024, and again in early 2026 when USD/JPY breached psychologically important levels.

From a developer perspective, the line between managed float and stabilized arrangement is fuzzy, and currencies can drift across it. That's why you should never hard-code assumptions about how much a currency "should" move.

Why This Matters for Developers

It's tempting to treat all exchange rates as a single problem: hit an endpoint, get a number, multiply, ship. But the regime behind a quote determines almost everything that matters for production code:

  • Update frequency you actually need. A pegged currency rarely needs sub-second polling. A floating major might.
  • How wide your tolerances should be. A 1% move in HKD/USD is news; a 1% move in EUR/USD is Tuesday.
  • What "stale data" means. A spot quote from 30 minutes ago is fine for SAR/USD invoicing; it's dangerous for live JPY trading.
  • How to handle outliers. A spike in HKD outside the trading band might be a real peg break, or it might be a bad data point. Floats need different anomaly logic.
  • Whether you need forward rates at all. Forward and spot rates for hard pegs converge tightly via interest rate parity; for floats they diverge.

Building one volatility model for every currency in your app is the single most common mistake we see in code reviews. The IMF currently classifies roughly 80 economies as having some form of fixed or stabilized arrangement, and 65 as floating or freely floating. Your code should know which is which.

Major Pegged Currencies in 2026

Here's a working reference list of the most actively pegged currencies your app is likely to see, current as of the IMF's most recent Annual Report on Exchange Arrangements:

CurrencyCodePegged ToApprox. RateRegime Type
Hong Kong DollarHKDUSD7.80 (band 7.75–7.85)Currency board
Saudi RiyalSARUSD3.75Conventional peg
UAE DirhamAEDUSD3.6725Conventional peg
Bahraini DinarBHDUSD0.376Conventional peg
Qatari RiyalQARUSD3.64Conventional peg
Omani RialOMRUSD0.385Conventional peg
Jordanian DinarJODUSD0.709Conventional peg
Lebanese PoundLBPUSD (de jure)unstableCrisis regime
Danish KroneDKKEUR7.46 (ERM II ±2.25%)Conventional peg
Bulgarian LevBGNEUR1.9558Currency board
West African CFA francXOFEUR655.957Conventional peg
Central African CFA francXAFEUR655.957Conventional peg
Comorian FrancKMFEUR491.968Conventional peg
CFP FrancXPFEUR119.3317Conventional peg
A few takeaways from this table that show up in real code:

  • The Gulf bloc is effectively one currency (USD) wearing six different ISO codes.
  • The euro-anchored bloc is larger than most developers expect — DKK, BGN, the CFA francs, and several others move as if they were euros.
  • One peg in this table is broken. The Lebanese pound has a de jure peg but trades at multiples of it on the parallel market; never trust the official rate alone.

Major Floating Currencies in 2026

For comparison, the floating side of the world includes everything you'd expect plus a long tail of emerging-market currencies:

  • G10 majors: USD, EUR, JPY, GBP, CHF, AUD, CAD, NZD, NOK, SEK
  • Active emerging-market floats: MXN, BRL, ZAR, INR, IDR, KRW, TWD, TRY, PLN, HUF, CZK, ILS, CLP, COP, PEN, THB, PHP, MYR
  • Commodity-linked floats: AUD, CAD, NZD, NOK, BRL, ZAR — these correlate strongly with oil and commodity prices.

If you're querying any of these via the Finexly API, expect them to move every second the relevant market is open. Polling intervals, caching, and error handling should be tuned accordingly.

Detecting Currency Regimes Programmatically

You don't need to maintain the regime list by hand — you can derive a reasonable approximation from the data itself. Here's a small Python utility that classifies a currency pair by 30-day realized volatility using the Finexly historical endpoint:

import os
import statistics
from datetime import date, timedelta
import requests

API_KEY = os.environ["FINEXLY_API_KEY"]
BASE = "https://api.finexly.com/v1"

def regime(base: str, quote: str, days: int = 30) -> dict:
    end = date.today()
    start = end - timedelta(days=days)
    url = f"{BASE}/timeseries"
    params = {
        "base": base,
        "symbols": quote,
        "start_date": start.isoformat(),
        "end_date": end.isoformat(),
        "api_key": API_KEY,
    }
    rates = requests.get(url, params=params, timeout=10).json()["rates"]
    series = [day[quote] for day in rates.values()]
    returns = [
        (series[i] / series[i - 1]) - 1
        for i in range(1, len(series))
    ]
    vol = statistics.pstdev(returns) * (252 ** 0.5)  # annualized
    if vol < 0.005:
        label = "hard peg"
    elif vol < 0.02:
        label = "soft peg / stabilized"
    elif vol < 0.10:
        label = "managed float"
    else:
        label = "free float"
    return {"pair": f"{base}/{quote}", "annual_vol": round(vol, 4), "regime": label}

for pair in [("USD", "HKD"), ("USD", "SAR"), ("EUR", "DKK"),
             ("USD", "JPY"), ("USD", "TRY"), ("EUR", "USD")]:
    print(regime(*pair))

A typical run produces output like:

{'pair': 'USD/HKD', 'annual_vol': 0.0021, 'regime': 'hard peg'}
{'pair': 'USD/SAR', 'annual_vol': 0.0008, 'regime': 'hard peg'}
{'pair': 'EUR/DKK', 'annual_vol': 0.0009, 'regime': 'hard peg'}
{'pair': 'USD/JPY', 'annual_vol': 0.0918, 'regime': 'managed float'}
{'pair': 'USD/TRY', 'annual_vol': 0.2771, 'regime': 'free float'}
{'pair': 'EUR/USD', 'annual_vol': 0.0734, 'regime': 'managed float'}

The thresholds above are pragmatic, not academic — adjust them to your tolerance. The key idea is that realized volatility, not declarations, is what your code should react to.

A quick cURL equivalent for one-off checks:

curl "https://api.finexly.com/v1/timeseries?base=USD&symbols=HKD&start_date=2026-04-01&end_date=2026-05-01&api_key=$FINEXLY_API_KEY"

And the same idea in JavaScript for browser dashboards:

async function realizedVol(base, quote) {
  const end = new Date().toISOString().slice(0, 10);
  const start = new Date(Date.now() - 30 * 86400e3).toISOString().slice(0, 10);
  const url = `https://api.finexly.com/v1/timeseries?base=${base}&symbols=${quote}&start_date=${start}&end_date=${end}&api_key=${process.env.FINEXLY_API_KEY}`;
  const data = await fetch(url).then(r => r.json());
  const series = Object.values(data.rates).map(d => d[quote]);
  const rets = series.slice(1).map((v, i) => v / series[i] - 1);
  const mean = rets.reduce((a, b) => a + b, 0) / rets.length;
  const variance = rets.reduce((a, b) => a + (b - mean) ** 2, 0) / rets.length;
  return Math.sqrt(variance) * Math.sqrt(252);
}

console.log(await realizedVol("USD", "HKD"));
console.log(await realizedVol("USD", "JPY"));

Handling Peg Breaks: When a "Stable" Currency Suddenly Isn't

The dangerous failure mode for developers isn't a slow drift — it's a sudden break. History is littered with examples:

  • Switzerland, January 2015 — the Swiss National Bank abandoned the EUR/CHF 1.20 floor without warning, and the franc surged roughly 30% in minutes. Multiple FX brokers went insolvent.
  • Argentina, December 2023 — the official peso peg was sharply devalued; apps using only the official rate produced wildly wrong results for users transacting at the parallel rate.
  • Egypt, March 2024 — the EGP was effectively floated overnight after a long managed devaluation, doubling the USD/EGP rate within a day.

A robust integration treats every "fixed" rate as fixed until proven otherwise. Two defensive patterns are worth shipping by default:

  1. Sanity bounds with circuit breakers. Cache an expected rate band per pair; if the live quote falls outside the band, refuse the conversion and surface an alert instead of pricing at the bad rate.
  2. Multi-source corroboration. For business-critical conversions, compare the rate from your primary provider against an independent reference. Disagreement means something is wrong — at the source, in the cache, or in the world.

A minimal sanity-check wrapper in Python:

EXPECTED = {
    ("USD", "HKD"): (7.75, 7.85),
    ("USD", "SAR"): (3.74, 3.76),
    ("EUR", "DKK"): (7.43, 7.49),
}

def safe_rate(base, quote, live_rate):
    band = EXPECTED.get((base, quote))
    if band and not (band[0] <= live_rate <= band[1]):
        raise ValueError(
            f"{base}/{quote} = {live_rate} outside expected band {band}; "
            "possible peg break or bad data — alert ops before pricing."
        )
    return live_rate

This is exactly the kind of code that prevents a Tuesday-morning incident report from turning into a Tuesday-afternoon refund cycle.

Building Apps That Survive Both Regimes

Here's a checklist we recommend to teams shipping multi-currency products in 2026:

  • Tag every supported currency with its regime (hard peg, conventional peg, managed float, free float) at build time, and treat the tag as a feature flag for caching, alerting, and UI.
  • Set per-regime cache TTLs. A 24-hour cache is fine for a hard peg; a 30-second cache is more appropriate for a major float and a WebSocket feed is better still for trading apps.
  • Surface the regime to users when relevant. "Pegged to USD — typically stable" reassures international shoppers; "Volatile — rate updates frequently" sets expectations correctly for emerging-market checkouts.
  • Test peg-break scenarios in staging. Inject a synthetic 5% move in a pegged pair and verify your circuit breakers fire.
  • Subscribe to central bank calendars. The Hong Kong Monetary Authority, Saudi Central Bank, and Banque Centrale des États de l'Afrique de l'Ouest publish policy meetings; major peg changes are rare but never out of the blue forever.
  • Use a provider with full coverage. Finexly tracks all 170+ currencies including every major peg, plus IMF reference rates and parallel-market data where it exists. See pricing plans for free and paid tiers, or compare currency APIs if you're evaluating alternatives.

Frequently Asked Questions

What is the difference between a fixed and floating exchange rate?

A fixed exchange rate is held by a central bank at a target value against another currency or basket, usually through reserves and intervention. A floating exchange rate is set by market supply and demand with little or no intervention. Fixed rates are more stable; floating rates are more responsive to economic conditions.

Which is better, a fixed or floating exchange rate?

There is no universally better regime — it's a trade-off. Fixed rates give predictability for trade and inflation expectations but require deep reserves and constrain monetary policy. Floating rates let central banks respond to domestic conditions but introduce FX volatility for businesses and consumers. Most large open economies float; small open economies and oil exporters often peg.

Does the United States have a fixed or floating exchange rate?

The US dollar floats freely. The Federal Reserve does not target a USD level against any other currency. However, because so many other currencies are pegged to the dollar, the USD acts as the de facto anchor for a meaningful share of the global currency system.

What happens when a peg breaks?

A peg break — a sudden, large move in a currency previously held to a target — can devalue or revalue the currency by 10%, 30%, or more in hours. Apps that don't validate quotes against expected bands can mis-price transactions, settle at the wrong rate, or display nonsense numbers to users. Always implement sanity checks for pegged pairs.

How can I tell if a currency is pegged using only data?

Compute the realized volatility of the pair against its anchor over the past month. Hard pegs typically annualize below 0.5%; floats annualize above 5–10%. The Python and JavaScript snippets earlier in this article show one practical implementation. Combine that with the IMF's published classification for ground truth.

Get Started with Finexly

Ready to integrate real-time exchange rates that work consistently across pegged and floating currencies? Get your free Finexly API key — no credit card required. You'll get 1,000 requests per month on the free plan, full access to all 170+ currencies including every major peg, and the same JSON shape whether you're querying HKD or TRY. Build once, handle every regime.

Vlado Grigirov

Senior Currency Markets Analyst & Financial Strategist

Vlado Grigirov is a senior currency markets analyst and financial strategist with over 14 years of experience in foreign exchange markets, cross-border finance, and currency risk management. He has wo...

View full profile →