Skip to main content
The API lives at https://swap-api.sodae.io. No account or API key is needed today. See API overview for conventions.
1

Get a quote

Amounts are in the token’s base units. 1 SOL is 1000000000 lamports. Common tokens accept a symbol in place of the mint address.
out_atoms is the expected output. min_out_atoms is the floor the transaction enforces after slippage.
2

Build the swap

Send the same parameters plus the wallet that will sign. The response holds a base64 transaction for that wallet.
3

Sign and send

Decode the transaction, sign it with the wallet named in user_wallet and send it to any RPC. Confirm it with recent_blockhash and last_valid_block_height.
The transaction uses Solana transaction format v1. @solana/web3.js 1.x cannot decode it. See Transaction format.

Next steps

TypeScript guide

A complete quote, swap, sign and send flow.

Streaming quotes

Keep a price fresh without polling.

Errors

What no_route and price_impact_too_high mean.