Skip to main content
This page has been updated for Wallets SDK V1. If you are using the previous version, see the previous version of this page or the V1 migration guide.

Prerequisites

  • Ensure you have a wallet created.
  • API Key: Ensure you have an API key with the scopes: wallets:transactions.create.

Swap Tokens

This guide explains how to swap tokens in Solana using the Jupiter advanced routing engine, which requires special configuration to work with smart wallets. If you’re using EVM chains, you can use 0x or 1inch directly. To perform a swap with the Jupiter Swap API and Crossmint wallets, follow these steps:
  1. Request a quote from the Jupiter API.
  2. Build the swap transaction for that quote using the Jupiter API.
  3. Send the transaction using the Crossmint wallet.
For tokens with lower liquidity, the number of hops required to reach the destination token may be higher. This can make the transaction size larger and increase the risk of failure. To minimize this risk, always set maxAccounts=33 when building the swap transaction. This ensures that even multi-hop swaps fit within Solana’s transaction account limits and execute reliably.
See the React SDK reference for more details.