Skip to main content
The first wave of stablecoins was dollar-only. The next is multi-currency. Circle’s Arc ships with Circle StableFX, an institutional-grade on-chain FX engine - RFQ price discovery and 24/7 payment-versus-payment settlement across USDC, EURC, and regional partner stablecoins. On-chain FX gives a treasury something it has never had: every quote and every fill, for every currency pair, as a queryable event stream. This guide turns that stream into FX analytics, a published rate oracle, and exposure controls.

What you’ll build

Step 1: Index quotes and settlements

StableFX settlements are onchain events. Decode them from Arc’s raw_logs with the StableFX ABI, extracting the currency pair, the amounts on each leg, and the counterparties.
stablefx-settlements.yaml
StableFX is new, and its published interface is the source of truth for event names and field order. Fetch the ABI with _gs_fetch_abi and confirm the Settlement event signature and event_params positions against Circle’s StableFX contracts before relying on the extraction above.

Step 2: Compute FX analytics

With settlements in your warehouse, the desk’s core metrics are SQL:
From the same table you get corridor flows (net USD→EUR movement), realized spread versus a reference rate, and maker/taker league tables. Maintain a live last-rate per pair with the PostgreSQL aggregate sink.

Step 3: Publish an FX rate oracle

Other contracts and apps need the rate you just computed. A scheduled Compose task reads the VWAP and publishes it on-chain - the same mechanism as the NAV oracle, pointed at an FX pair.
src/tasks/publish-fx-rate.ts

Step 4: Monitor exposure and enforce limits

FX desks live and die by position limits. Because you have every fill, net exposure per currency is a running sum - and a Compose task can watch it and act (alert, hedge, or halt quoting) when a limit is breached. Compose’s durable execution guarantees the control fires, and every decision is traced for the desk’s risk review - a live version of the circuit-breaker pattern.

Business outcomes

  • Every quote and fill is data - true VWAP, realized spreads, and corridor flows, not a dealer’s end-of-day summary.
  • Multi-currency treasury - real-time positions across USD, EUR, and regional stablecoins in one warehouse.
  • A rate you can publish and defend - on-chain FX oracle sourced from actual settlements, with an audit trail.
  • Automated limit enforcement - exposure breaches trigger controls in seconds.

Resources

Can’t find what you’re looking for? Reach out to us at support@goldsky.com for help.