> ## Documentation Index
> Fetch the complete documentation index at: https://docs.archer.exchange/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a swap quote

> **Deprecated — use `POST /v1/order/swap` without `signer`.** This endpoint keeps its original response body so existing integrators keep working; it is not removed.

**Deprecated** — use `POST /v1/order/swap` without `signer`, which returns the same object as `quoteResponse` from the same engine. Kept, shape unchanged, until integrators have migrated.

Quotes a swap against the current registered maker books and returns what the taker will pay and receive, the effective mode, the price impact, and the fees.

The `swapMode` parameter controls how the `size` value is interpreted:
- **Omitted (default):** `size` is always in base tokens.
- **`MaxAmountIn`:** `size` is the maximum input amount (buy → quote tokens, sell → base tokens).
- **`MinAmountOut`:** `size` is the minimum output amount (buy → base tokens, sell → quote tokens).

The quote runs the same matching engine, over the same registered maker books in the same order, that `POST /v1/orders/build` uses — a mirror of the on-chain matching engine — so the quoted amounts are what the built transaction executes. A size the book cannot cover is refused with `INSUFFICIENT_LIQUIDITY`, exactly as the build endpoint refuses it; the error carries the size that could be filled.



## OpenAPI

````yaml /openapi.json get /v1/quote
openapi: 3.0.3
info:
  description: >-
    REST API for the Archer Exchange — a high-performance Solana-based order
    book exchange.


    All monetary values (prices, sizes, fees) are returned as decimal strings
    for precision.


    ### Rate Limiting

    All endpoints are rate-limited via a token-bucket algorithm. When the limit
    is exceeded, the API returns `429 Too Many Requests`.


    ### Error Format

    All errors follow a consistent JSON format:

    ```json

    {
      "error": "ERROR_CODE",
      "message": "Human-readable description"
    }

    ```


    ### Handling errors

    Every error falls into one of five actions. REST errors come back as
    `{"error": CODE, "message"}`. A transaction that fails on-chain reports
    `{"InstructionError": [index, {"Custom": code}]}`; codes are the `errors`
    list of the program IDL (`archer-sdk/idl/archer_v1.json`). When a build
    endpoint's preflight catches an on-chain error first, it returns `400
    INVALID_PARAMS` with the reason in `message`.


    | Action | REST | On-chain (code) |

    |---|---|---|

    | **Retry as is**, with backoff | `RATE_LIMITED` (429),
    `SERVICE_UNAVAILABLE` (503), `INTERNAL_ERROR` (500); relay `OVERLOADED`,
    `PREFLIGHT_UNAVAILABLE`. Keep backing off on 429: 50 of them within a minute
    from one IP returns `BANNED` (403) for 10 minutes | none |

    | **Refetch, rebuild, retry**: the book or registry changed under you | |
    `LevelSizeMismatch` (527), `StaleSequenceNumber` (509),
    `SequenceNumberTooFarAhead` (522), `RegistryBooksMismatch` (525),
    `IncompleteMakerBooks` (513), `NoMatchingLiquidity` (507); relay status
    `expired` (re-sign with a fresh blockhash) |

    | **Reprice** | `CROSSES_SPREAD`, `SLIPPAGE_EXCEEDED` | `PostOnlyWouldCross`
    (524), `CrossingOrderLevels` (505), `InvalidPrice` (503),
    `SlippageToleranceExceeded` (703) |

    | **Resize** | `INSUFFICIENT_LIQUIDITY` (the body's `availableSize` is what
    fits) | `MakerBookSideFull` (528: cancel a level first),
    `InvalidSizeAtLevel` (506), `InsufficientBalance` (402) and SPL Token `1`
    (fund the account or shrink), `ZeroSwapAmount` (702) |

    | **Stop**: fix the request or the setup; retrying cannot help |
    `INVALID_PARAMS`, `MISSING_API_KEY` / `INVALID_API_KEY` (401), `FORBIDDEN`,
    `NOT_FOUND`, `MARKET_NOT_FOUND`, `METHOD_NOT_ALLOWED`; `MARKET_PAUSED` /
    `MARKET_FROZEN` until the market resumes |
    `UnauthorizedArcherAccountDelegate` (1001), `BuilderFeeExceedsAccountCap`
    (1003), `UnauthorizedMaker` (502), `MakerNotRegistered` (512),
    `PostOnlyRequiresLimitOrderBook` (526), `MarketNotActive` (107),
    `MarketFrozen` (114); any 200–399 code (wrong account wiring, a bug to
    report) |
  title: Archer Exchange API
  version: 1.0.0
servers:
  - description: Production
    url: https://api.archer.exchange
  - description: Staging
    url: https://api-staging.archer.exchange
  - description: Local
    url: http://localhost:8080
security:
  - apiKey: []
tags:
  - description: Discover and inspect available trading markets
    name: Markets
  - description: Token metadata for every mint Archer lists
    name: Tokens
  - description: Get price quotes before placing an order
    name: Quote
  - description: Build unsigned Solana transactions for swaps
    name: Orders
  - description: Build unsigned Solana transactions for limit orders
    name: Limit Orders
  - description: >-
      ArcherAccount — a wallet's delegated trading identity. Collateral sits in
      token accounts owned by the account PDA; an authorized delegate can trade
      and quote as the account but never withdraw.
    name: Account
  - description: Read a maker book — balances and resting levels — by PDA or by owner
    name: Maker Books
  - description: Deposit / withdraw / close — fund movement for a maker book
    name: Maker Funds
  - description: Public protocol-wide aggregate statistics
    name: Stats
  - description: >-
      Submit signed Solana transactions and let Archer land them. Hosted at
      `https://send.archer.exchange`, separate from the REST API, using the same
      API key.
    name: Transaction Relay
paths:
  /v1/quote:
    get:
      tags:
        - Quote
      summary: Get a swap quote
      description: >-
        **Deprecated — use `POST /v1/order/swap` without `signer`.** This
        endpoint keeps its original response body so existing integrators keep
        working; it is not removed.


        **Deprecated** — use `POST /v1/order/swap` without `signer`, which
        returns the same object as `quoteResponse` from the same engine. Kept,
        shape unchanged, until integrators have migrated.


        Quotes a swap against the current registered maker books and returns
        what the taker will pay and receive, the effective mode, the price
        impact, and the fees.


        The `swapMode` parameter controls how the `size` value is interpreted:

        - **Omitted (default):** `size` is always in base tokens.

        - **`MaxAmountIn`:** `size` is the maximum input amount (buy → quote
        tokens, sell → base tokens).

        - **`MinAmountOut`:** `size` is the minimum output amount (buy → base
        tokens, sell → quote tokens).


        The quote runs the same matching engine, over the same registered maker
        books in the same order, that `POST /v1/orders/build` uses — a mirror of
        the on-chain matching engine — so the quoted amounts are what the built
        transaction executes. A size the book cannot cover is refused with
        `INSUFFICIENT_LIQUIDITY`, exactly as the build endpoint refuses it; the
        error carries the size that could be filled.
      operationId: getQuote
      parameters:
        - description: Base58-encoded market address.
          example: u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4
          in: query
          name: market
          required: true
          schema:
            type: string
        - description: Trade side.
          in: query
          name: side
          required: true
          schema:
            enum:
              - buy
              - sell
              - bid
              - ask
            type: string
        - description: >-
            Amount to trade (decimal string). Interpretation depends on
            `swapMode`.
          example: '1.5'
          in: query
          name: size
          required: true
          schema:
            type: string
        - description: Maximum allowed slippage in basis points (1 bps = 0.01%).
          example: 50
          in: query
          name: slippageBps
          required: true
          schema:
            minimum: 0
            type: integer
        - description: >-
            Controls how `size` is interpreted. When omitted, size is always in
            base tokens.
          in: query
          name: swapMode
          schema:
            enum:
              - MaxAmountIn
              - MinAmountOut
            type: string
        - description: >-
            Wallet that will sign the swap. When given, maker books it owns or
            is delegated on are excluded from the quote, exactly as the program
            excludes them from the fill. Omit for a wallet with no book on this
            market.
          in: query
          name: taker
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyQuoteResponse'
          description: The quote.
        '400':
          $ref: '#/components/responses/InsufficientLiquidity'
        '404':
          $ref: '#/components/responses/MarketNotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
      deprecated: true
components:
  schemas:
    LegacyQuoteResponse:
      description: >-
        Legacy body of the deprecated `GET /v1/quote`, unchanged from what
        production has always served. The `jupiter*` / `bps*` fields are
        vestigial — the Jupiter comparison was stubbed out long before this, so
        they are constants — and `expiresAt` is always 0, since a quote reserves
        nothing. New integrations should use `POST /v1/order/swap` without
        `signer`, which returns `QuoteResponse`.
      properties:
        archerEstimatedBaseSize:
          description: Base tokens that would trade.
          type: string
        archerEstimatedQuoteSize:
          description: Quote tokens that would trade, before fees.
          type: string
        archerEstimatedTotal:
          description: Quote tokens the taker pays or receives, fees included.
          type: string
        archerPrice:
          description: Average execution price, quote per base.
          type: string
        bpsDiff:
          description: Always "0.0". Vestigial.
          type: string
        bpsLabel:
          description: Always "archer". Vestigial.
          type: string
        expiresAt:
          description: Always 0.
          format: int64
          type: integer
        fullyFilled:
          description: >-
            Always true: a request the book cannot cover is refused with
            INSUFFICIENT_LIQUIDITY rather than quoted short.
          type: boolean
        jupiterEstimatedTotal:
          description: Always "0" at the quote's decimals. Vestigial.
          type: string
        jupiterPrice:
          description: Always "0" at the quote's decimals. Vestigial.
          type: string
        maxFillableInput:
          description: >-
            Echoes the requested `size`, since a quote that returns at all
            filled completely.
          type: string
      required:
        - archerPrice
        - jupiterPrice
        - bpsDiff
        - bpsLabel
        - archerEstimatedBaseSize
        - archerEstimatedQuoteSize
        - archerEstimatedTotal
        - jupiterEstimatedTotal
        - fullyFilled
        - maxFillableInput
        - expiresAt
      type: object
    ErrorResponse:
      properties:
        error:
          description: Machine-readable error code.
          enum:
            - INVALID_PARAMS
            - MARKET_NOT_FOUND
            - MARKET_PAUSED
            - INSUFFICIENT_LIQUIDITY
            - SLIPPAGE_EXCEEDED
            - NOT_FOUND
            - FORBIDDEN
            - RATE_LIMITED
            - INTERNAL_ERROR
            - SERVICE_UNAVAILABLE
            - MARKET_FROZEN
            - CROSSES_SPREAD
            - MISSING_API_KEY
            - INVALID_API_KEY
            - BANNED
            - METHOD_NOT_ALLOWED
          type: string
        message:
          description: Human-readable error description.
          type: string
      required:
        - error
        - message
      type: object
    InsufficientLiquidityError:
      description: >-
        Returned when the order book cannot fill the requested size. Includes
        the maximum available fill.
      properties:
        availableAvgPrice:
          description: Average price for the available fill.
          type: string
        availableSize:
          description: Maximum size that can be filled at current liquidity.
          type: string
        error:
          example: INSUFFICIENT_LIQUIDITY
          type: string
        message:
          type: string
      required:
        - error
        - message
        - availableSize
        - availableAvgPrice
      type: object
  responses:
    InsufficientLiquidity:
      content:
        application/json:
          examples:
            insufficientLiquidity:
              value:
                availableAvgPrice: '150.104000'
                availableSize: '12.500000000'
                error: INSUFFICIENT_LIQUIDITY
                message: Insufficient liquidity
            invalidParams:
              value:
                error: INVALID_PARAMS
                message: 'Invalid size: not a decimal number: abc'
          schema:
            oneOf:
              - $ref: '#/components/schemas/ErrorResponse'
              - $ref: '#/components/schemas/InsufficientLiquidityError'
      description: >-
        Invalid parameters, or the registered maker books cannot cover the
        requested size. An `INSUFFICIENT_LIQUIDITY` body carries `availableSize`
        — the base size the book could fill — and `availableAvgPrice`, its
        average price, so a client can retry at that size.
    MarketNotFound:
      content:
        application/json:
          example:
            error: MARKET_NOT_FOUND
            message: 'Market not found: 5Ggx...abc'
          schema:
            $ref: '#/components/schemas/ErrorResponse'
      description: Market not found.
    RateLimited:
      content:
        application/json:
          example:
            error: RATE_LIMITED
            message: Too many requests. Please slow down.
          schema:
            $ref: '#/components/schemas/ErrorResponse'
      description: Too many requests.
    InternalError:
      content:
        application/json:
          example:
            error: INTERNAL_ERROR
            message: 'Internal error: ...'
          schema:
            $ref: '#/components/schemas/ErrorResponse'
      description: Internal server error.
  securitySchemes:
    apiKey:
      in: header
      name: X-API-Key
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.