---
title: "Build swap transaction (base output)"
method: POST
path: "/transaction/swap-base-out"
tags: ["Transaction"]
---

# Build swap transaction (base output)

`POST /transaction/swap-base-out`

Generate a serialized swap transaction for a desired output amount.
Requires a successful compute response from `/compute/swap-base-out`.

## Request body

- BuildTransactionRequest
  - `wallet` string, required — Signer wallet address (base58).
  - `swapResponse` object, required — The complete response object from the compute endpoint.
    - `id` string
    - `success` boolean
    - `version` string
    - `data` object
  - `txVersion` 'V0' | 'LEGACY', required — Solana transaction version.
  - `computeUnitPriceMicroLamports` string, required — Compute unit price in micro-lamports (for priority fees).
  - `wrapSol` boolean — Whether to wrap SOL if the input is native SOL.
  - `unwrapSol` boolean — Whether to unwrap WSOL to SOL in the output.
  - `inputAccount` string — Optional token account address for input. Required if not wrapping SOL.
  - `outputAccount` string — Optional token account address for output.
  - `jitoInfo` object — Optional Jito bundle params for MEV protection.
    - `address` string — Jito bundle submission address.
    - `amount` string — Bundle tip amount in lamports.
  - `referrerWallet` string — Optional referrer wallet address for fee collection.

## Response `200`

Serialized transaction built successfully.

- TransactionResponse
  - `id` string — Unique request identifier.
  - `success` boolean — Whether transaction building succeeded.
  - `version` string
  - `data` object — Transaction data.
    - `transaction` string — Base64-encoded versioned transaction (ready to sign).
    - `addressLookupTableAddresses` string[] — Address lookup table addresses (if txVersion=V0).

## Other responses

- `400` — Invalid request body or computation state.

---

[API](https://skmtc.net/raydium/apis/api-v1-v2-legacy.md) · [All operations](https://skmtc.net/raydium/apis/api-v1-v2-legacy/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/raydium/api-v1-v2-legacy/revisions/cca93975de95/schema)
