Skip to main content
POST
/
transaction
/
swap-base-out
Build swap transaction (base output)
curl --request POST \
  --url https://transaction-v1.raydium.io/transaction/swap-base-out \
  --header 'Content-Type: application/json' \
  --data '
{
  "wallet": "11111111111111111111111111111111",
  "swapResponse": {
    "id": "<string>",
    "success": true,
    "version": "<string>",
    "data": {}
  },
  "txVersion": "V0",
  "computeUnitPriceMicroLamports": "1000",
  "wrapSol": false,
  "unwrapSol": false,
  "inputAccount": "TokenAccount1111111111111111111111111111111111",
  "outputAccount": "TokenAccount2222222222222222222222222222222222",
  "jitoInfo": {
    "address": "<string>",
    "amount": "<string>"
  },
  "referrerWallet": "ReferrerWallet1111111111111111111111111111111111"
}
'
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "success": true,
  "version": "V1",
  "data": {
    "transaction": "<string>",
    "addressLookupTableAddresses": [
      "<string>"
    ]
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.raydium.io/llms.txt

Use this file to discover all available pages before exploring further.

Body

application/json
wallet
string
required

Signer wallet address (base58).

Example:

"11111111111111111111111111111111"

swapResponse
object
required

The complete response object from the compute endpoint.

txVersion
enum<string>
required

Solana transaction version.

Available options:
V0,
LEGACY
Example:

"V0"

computeUnitPriceMicroLamports
string
required

Compute unit price in micro-lamports (for priority fees).

Example:

"1000"

wrapSol
boolean

Whether to wrap SOL if the input is native SOL.

Example:

false

unwrapSol
boolean

Whether to unwrap WSOL to SOL in the output.

Example:

false

inputAccount
string

Optional token account address for input. Required if not wrapping SOL.

Example:

"TokenAccount1111111111111111111111111111111111"

outputAccount
string

Optional token account address for output.

Example:

"TokenAccount2222222222222222222222222222222222"

jitoInfo
object

Optional Jito bundle params for MEV protection.

referrerWallet
string

Optional referrer wallet address for fee collection.

Example:

"ReferrerWallet1111111111111111111111111111111111"

Response

Serialized transaction built successfully.

id
string

Unique request identifier.

Example:

"550e8400-e29b-41d4-a716-446655440000"

success
boolean

Whether transaction building succeeded.

Example:

true

version
string
Example:

"V1"

data
object

Transaction data.