Skip to content

Swap tokens

Choose an input or output amount, set meaningful limits, and verify what your trade actually settled.

A swap exchanges one pool asset for the other. Before starting, confirm your wallet and token balances, identify the pool, and read any hook rules that apply to your wallet.

1. Choose the amount you want to control

ExactIn starts with an input budget and a minimum acceptable output. ExactOut starts with the output you require and a maximum acceptable input. Use the mode that matches your intent, then review both sides of the estimate.

An ExactIn operation can leave input unspent when a price limit is reached, provided its output requirements are still met. Do not assume that every successful ExactIn trade spends the entire displayed budget. ExactOut must satisfy its requested output while respecting its input cap.

2. Read the estimate and costs

Check expected input, net output, price impact, trading fees, and any hook output fee. Network and priority fees are separate SOL costs. Creating a missing token account may also require a SOL deposit.

Price impact comes from your own trade moving through available liquidity. Slippage tolerance covers permitted movement between the estimate and execution. Increasing tolerance does not create more liquidity or improve the quoted price.

For illustration, an estimated net receipt of 100 tokens with a 1% tolerance corresponds to a 99-token minimum before any required atom rounding. This is an explanation of the limit, not a suggested setting. The integration must apply its limits to the actual settlement semantics, including permitted fees.

3. Review the transaction

Confirm the two mints, pool, recipient accounts, input maximum or budget, output requirement, and price boundary. A hook may require proof or reject a wallet; accepting a larger slippage tolerance does not satisfy that policy.

Sign only after the review describes the operation you intended. Simulation can reveal a current failure, but conditions may change before the transaction lands.

4. Confirm and reconcile

Keep the signature and wait for the result. Check the actual debited and credited token amounts, network fee, and any unspent input. Account creation and unrelated wallet activity can make a single total-balance change misleading; the transaction receipt is the starting point.

If the transaction fails, its state changes roll back, although an on-chain failure can still cost a network fee. If its status is unknown, check the original signature before submitting a replacement. See troubleshooting.

When a swap cannot complete

A stale estimate, insufficient active liquidity, a strict price boundary, an expired blockhash, insufficient SOL, or a hook rejection can stop a trade. Review the specific reason and obtain a fresh estimate. Removing every limit or repeatedly resubmitting the same intent is not a reliable recovery method.

For fee details, continue to fees and account deposits. Developers can use the swap integration guide.