DODO Trade API

The Trade API from DODO — 1 operation(s) for trade.

OpenAPI Specification

dodo-trade-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: DODO / Route Trade API
  version: 1.0.0
  description: The DODO Trade API (also called the DODO Route API) provides real-time price quotes for swaps between arbitrary tokens across supported EVM chains, plus the ABI calldata needed to execute the swap on-chain against the DODORouteProxy / DODOV2Proxy contracts. It compares prices across a range of liquidity sources (DODO v1, DODO v2, 1inch, 0x, ParaSwap, professional market makers, and DODO's own aggregation algorithm). This OpenAPI is generated faithfully from DODO's published tradeApi.md documentation; DODO does not publish an OpenAPI of its own. Current production access via the DODO Developer Portal requires an API key passed as the `apikey` query parameter.
  contact:
    name: DODO Developer Docs
    url: https://docs.dodoex.io/en/developer
  x-supported-chains:
    '1': Ethereum Mainnet
    '56': BNB Smart Chain
    '66': OKExChain (OEC)
    '128': Huobi ECO Chain (HECO)
    '137': Polygon
    '288': Boba
    '1285': MoonRiver
    '1313161554': Aurora
    '42161': Arbitrum One
    '43114': Avalanche
servers:
- url: https://route-api.dodoex.io
  description: DODO Route API production host
security:
- apiKeyQuery: []
tags:
- name: Trade
paths:
  /dodoapi/getdodoroute:
    get:
      operationId: getDodoRoute
      summary: Get a swap route quote
      description: Returns a real-time price quote and executable ABI calldata for swapping `fromAmount` of `fromTokenAddress` into `toTokenAddress` on the given chain, routed across DODO's aggregated liquidity sources. Use the native token sentinel address 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for ETH/BNB/MATIC.
      tags:
      - Trade
      parameters:
      - name: fromTokenAddress
        in: query
        required: true
        description: Contract address of the token to sell (native sentinel for ETH/BNB/MATIC).
        schema:
          type: string
      - name: fromTokenDecimals
        in: query
        required: true
        description: Decimals of the token to sell.
        schema:
          type: integer
      - name: toTokenAddress
        in: query
        required: true
        description: Contract address of the token to buy (native sentinel for ETH/BNB/MATIC).
        schema:
          type: string
      - name: toTokenDecimals
        in: query
        required: true
        description: Decimals of the token to buy.
        schema:
          type: integer
      - name: fromAmount
        in: query
        required: true
        description: Amount of the token to sell, expressed with decimals (e.g. 1 ETH = 10**18).
        schema:
          type: string
      - name: slippage
        in: query
        required: true
        description: Allowed slippage, 0-100 (unit percent).
        schema:
          type: integer
      - name: userAddr
        in: query
        required: true
        description: User wallet address that will execute the swap.
        schema:
          type: string
      - name: chainId
        in: query
        required: true
        description: 'Chain id: 1 Ethereum, 56 BSC, 66 OEC, 128 HECO, 137 Polygon, 42161 Arbitrum One, 1285 MoonRiver, 1313161554 Aurora, 288 Boba, 43114 Avalanche.'
        schema:
          type: integer
      - name: rpc
        in: query
        required: true
        description: Your own RPC node URL used for on-chain reads.
        schema:
          type: string
      - name: deadLine
        in: query
        required: false
        description: Unix timestamp (seconds) of the trade deadline block.
        schema:
          type: integer
      - name: source
        in: query
        required: false
        description: Restrict liquidity sources. If blank, all sources are quoted; set to "dodo" to quote DODO v1 and DODO v2 only.
        schema:
          type: string
      responses:
        '200':
          description: A route quote with executable ABI calldata.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RouteResponse'
              example:
                status: 200
                data:
                  resAmount: 4131.964781
                  resPricePerToToken: 0.24201566131747518
                  resPricePerFromToken: 4.131964
                  priceImpact: 0
                  useSource: 0x
                  targetDecimals: 6
                  targetApproveAddr: '0xCB859eA579b28e02B87A1FDE08d087ab9dbE5149'
                  to: '0xa356867fDCEa8e71AEaF87805808803806231FdC'
                  data: ''
                  resCostGas: 0
        4XX:
          description: Client error. The `status` field in the envelope carries a non-200 code.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        5XX:
          description: Server error. The `status` field in the envelope carries a non-200 code.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        status:
          type: integer
          description: Non-200 application status code indicating the error class.
        data:
          type: object
          description: Optional error detail payload.
    RouteResponse:
      type: object
      properties:
        status:
          type: integer
          description: Application status code; 200 indicates success.
        data:
          $ref: '#/components/schemas/RouteData'
    RouteData:
      type: object
      properties:
        resAmount:
          type: number
          description: Receive amount (not including the token's decimals).
        resPricePerToToken:
          type: number
          description: Ratio of sell token amount to buy token amount.
        resPricePerFromToken:
          type: number
          description: Ratio of buy token amount to sell token amount.
        priceImpact:
          type: number
          description: Price deviation; multiply by 100 for a percentage.
        useSource:
          type: string
          description: The liquidity source selected for the quote.
        targetDecimals:
          type: integer
          description: Decimals of the target token.
        targetApproveAddr:
          type: string
          description: DODOApprove contract to grant the sell token allowance to before swapping; empty when selling the native token.
        to:
          type: string
          description: DODOV2Proxy or DODORouteProxy contract address to send the transaction to.
        data:
          type: string
          description: ABI calldata to submit directly on-chain.
        resCostGas:
          type: number
          description: Estimated gas cost.
  securitySchemes:
    apiKeyQuery:
      type: apiKey
      in: query
      name: apikey
      description: API key issued by the DODO Developer Portal (https://docs.dodoex.io/en/developer), passed as the `apikey` query parameter on production Route API requests.
x-apievangelist-generated: '2026-07-18'
x-apievangelist-method: generated
x-apievangelist-source: https://github.com/DODOEX/docs/blob/master/docs/tradeApi.md