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

# EVM readiness

> `200` when at least one chain can trade: an RPC configured, a venue verified and a fresh
block head, from the router's stream or read over HTTP. Otherwise `503` with every reason
in `reasons`. A chain that cannot trade while another can is a `warnings` entry and the
answer stays `200`: chains are independent. `chains` lists every chain with its own
`ready`, the `dex` labels of its verified venues and its newest block (`head`). No key.

The body is the Solana `GET /ready`'s (`ready`, `reasons`, `warnings`) plus `chains`. The
reasons are sentences (`eth: no RPC configured`, `eth: no venue verified yet`,
`eth: no fresh block head`): show them, do not parse them.


Point your load balancer here for the EVM routes. How to read the answer: [Readiness](/router/evm#readiness).


## OpenAPI

````yaml router.openapi.yaml GET /evm/ready
openapi: 3.1.0
info:
  title: Raze Swap Router API
  version: 1.0.0
  description: >
    Quotes and **unsigned** transactions for swaps on Solana, routed through a
    deploy of the `swap`

    program over the venues `GET /venues` lists as `buildable` and `servable`,
    and, under `/evm`, on

    Ethereum, BNB Chain, Base and Robinhood Chain (see **EVM routes** below).
    The router **never

    signs and never sends**: you get a quote, then the instructions (or a
    serialized, unsigned

    transaction), and you sign and broadcast from your backend.


    **Public router.** `https://router.raze.bot` is Raze's router. It takes the
    same **API key** as

    the market-data API (`x-api-key`, `Authorization: Bearer` or `?apiKey=`;
    only `/health`,

    `/ready`, `/evm/health` and `/evm/ready` are open), shares the account's
    limit a

    minute with it and spends credits for each request it lets in. Its Solana
    routes have no path

    prefix (`/quote`, `/swap-instructions`, …),

    issues no `routeTicket`, and builds for Raze's deploy of the `swap` program,

    `DADMMjfNnY6z8H9h9RfHZ9tfarBySsj4Yb65qLyKJDAD`. A missing or unknown key
    answers `401` and a

    request over the limit `429`, both with the API's body,

    `{"error": {"code": "unauthorized" | "rate_limited", "message"}}`.


    **EVM routes (`/evm`).** The same host quotes and builds swaps on Ethereum
    (`eth`, chain id 1),

    BNB Chain (`bsc`, 56), Base (`base`, 8453) and Robinhood Chain (`robinhood`,
    4663), over Uniswap

    V2 and V3 (eth, base, robinhood) and PancakeSwap V2 and V3 (bsc): `GET` and
    `POST /evm/quote`,

    `POST /evm/swap` (alias `POST /evm/swap-instructions`), `GET /evm/venues`,
    `GET /evm/chains`,

    and the open `GET /evm/health` and `GET /evm/ready`. Same key, same limit a
    minute, same

    credits. They speak the Solana routes' API, so Jupiter's: the same parameter
    and field names

    (`inputMint`, `outputMint`, `amount`, `slippageBps`, `routePlan`,
    `otherAmountThreshold`,

    `quoteResponse`, `userPublicKey`, …), the conventions and the error shape
    below, `404 not_found`

    for an unknown path (`/evm/build` and `/evm/deployments` are gone) and `405`
    with `Allow` for a

    wrong method. What differs, because EVM does:

    - `chain` is required: `eth`, `bsc`, `base`, `robinhood` or the chain id
    (alias `chainId`).

    - Mints and wallets are `0x` addresses in any case (answers are lower case);
    the native coin is
      `0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE` (or `native`). Inside a `routePlan` the wrapped
      token stands for it.
    - Amounts are uint256 in base units: decimal strings of any size, or JSON
    integers up to
      2^64 − 1. `contextSlot` is the block number.
    - ExactIn only (`ExactOut` is `400`), `maxHops` at most 3 (default 2), one
    venue per route, no
      split, no platform fee (`platformFeeBps` or `feeBps` above 0 is `400`, not ignored).
    - The build returns unsigned transactions instead of instructions:
    `setupTransactions` (the
      approvals), then `swapTransaction`, simulated together, that you sign and send in order from
      your own RPC. It builds only a quote this router made and still holds (`quoteResponse.quoteId`),
      and a `quoteResponse` that says otherwise about it is `400 quote_mismatch`.
    - Errors carry no `quoteId`. A request is cut at 10 seconds (`503 rpc`,
    `request_timeout`).


    **One router, one `swap` deploy.** A router builds for the program address
    in its

    `ROUTER_SWAP_PROGRAM_ID` (the `programId` of every `swapInstruction` is that
    address) and

    reads that deploy's on-chain config: a venue the config has no live row for
    is never served,

    and while the config is paused every build answers `503`. A client with its
    own deploy runs

    its own router: it has no keys, no accounts and no rate limit and listens on
    loopback by

    default (`ROUTER_LISTEN`), so keep it behind your own gateway.


    **Conventions of the Solana routes:**

    - Amounts are integers in the token's base units (lamports, atoms). In
    quotes and builds the
      u64 amounts are decimal **strings** (`inAmount`, `outAmount`, `otherAmountThreshold`,
      `swapInfo.inAmount` / `outAmount`, `platformFee.amount`, every `costs.*Lamports*` field).
      `slippageBps`, `contextSlot`, `minReturn`, `maxAmountIn`, `computeUnits`,
      `loadedAccountsDataSize`, `lastValidBlockHeight` and every `transactionConfig` field are JSON
      numbers.
    - Mints and wallets are base58 addresses; wrapped SOL is
    `So11111111111111111111111111111111111111112`.

    - Venue labels (`label`, `dexes`, `excludeDexes`) are the `dex` names of
    `GET /venues`; input
      labels match case- and punctuation-insensitively, aliases included.
    - Request bodies are read as JSON whatever the `Content-Type`; at most 256
    KiB (larger is `413`).

    - Unknown fields and query parameters are ignored, not rejected.


    **Solana transactions are v1** (SIMD-0385, prefix `0x81`, up to 4,096 bytes
    and 64 account keys, no

    address lookup tables). The compute-unit limit, loaded-accounts limit and
    priority fee travel in

    the message header (`transactionConfig`), not as ComputeBudget instructions.
    Signing a v1

    transaction needs an SDK that supports it. `txVersion: 0` and
    `asLegacyTransaction: true` are

    refused.


    **Errors** of the Solana routes are `{"error", "reason", "quoteId"}`:
    `error` is a closed code, `reason` a label or a

    sentence, `quoteId` present once the request was parsed. The status says
    whose move it is:

    `400` fix the request, `404` no route exists (or an unknown path:
    `not_found`), `409` re-quote

    or retry later, `413` too large, `422` a named decline that waiting will not
    change, `500` a

    router bug, `503` not ready: retry with backoff. Two bodies differ:
    `not_ready` carries

    `reasons` (a list) instead of `reason`, and a `low_liquidity` decline adds
    `liquidity`. A known

    path with the wrong method (`GET /swap`) is `405` with an empty body and an
    `Allow` header.


    The Solana quote and swap fields mirror Jupiter's Swap API (Metis), so most
    clients change only the

    host; differences are listed on each operation.
servers:
  - url: https://router.raze.bot
    description: Raze's public router (API key)
security:
  - ApiKeyHeader: []
  - Bearer: []
  - ApiKeyQuery: []
tags:
  - name: ops
    description: Liveness and readiness
  - name: venues
    description: The venues this router knows, and the price oracle's verdict on each
  - name: swap
    description: Quote, then build the instructions or the unsigned transaction
  - name: transactions
    description: Serialize your own instructions as an unsigned v1 transaction
  - name: EVM swap
    description: >-
      Quote and build swaps on Ethereum, BNB Chain, Base and Robinhood Chain,
      under /evm
  - name: EVM catalog
    description: The EVM chains, their policy and the venue manifest
  - name: EVM ops
    description: Liveness and readiness of the EVM routes
paths:
  /evm/ready:
    get:
      tags:
        - EVM ops
      summary: EVM readiness
      description: >
        `200` when at least one chain can trade: an RPC configured, a venue
        verified and a fresh

        block head, from the router's stream or read over HTTP. Otherwise `503`
        with every reason

        in `reasons`. A chain that cannot trade while another can is a
        `warnings` entry and the

        answer stays `200`: chains are independent. `chains` lists every chain
        with its own

        `ready`, the `dex` labels of its verified venues and its newest block
        (`head`). No key.


        The body is the Solana `GET /ready`'s (`ready`, `reasons`, `warnings`)
        plus `chains`. The

        reasons are sentences (`eth: no RPC configured`, `eth: no venue verified
        yet`,

        `eth: no fresh block head`): show them, do not parse them.
      operationId: evmReady
      responses:
        '200':
          description: Ready
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EvmReady'
              example:
                ready: true
                reasons: []
                chains:
                  - chain: eth
                    chainId: 1
                    ready: true
                    venues:
                      - Uniswap V2
                      - Uniswap V3
                    head:
                      source: stream
                      number: '26157737'
                      ageMs: 74
                  - chain: bsc
                    chainId: 56
                    ready: true
                    venues:
                      - PancakeSwap V2
                      - PancakeSwap V3
                    head:
                      source: stream
                      number: '126712994'
                      ageMs: 724
                  - chain: base
                    chainId: 8453
                    ready: true
                    venues:
                      - Uniswap V2
                      - Uniswap V3
                    head:
                      source: stream
                      number: '52397143'
                      ageMs: 349
                  - chain: robinhood
                    chainId: 4663
                    ready: true
                    venues:
                      - Uniswap V2
                      - Uniswap V3
                    head:
                      source: stream
                      number: '84496381'
                      ageMs: 539
        '503':
          description: No chain can trade; the same body with `ready` false and the reasons
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EvmReady'
              examples:
                noRpc:
                  summary: A router without RPC endpoints (from the router's tests)
                  value:
                    ready: false
                    reasons:
                      - 'eth: no RPC configured'
                      - 'bsc: no RPC configured'
                      - 'base: no RPC configured'
                      - 'robinhood: no RPC configured'
                    chains:
                      - chain: eth
                        chainId: 1
                        ready: false
                        venues: []
                        head: null
                      - chain: bsc
                        chainId: 56
                        ready: false
                        venues: []
                        head: null
                      - chain: base
                        chainId: 8453
                        ready: false
                        venues: []
                        head: null
                      - chain: robinhood
                        chainId: 4663
                        ready: false
                        venues: []
                        head: null
      security: []
components:
  schemas:
    EvmReady:
      type: object
      required:
        - ready
        - reasons
        - chains
      properties:
        ready:
          type: boolean
          description: At least one chain can trade
        reasons:
          type: array
          items:
            type: string
          description: Empty when ready; otherwise every reason, as sentences
        warnings:
          type: array
          items:
            type: string
          description: Chains that cannot trade while another can. Absent when none
        chains:
          type: array
          items:
            type: object
            required:
              - chain
              - chainId
              - ready
              - venues
              - head
            properties:
              chain:
                $ref: '#/components/schemas/EvmChainSlug'
              chainId:
                type: integer
              ready:
                type: boolean
              venues:
                type: array
                items:
                  type: string
                description: The `dex` labels of its verified venues
              head:
                type:
                  - object
                  - 'null'
                description: >-
                  The newest block the router has: from its stream (`source:
                  stream`, with `ageMs`) or read over HTTP (`http`). `null` when
                  there is none
                properties:
                  source:
                    type: string
                    enum:
                      - stream
                      - http
                  number:
                    type: string
                  ageMs:
                    type: integer
    EvmChainSlug:
      type: string
      enum:
        - eth
        - bsc
        - base
        - robinhood
      description: '`eth` (chain id 1), `bsc` (56), `base` (8453), `robinhood` (4663)'
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
    Bearer:
      type: http
      scheme: bearer
    ApiKeyQuery:
      type: apiKey
      in: query
      name: apiKey

````

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