FxSwap

FXSwap onboards institutional liquidity to bring real FX pricing to stablecoin swaps

FxSwap

Created At

ETHOnline 2025

Project Description

FXSwap is an FX-aligned stablecoin exchange protocol that bridges traditional foreign exchange pricing with on-chain stablecoin liquidity. Instead of relying solely on AMM pool curves where prices drift with liquidity depth and can diverge from real-world FX, FXSwap brings institutional-grade pricing directly on-chain. Institutions, treasuries, and companies can onboard as “brokers,” quote at their own rates, and provide liquidity from self-custodied wallets (e.g. Safe), while traders, apps, wallets, and payment platforms can tap into this liquidity.

How it's Made

I chose Safe as the broker’s custody, as they are deemed an institutional-grade storage solution. Hence, I utilised Safe's module so that brokers can store their funds in their safe while providing liquidity. Safe module facilitates that the broker receives and releases the correct amount of tokens according to a signed rate by the broker. The signature is an EIP712 signature, which is generated by the Safe's owners.

To keep pricing grounded in reality while preserving broker discretion, I plan to integrate PYTH as an on-chain reference. The module will read the relevant token pair and enforce a configurable tolerance band: if a broker’s fxRate deviates beyond that band or the oracle is stale, the transaction reverts. This prevents “ridiculous” or stale quotes, and gives integrators and institutions a safety net in case of a hacked signed quote.

On the client side, a TypeScript SDK (built on viem) abstracts the nitty‑gritty: fetching quotes, performing ERC‑20 approvals, and submitting the swap.

For a deeper look at the overall architecture, see the README of the primary repository brandonchuah/fxswap-backend

background image mobile

Join the mailing list

Get the latest news and updates