Swap

POST/jupiter/swap
Cryptographically Attested

Parameters (Kit SDK)

When using @sonabuild/kit, you only provide these parameters. The SDK automatically handles context (wallet, origin) and encryption.

inputMintstringrequired

Input token mint address on Solana. Common tokens: SOL=So11111111111111111111111111111111111111112, USDC=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v

outputMintstringrequired

Output token mint address on Solana. Common tokens: SOL=So11111111111111111111111111111111111111112, USDC=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v

amountnumberrequired

Amount of input token to swap (in token units, not lamports)

slippageBpsintegerrequired

Slippage tolerance in basis points (50 = 0.5%, 100 = 1%)

min: 1max: 10000

Full Request Schema (Direct API)

If calling the API directly (without Kit), send this complete structure. The Kit SDK constructs this automatically from your params.

encryptedstringrequired

Sealed box encrypted payload

hintobjectrequired

Plaintext hint for hint verification

contextobjectrequired
walletstringrequired

User wallet public key

originstringrequired

Request origin URL

paramsobjectrequired
inputMintstringrequired

Input token mint address on Solana. Common tokens: SOL=So11111111111111111111111111111111111111112, USDC=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v

outputMintstringrequired

Output token mint address on Solana. Common tokens: SOL=So11111111111111111111111111111111111111112, USDC=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v

amountnumberrequired

Amount of input token to swap (in token units, not lamports)

slippageBpsintegerrequired

Slippage tolerance in basis points (50 = 0.5%, 100 = 1%)

min: 1max: 10000
includeAttestationboolean

Whether to include attestation in response

Response Schema

All responses follow this structure. The data field contains operation-specific results (see example response →).

successbooleanrequired
transactionstring

Base64 encoded signed transaction

attestationobject
signaturestringrequired

Attestation signature

docstring

NSM attestation document (base64, includes PCR measurements)

metadataobject
protocolstringrequired
operationstringrequired
timestampnumberrequired
dataobject
swapobjectrequired
routeobjectrequired
inputMintstringrequired

Solana wallet or account address (Base58)

outputMintstringrequired

Solana wallet or account address (Base58)

inAmountstringrequired
outAmountstringrequired
priceImpactPctstringrequired
slippageBpsnumber
marketInfosarray
Array items:
feesobject
signatureFeeLamportsintegerrequired
0max: 9007199254740991
prioritizationFeeLamportsintegerrequired
0max: 9007199254740991
rentFeeLamportsintegerrequired
0max: 9007199254740991
feeBpsnumber
routerstring
requestIdstring
errorstring | null
# Attested operations require encrypted payloads
# Use @sonabuild/kit SDK to handle encryption automatically
curl -X POST https://api.sona.build/jupiter/swap \
  -H "Content-Type: application/json" \
  -d '{
  "encrypted": "base64_encrypted_payload_from_kit",
  "hint": {
    "context": {
      "wallet": "YourWalletPublicKey",
      "origin": "https://your-app.com"
    },
    "params": {
      "inputMint": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
      "outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      "amount": 100000000,
      "slippageBps": 100
    }
  },
  "includeAttestation": true
}'

Example Response

{
  "transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQACC...",
  "attestation": {
    "signature": "PWT2ZBBQ2p0ZuDw+cysk1KfY6OGlCV03TY3W4K63yrgvF+81L2HFctankBsqaIMM110YiJk9v+miitHHevcjDw==",
    "pcrs": {}
  },
  "metadata": {
    "protocol": "jupiter",
    "operation": "operation",
    "timestamp": 1766817748748
  },
  "data": {
    "result": "success"
  }
}

Cryptographic Attestation

This endpoint generates transactions in a secure enclave. Every transaction includes a cryptographic attestation that can be verified before signing.

Calling directly without the SDK? See our Manual Encryption Guide to learn how to encrypt payloads for attested endpoints.