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

# 스왑 시세 계산(기본 출력)

> 원하는 출력 금액을 달성하기 위해 필요한 입력 금액을 계산합니다.
목표 출력을 아는 스왑에 유용합니다.




## OpenAPI

````yaml /ko/api-reference/openapi/route-api-v2.yaml get /compute/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:
  /compute/swap-base-out:
    get:
      tags:
        - Compute
      summary: 스왑 시세 계산(기본 출력)
      description: |
        원하는 출력 금액을 달성하기 위해 필요한 입력 금액을 계산합니다.
        목표 출력을 아는 스왑에 유용합니다.
      operationId: computeSwapBaseOut
      parameters:
        - name: inputMint
          in: query
          required: true
          schema:
            type: string
          description: 입력 토큰의 민트 주소입니다.
          example: EPjFWdd5Au5WrWSNY8jk5oHE3TkM3TvhEhBNj9xtJzwQ
        - name: outputMint
          in: query
          required: true
          schema:
            type: string
          description: 출력 토큰의 민트 주소입니다.
          example: So11111111111111111111111111111111111111112
        - name: amount
          in: query
          required: true
          schema:
            type: string
          description: 원하는 출력 금액(최소 단위, lamport)입니다.
          example: '5000000'
        - name: slippageBps
          in: query
          required: true
          schema:
            type: string
          description: 최대 슬리피지 허용도(basis points, 0–10000)입니다.
          example: '50'
        - name: txVersion
          in: query
          required: true
          schema:
            type: string
            enum:
              - V0
              - LEGACY
          description: Solana 트랜잭션 버전입니다.
          example: V0
      responses:
        '200':
          description: 스왑 시세가 성공적으로 계산되었습니다.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ComputeSwapResponse'
        '400':
          description: 입력 매개변수가 유효하지 않습니다.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ComputeSwapResponse:
      type: object
      properties:
        id:
          type: string
          description: 고유한 요청 식별자(UUID)입니다.
          example: 550e8400-e29b-41d4-a716-446655440000
        success:
          type: boolean
          description: compute의 성공 여부입니다.
          example: true
        version:
          type: string
          description: API 응답 버전입니다.
          example: V1
        data:
          type: object
          description: 스왑 계산 결과입니다.
          properties:
            inputAmount:
              type: string
              description: 입력 금액(최소 단위)입니다.
            outputAmount:
              type: string
              description: 예상 출력 금액(슬리피지 고려)입니다.
            priceImpact:
              type: string
              description: '가격 영향 비율입니다(예: "0.5"는 0.5%).'
            routes:
              type: array
              description: 사용된 스왑 경로 및 풀 배열입니다.
              items:
                type: object
    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).'

````