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.
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.
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
| Market | Prefer | Why |
|---|---|---|
| Assets expected to stay near a fixed ratio | Stableswap-NG | Concentration around a fixed or rate-provider-adjusted peg |
| Two volatile assets where the Curve pool supports primary price discovery | Twocrypto-NG | CryptoSwap invariant and self-funded recentering |
| Two externally priced assets that need passive concentrated liquidity | FXSwap | Variable-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 swaps | Integrating Swaps |
| Search for arbitrage opportunities | Searcher and arbitrage considerations |
| Build a vault, strategy, or protocol | Building on FXSwap |
| Understand recentering and parameters | Mechanism & Parameters |
| Interpret pool prices and oracle state | Oracles |
| Fund the recentering buffer | Refuels |
| Schedule recurring refuels | Automation |
| Inspect the deployed interface | FXSwap Pool |
FXSwap infrastructure
FXSwap PoolThe two-coin AMM, LP token, oracle, fee logic, recentering state, and refuel accounting are exposed through one pool contract.
Factory & DiscoveryFXSwap pools were deployed through shared two-coin factory infrastructure. Integrators must identify and allowlist the deployed pool version explicitly.
Price OraclesThe pool's observed price, exponential moving average, and moving liquidity center.
Views ContractQuote swaps and liquidity operations, estimate input requirements, and inspect fee components.
Math ContractThe StableSwap-style invariant and EMA math used by the deployed FXSwap pool.
Refuel AutomationPermissionless automation contracts can schedule recurring refuels and reward executors that submit due periods.
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:
- discover candidate addresses from Curve's deployment references, API, or registry;
- verify
factory(),version(),coins(0), andcoins(1); - allowlist the exact pool runtime code or a verified implementation version; and
- read
VIEW()andMATH()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
| Pool | Address | Coins |
|---|---|---|
| YieldBasis WBTC | 0xD9FF…8373 | crvUSD / WBTC |
| YieldBasis cbBTC | 0x83f2…Eb32 | crvUSD / cbBTC |
| YieldBasis tBTC | 0xf1F4…6127 | crvUSD / tBTC |
| ZCHF | 0x027B…2ca9 | crvUSD / ZCHF |
Pool parameters are mutable. Read the target pool rather than copying values from an example.
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.