Skip to main content

FXSwap

FXSwap is Curve's two-asset automated market maker (AMM) for markets whose primary price discovery happens elsewhere. It is designed to keep passive liquidity concentrated around a moving external market price, from fiat FX pairs to markets such as BTC/USD.

It combines:

  • StableSwap-style concentration around a variable price_scale;
  • an exponential moving-average oracle that guides gradual recentering;
  • refuels, finite external liquidity buffers that help pay for recentering and are depleted as the pool uses them;
  • passive, full-range LP positions and the familiar Curve swap interface.

The distinguishing question is not volatility alone. FXSwap fits a market when the paired assets have reliable external price discovery, arbitrage can connect the pool to that market, and the pool can sustain the cost of moving concentrated liquidity as prices change.

Contract Source & Deployment

This section documents callable Ethereum pools reporting version() == "v2.1.0d". The verified pool source was compiled with Vyper 0.4.3 and is closest to curvefi/twocrypto-ng@387fbe5.

Review the FXSwap Pool for the exact source boundary and Contract Deployments for addresses.

Names used in this documentation

FXSwap is the product and pool family. A refuel is liquidity added to the pool's finite rebalancing buffer. Refuel shares unlock over time and are burned as the pool uses them to recenter liquidity. The deployed Vyper interface predates this product name and uses donation_*, the Donation event, and a donation flag. Use refuel in product-facing language and the deployed names only when referring to code.

Where FXSwap fits

MarketPreferWhy
Assets expected to stay near a fixed ratioStableswap-NGConcentration around a fixed or rate-provider-adjusted peg
Two volatile assets where the Curve pool supports primary price discoveryTwocrypto-NGCryptoSwap invariant and self-funded recentering
Two externally priced assets that need passive concentrated liquidityFXSwapVariable-price StableSwap concentration and a configurable recentering budget

FXSwap is not a general replacement for CryptoSwap. A pair is a poor fit when it lacks a reliable external reference market, arbitrage cannot keep the pool connected to that market, or no sustainable budget exists for the desired concentration and recentering frequency.

How the mechanism fits together

Swaps use a StableSwap invariant centered on price_scale. The pool records recent prices in an exponential moving-average oracle. When the oracle moves far enough from price_scale, a state-changing pool operation can recenter liquidity toward it.

Recentering has a cost. FXSwap first burns refuel shares that have unlocked and passed the protection rules. If those shares are insufficient, the normal profit buffer provides the remainder. Regular LP balances are not burned.

gamma() remains in the deployed ABI for interface compatibility, but the FXSwap invariant does not use it. Read Mechanism and Parameter Design for the interactions between concentration, fees, oracle smoothing, refuel budgets, and external market depth.

Find what you need

FXSwap documentation covers the work of market operators and capital managers, trade-execution integrators, protocol builders, and researchers or infrastructure providers. The pages are organized by task so teams with overlapping responsibilities share the same source of truth.

If you need to…Start with
Quote or execute swapsIntegrating Swaps
Search for arbitrage opportunitiesSearcher and arbitrage considerations
Build a vault, strategy, or protocolBuilding on FXSwap
Understand recentering and parametersMechanism & Parameters
Interpret pool prices and oracle stateOracles
Fund the recentering bufferRefuels
Schedule recurring refuelsAutomation
Inspect the deployed interfaceFXSwap Pool

FXSwap infrastructure

FXSwap Pool

The two-coin AMM, LP token, oracle, fee logic, recentering state, and refuel accounting are exposed through one pool contract.

FXSwap Pool
Factory & Discovery

FXSwap pools were deployed through shared two-coin factory infrastructure. Integrators must identify and allowlist the deployed pool version explicitly.

Identify FXSwap Pools
Price Oracles

The pool's observed price, exponential moving average, and moving liquidity center.

FXSwap Oracles
Views Contract

Quote swaps and liquidity operations, estimate input requirements, and inspect fee components.

TwocryptoView.vy
Math Contract

The StableSwap-style invariant and EMA math used by the deployed FXSwap pool.

StableswapMath.vy
Refuel Automation

Permissionless automation contracts can schedule recurring refuels and reward executors that submit due periods.

Automation Overview

Factory and pool discovery

The documented Ethereum pools were deployed through factory 0x98EE…AF7F. The pool exposes this address through factory().

The shared factory can enumerate pools and coin pairs, but its current implementation slots do not prove which historical implementation deployed a pool. A production integration should:

  1. discover candidate addresses from Curve's deployment references, API, or registry;
  2. verify factory(), version(), coins(0), and coins(1);
  3. allowlist the exact pool runtime code or a verified implementation version; and
  4. read VIEW() and MATH() from that pool.

The factory's find_pool_for_coins result is not a best-route guarantee, and sharing a factory does not make a pool FXSwap. The Twocrypto-NG factory reference is optional reading for the shared factory's complete administrative and deployment API; nothing in the FXSwap integration path requires it.

Representative deployed pools

PoolAddressCoins
YieldBasis WBTC0xD9FF…8373crvUSD / WBTC
YieldBasis cbBTC0x83f2…Eb32crvUSD / cbBTC
YieldBasis tBTC0xf1F4…6127crvUSD / tBTC
ZCHF0x027B…2ca9crvUSD / ZCHF

Pool parameters are mutable. Read the target pool rather than copying values from an example.

Deployed and future interfaces

The deployed v2.1.0d pools use set_donation_duration and set_donation_protection_params. Later development designs add policy, allowlist, and set_donation_parameters interfaces that are not callable on the pools documented here. Treat a future version as a separate implementation until its deployed bytecode and ABI are verified.

Evidence and further reading

  • FXSwap summarizes a dated execution-quality study and explains the passive-liquidity design.
  • FXSwap Simulations: Behind the Scenes explains the historical backtesting and parameter-search workflow, including its limitations.
  • Understanding FXSwap provides a protocol-level explanation and interactive parameter charts.