Troubleshooting

View as Markdown

The 0x Solana Swap API is available via priority access. Apply now to start building.

When working with Solana transactions and the 0x Swap API, you may encounter some common issues. Below are tips to help diagnose and resolve them:

IssuePossible CauseSuggested Fix
Transaction fails or gets droppedInsufficient SOL for fees, expired blockhash, or network congestionEnsure your wallet has enough SOL, fetch a fresh blockhash before sending, and retry the transaction
Signature verification errorsWrong signer, unsigned transaction, or corrupted transaction dataVerify the transaction is signed by the correct keypair and that instructions are built correctly
RPC timeout or errors during sendTransactionNetwork issues or overloaded RPC nodeTry switching to a different RPC endpoint or increase maxRetries in transaction sending options
Unexpected API errors or bad responsesIncorrect API key or malformed request payloadDouble-check API keys, endpoint URLs, and request parameters

Debugging Tips

  • Log your transaction signature and monitor it on a Solana explorer (e.g. Solscan) to track status.
  • Use connection.getLatestBlockhash() before each transaction to ensure blockhash freshness.
  • Use the transaction confirmation step to catch failures early.
  • Enable skipPreflight: false during development to validate transactions before sending.
  • Check API response error messages carefully; they often indicate what went wrong.

If you continue to experience issues, consider reaching out to the 0x developer support or the Solana developer community for assistance.