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

> Per chain: whether it can trade now (`status`, `capabilities`), the hub tokens routes go
through, and the policy quotes and builds follow: how long a quote can be built
(`quoteTtlSecs`), the swap's deadline after the build (`deadlineSecs`), the gas headroom
over the simulated gas (`gasHeadroomPct`) and the least tip a build sets
(`minPriorityFeeWei`). `stream`, `eventSource` and `lastRpcError` describe the router's own
feeds: read them for diagnosis, do not build on them.


`policy` holds the numbers quotes and builds follow on each chain: how long a quote can be built, the swap's deadline, the gas headroom and the least tip a build sets. Guide: [EVM swaps](/router/evm).


## OpenAPI

````yaml router.openapi.yaml GET /evm/chains
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/chains:
    get:
      tags:
        - EVM catalog
      summary: EVM chains and their policy
      description: >
        Per chain: whether it can trade now (`status`, `capabilities`), the hub
        tokens routes go

        through, and the policy quotes and builds follow: how long a quote can
        be built

        (`quoteTtlSecs`), the swap's deadline after the build (`deadlineSecs`),
        the gas headroom

        over the simulated gas (`gasHeadroomPct`) and the least tip a build sets

        (`minPriorityFeeWei`). `stream`, `eventSource` and `lastRpcError`
        describe the router's own

        feeds: read them for diagnosis, do not build on them.
      operationId: evmChains
      responses:
        '200':
          description: The chains (live answer, trimmed to Base)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EvmChains'
              example:
                stage: trading
                runtime: rust
                eventSource:
                  selected: rpc,raze
                  raze:
                    connected: true
                    reconnects: 0
                    messages: 27
                    events: 11
                    duplicates: 0
                    rejected: 0
                    subscriptions: 1
                    lastError: null
                    lastEventAgoMs: 38347
                    lagMs: 576
                    watched: 1
                chains:
                  - slug: base
                    chainId: 8453
                    name: Base
                    nativeSymbol: ETH
                    wrappedNative: '0x4200000000000000000000000000000000000006'
                    status: tradable
                    configured:
                      rpcHttp: true
                      rpcWs: true
                      rpcArchive: false
                    capabilities:
                      quote: true
                      build: true
                      streaming: true
                    hubs:
                      - symbol: WETH
                        address: '0x4200000000000000000000000000000000000006'
                      - symbol: USDC
                        address: '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913'
                    policy:
                      quoteTtlSecs: 15
                      deadlineSecs: 60
                      gasHeadroomPct: 120
                      minPriorityFeeWei: '1000000'
                    stream:
                      connected: true
                      reconnects: 0
                      messages: 92
                      events: 92
                      duplicates: 0
                      rejected: 0
                      subscriptions: 2
                      lastError: null
                      lastEventAgoMs: 449
                      lagMs: 475
                    lastRpcError: null
        '401':
          $ref: '#/components/responses/EvmUnauthorized'
        '429':
          $ref: '#/components/responses/EvmRateLimited'
components:
  schemas:
    EvmChains:
      type: object
      required:
        - stage
        - runtime
        - eventSource
        - chains
      properties:
        stage:
          type: string
        runtime:
          type: string
        eventSource:
          type: object
          description: >-
            The router's own feeds of new pools: `selected` (the sources on) and
            the health of the Raze API feed (`raze`). For diagnosis only
        chains:
          type: array
          items:
            $ref: '#/components/schemas/EvmChain'
    EvmChain:
      type: object
      required:
        - slug
        - chainId
        - name
        - nativeSymbol
        - wrappedNative
        - status
        - configured
        - capabilities
        - hubs
        - policy
        - stream
        - lastRpcError
      properties:
        slug:
          $ref: '#/components/schemas/EvmChainSlug'
        chainId:
          type: integer
        name:
          type: string
        nativeSymbol:
          type: string
        wrappedNative:
          type: string
        status:
          type: string
          enum:
            - tradable
            - verifying
            - not_configured
          description: >-
            `tradable`: quotes and builds are served. `verifying`: no venue
            verified yet. `not_configured`: no RPC
        configured:
          type: object
          description: >-
            Which RPC endpoints the router has for the chain (`rpcHttp`,
            `rpcWs`, `rpcArchive`)
        capabilities:
          type: object
          properties:
            quote:
              type: boolean
            build:
              type: boolean
            streaming:
              type: boolean
              description: >-
                The router's block and new-pool stream for the chain is
                connected
        hubs:
          type: array
          items:
            type: object
            properties:
              symbol:
                type: string
              address:
                type: string
          description: Tokens routes can go through
        policy:
          type: object
          properties:
            quoteTtlSecs:
              type: integer
              description: How long a quote can be built
            deadlineSecs:
              type: integer
              description: The swap's deadline, after the build
            gasHeadroomPct:
              type: integer
              description: '`gas` = simulated gas × this / 100'
            minPriorityFeeWei:
              type: string
              description: The least tip (`maxPriorityFeePerGas`) a build sets
        stream:
          type: object
          description: >-
            Counters of the router's block stream for the chain (`connected`,
            `reconnects`, `lagMs`, `lastEventAgoMs`, …). For diagnosis only
        lastRpcError:
          type:
            - string
            - 'null'
          description: The last RPC error code the router met on this chain, if any
    GateError:
      type: object
      description: >-
        The API key gate's error, the market-data API's shape: `unauthorized`
        (401) or `rate_limited` (429)
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - unauthorized
                - rate_limited
            message:
              type: string
    EvmChainSlug:
      type: string
      enum:
        - eth
        - bsc
        - base
        - robinhood
      description: '`eth` (chain id 1), `bsc` (56), `base` (8453), `robinhood` (4663)'
  responses:
    EvmUnauthorized:
      description: >-
        A missing or unknown API key, or an account out of credits. The body is
        the API's, with its lower-case code.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GateError'
          example:
            error:
              code: unauthorized
              message: missing or unknown API key (send it as x-api-key)
    EvmRateLimited:
      description: >-
        Over the account's limit a minute (shared with the API, the Solana
        routes and launch). Wait for the next minute.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GateError'
          example:
            error:
              code: rate_limited
              message: too many requests
  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.