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:- Request a quote from the Jupiter API.
- Build the swap transaction for that quote using the Jupiter API.
- 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.