StableSwap Protocol

Cross-chain stablecoin swaps with guaranteed rates, settled via CCTP v2 or CCTP v1 + LayerZero. Swap USDC, USDT, and other stablecoins across Ethereum, Arbitrum, Base, Polygon, Avalanche, Optimism, Solana, Sui, and Aptos in about 20 seconds.

Non-custodialPermissionlessOn-chain guarantees

Supported chains

Ethereum, Arbitrum, Base, Polygon, Avalanche, Optimism, Solana, Sui, Aptos

Settlement

CCTP V2 or CCTP V1 + LayerZero V2

Speed

~20s end-to-end

DEXes

Uniswap V3/V4 + Curve (Ethereum) + Uniswap V3 (EVM) + Orca (Solana) + Cetus (Sui) + Hyperion (Aptos)

Key Design Choices

Dual messaging

CCTP v2 Hooks carry both USDC and swap instructions in a single message. On chains where CCTP v2 is not available, CCTP v1 bridges the USDC while LayerZero V2 carries the swap instructions (output token, min amount, recipient).

Stablecoins only

The protocol only supports stablecoins (USDC, USDT). This simplifies pricing, eliminates impermanent loss concerns, and allows tight slippage bounds — typically under 0.1% for stablecoin pairs.

API observes, solver executes

The API service watches source and destination chains with read-only clients and never trusts solver status reports. Solvers hold private keys and execute transactions but never custody user funds — CCTP V2 mints directly to the settlement contract.

Atomic fulfillment with fallback

The settlement contract enforces min_output on-chain. If the solver cannot meet the minimum, the transaction reverts. After 24 hours, the user can call withdraw_fallback() to reclaim USDC. No funds are ever locked permanently.

Example Flow: Ethereum to Solana

The diagram below shows a cross-chain swap where a user sends USDT on Ethereum and receives USDC on Solana.

EthereumSolanaUserEVM walletEvmGatewayUniswap V3USDT → USDCCCTP v2 Hooksburn + instructionsCircle CCTP v2single attestationSolverpermissionlessfulfillSolanaSettlementCCTP Claimmint USDCDeliverto user addressUSDC to User~20s end-to-end

Step 1 — User initiates swap on Ethereum

The user calls initiateOrder() on the Gateway contract. The Gateway internally routes through Uniswap V3 to swap USDT → USDC, then burns USDC via CCTP v2 Hooks. The Hooks message carries both the USDC transfer and the swap instructions (output token, minimum amount, recipient) in a single burn. The DEX call happens inside the Gateway transaction.

Step 2 — Cross-chain messaging

A single CCTP v2 message travels from Ethereum to Solana. Circle attests the burn in ~20s. Unlike the CCTP v1 + LayerZero path used for Sui/Aptos routes, CCTP v2 Hooks carry both the USDC transfer and the swap instructions in one attestation — no second messaging layer is needed.

Step 3 — Solver fulfills on Solana

The API detects the attestation and assigns the order to a solver. The solver calls fulfill_order() on the Settlement program, which claims CCTP USDC and delivers it directly to the user's Solana address. Since the output token is USDC, no destination DEX swap is needed. If a non-USDC output were requested, the Settlement program would route through Orca Whirlpool before delivering.

Step 4 — Fallback (24h)

If no solver fulfills the order within 24 hours, the user (or anyone) can call withdraw_fallback() to return the claimed USDC to the user's address on the destination chain.

More Documentation