> ## 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.

# 스왑 트랜잭션 빌드(기본 출력)

> 원하는 출력 금액으로 직렬화된 스왑 트랜잭션을 생성합니다.
`/compute/swap-base-out`에서 성공한 compute 응답이 필요합니다.




## OpenAPI

````yaml /ko/api-reference/openapi/route-api-v2.yaml post /transaction/swap-base-out
openapi: 3.0.3
info:
  title: Raydium 트랜잭션 API (Route V2)
  version: 1.0.0
  description: >
    Solana용 서버 사이드 스왑 트랜잭션 빌더입니다. 이 API는 클라이언트가 RPC 연결이나 전체 Raydium SDK를 실행할 필요
    없이 직렬화된 스왑 트랜잭션을 생성합니다.


    응답은 표준 봉투 형식을 따릅니다:

    - **성공**: `{ id: string, success: true, data: {...} }`

    - **오류**: `{ id: string, success: false, msg: string }`
  contact:
    name: Raydium
    url: https://raydium.io
servers:
  - url: https://transaction-v1.raydium.io
    description: Mainnet
  - url: https://transaction-v1-devnet.raydium.io
    description: Devnet
security: []
tags:
  - name: Compute
    description: 스왑 시세 계산용 읽기 전용 엔드포인트입니다(트랜잭션 빌딩 없음).
  - name: Transaction
    description: 서명 및 브로드캐스트할 준비가 완료된 직렬화 스왑 트랜잭션을 빌드합니다.
paths:
  /transaction/swap-base-out:
    post:
      tags:
        - Transaction
      summary: 스왑 트랜잭션 빌드(기본 출력)
      description: |
        원하는 출력 금액으로 직렬화된 스왑 트랜잭션을 생성합니다.
        `/compute/swap-base-out`에서 성공한 compute 응답이 필요합니다.
      operationId: buildSwapTransactionBaseOut
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BuildTransactionRequest'
      responses:
        '200':
          description: 직렬화된 트랜잭션이 성공적으로 빌드되었습니다.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionResponse'
        '400':
          description: 요청 본문 또는 계산 상태가 유효하지 않습니다.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    BuildTransactionRequest:
      type: object
      required:
        - wallet
        - swapResponse
        - txVersion
        - computeUnitPriceMicroLamports
      properties:
        wallet:
          type: string
          description: 서명자 지갑 주소입니다 (base58).
          example: '11111111111111111111111111111111'
        swapResponse:
          type: object
          description: 컴퓨팅 엔드포인트로부터의 완전한 응답 객체입니다.
          properties:
            id:
              type: string
            success:
              type: boolean
            version:
              type: string
            data:
              type: object
        txVersion:
          type: string
          enum:
            - V0
            - LEGACY
          description: Solana 트랜잭션 버전입니다.
          example: V0
        computeUnitPriceMicroLamports:
          type: string
          description: 마이크로-램포트 단위의 컴퓨팅 유닛 가격입니다 (우선 수수료용).
          example: '1000'
        wrapSol:
          type: boolean
          description: 입력이 네이티브 SOL인 경우 SOL을 래핑할지 여부입니다.
          example: false
        unwrapSol:
          type: boolean
          description: 출력에서 WSOL을 SOL로 래핑 해제할지 여부입니다.
          example: false
        inputAccount:
          type: string
          description: 입력용 선택적 토큰 계정 주소입니다. SOL을 래핑하지 않는 경우 필수입니다.
          example: TokenAccount1111111111111111111111111111111111
        outputAccount:
          type: string
          description: 출력용 선택적 토큰 계정 주소입니다.
          example: TokenAccount2222222222222222222222222222222222
        jitoInfo:
          type: object
          description: MEV 보호를 위한 선택적 Jito 번들 파라미터입니다.
          properties:
            address:
              type: string
              description: Jito 번들 제출 주소입니다.
            amount:
              type: string
              description: 램포트 단위의 번들 팁 금액입니다.
        referrerWallet:
          type: string
          description: 수수료 수집을 위한 선택적 리퍼러 지갑 주소입니다.
          example: ReferrerWallet1111111111111111111111111111111111
    TransactionResponse:
      type: object
      properties:
        id:
          type: string
          description: 고유한 요청 식별자입니다.
          example: 550e8400-e29b-41d4-a716-446655440000
        success:
          type: boolean
          description: 트랜잭션 생성 성공 여부입니다.
          example: true
        version:
          type: string
          example: V1
        data:
          type: object
          description: 트랜잭션 데이터입니다.
          properties:
            transaction:
              type: string
              description: 서명 준비가 완료된 Base64 인코딩된 버전화된 트랜잭션입니다.
            addressLookupTableAddresses:
              type: array
              description: 주소 조회 테이블 주소입니다 (txVersion=V0인 경우).
              items:
                type: string
    ErrorResponse:
      type: object
      properties:
        id:
          type: string
          description: 고유한 요청 식별자입니다.
        success:
          type: boolean
          example: false
        version:
          type: string
          example: V1
        msg:
          type: string
          description: '오류 메시지 코드입니다 (예: REQ_SLIPPAGE_BPS_ERROR, REQ_WALLET_ERROR).'

````