Tern is a unified swap protocol for executing token swaps across chains through a single API. Request a quote, make one deposit, and receive the tokens you requested on your destination chain. Tern coordinates execution across chains, with every swap designed to either complete or refund.

Designed for reliable execution

Swaps shouldn’t leave users wondering where their funds went. Tern is built around three core guarantees.
  • Atomic cross-chain swaps. Both sides of a cross-chain swap are linked by the same cryptographic secret. Either the user receives their destination tokens, or their original deposit is refunded.
  • Non-custodial by design. Tern’s contracts have no owner, pause, or upgrade mechanism. Funds follow predefined contract rules, not discretionary operator actions.
  • Guaranteed minimum output. Every quote specifies a minimum amount the user will receive. If execution cannot satisfy that amount, the swap reverts, or the deposit is refunded.

What you can build

Cross-chain swaps

Swap any supported token on one chain for a token on another. Tern coordinates the execution across both chains.

Same-chain swaps

Exchange one token for another on the same chain through a single transaction.

Private swaps

Swap from a shielded balance on Starknet without exposing the user’s account in the transaction.
Users can fund cross-chain swaps directly from their wallets or send tokens to a deposit address, including from centralized exchanges. Explore supported chains to see where Tern is currently available.

Start building

Quickstart

Get your first swap running in minutes. Request a quote, submit a deposit, and track execution. No API key required.

How Tern works

Understand the lifecycle of a swap, from quote generation and deposit detection to execution, settlement, and refunds.