THORChain Quote API

The Quote API from THORChain — 1 operation(s) for quote.

OpenAPI Specification

thorchain-quote-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Thornode Auth Quote API
  version: 3.19.1
  contact:
    email: devs@thorchain.org
  description: Thornode REST API.
tags:
- name: Quote
paths:
  /thorchain/quote/swap:
    parameters:
    - $ref: '#/components/parameters/queryHeight'
    - name: from_asset
      in: query
      description: the source asset
      schema:
        type: string
        example: BTC.BTC
    - name: to_asset
      in: query
      description: the target asset
      schema:
        type: string
        example: ETH.ETH
    - name: amount
      in: query
      description: the source asset amount in 1e8 decimals
      schema:
        type: integer
        format: int64
        example: 1000000
    - name: destination
      in: query
      description: the destination address, required to generate memo
      schema:
        type: string
        example: '0x1c7b17362c84287bd1184447e6dfeaf920c31bbe'
    - name: refund_address
      in: query
      description: the refund address, refunds will be sent here if the swap fails
      schema:
        type: string
        example: '0x1c7b17362c84287bd1184447e6dfeaf920c31bbe'
    - name: streaming_interval
      in: query
      description: the interval in which streaming swaps are swapped
      schema:
        type: integer
        format: int64
        example: 10
    - name: streaming_quantity
      in: query
      description: the quantity of swaps within a streaming swap
      schema:
        type: integer
        format: int64
        example: 10
    - name: tolerance_bps
      in: query
      description: the maximum basis points from the current feeless swap price to set the limit in the generated memo
      schema:
        type: integer
        format: int64
        example: 100
    - name: liquidity_tolerance_bps
      in: query
      description: the maximum basis points of tolerance for pool price movements to set the limit in the generated memo
      schema:
        type: integer
        format: int64
        example: 100
    - name: affiliate_bps
      in: query
      description: the affiliate fee in basis points
      schema:
        type: integer
        format: int64
        example: 100
    - name: affiliate
      in: query
      description: the affiliate (address or thorname)
      schema:
        type: string
        example: t
    get:
      description: Provide a quote estimate for the provided swap.
      operationId: quoteswap
      tags:
      - Quote
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuoteSwapResponse'
components:
  schemas:
    QuoteFees:
      type: object
      required:
      - asset
      - liquidity
      - total
      - slippage_bps
      - total_bps
      properties:
        asset:
          type: string
          example: ETH.ETH
          description: the target asset used for all fees
        affiliate:
          type: string
          example: '1234'
          description: affiliate fee in the target asset
        outbound:
          type: string
          example: '1234'
          description: outbound fee in the target asset
        liquidity:
          type: string
          example: '1234'
          description: liquidity fees paid to pools in the target asset
        total:
          type: string
          example: '9876'
          description: total fees in the target asset
        slippage_bps:
          type: integer
          format: int64
          description: the swap slippage in basis points
        total_bps:
          type: integer
          format: int64
          description: total basis points in fees relative to amount out
    QuoteSwapResponse:
      type: object
      required:
      - expected_amount_out
      - outbound_delay_blocks
      - outbound_delay_seconds
      - fees
      - warning
      - notes
      - expiry
      properties:
        inbound_address:
          type: string
          description: the inbound address for the transaction on the source chain
          example: bc1qjk3xzu5slu7mtmc8jc9yed3zqvkhkttm700g9a
        inbound_confirmation_blocks:
          type: integer
          format: int64
          description: the approximate number of source chain blocks required before processing
        inbound_confirmation_seconds:
          type: integer
          format: int64
          description: the approximate seconds for block confirmations required before processing
        outbound_delay_blocks:
          type: integer
          format: int64
          description: the number of thorchain blocks the outbound will be delayed
        outbound_delay_seconds:
          type: integer
          format: int64
          description: the approximate seconds for the outbound delay before it will be sent
        fees:
          $ref: '#/components/schemas/QuoteFees'
        router:
          type: string
          description: the EVM chain router contract address
          example: '0x3624525075b88B24ecc29CE226b0CEc1fFcB6976'
        expiry:
          type: integer
          format: int64
          description: expiration timestamp in unix seconds
          example: 1671660285
        warning:
          type: string
          description: static warning message
          example: Do not cache this response. Do not send funds after the expiry.
        notes:
          type: string
          description: chain specific quote notes
          example: Transfer the inbound_address the asset with the memo. Do not use multi-in, multi-out transactions.
        dust_threshold:
          type: string
          example: '10000'
          description: Defines the minimum transaction size for the chain in base units (sats, wei, uatom). Transactions with asset amounts lower than the dust_threshold are ignored.
        recommended_min_amount_in:
          type: string
          description: The recommended minimum inbound amount for this transaction type & inbound asset. Sending less than this amount could result in failed refunds.
          example: '15000'
        recommended_gas_rate:
          type: string
          example: '10'
          description: the recommended gas rate to use for the inbound to ensure timely confirmation
        gas_rate_units:
          type: string
          example: gwei
          description: the units of the recommended gas rate
        memo:
          type: string
          description: generated memo for the swap
          example: =:ETH.ETH:0x1c7b17362c84287bd1184447e6dfeaf920c31bbe:1440450000:thor17gw75axcnr8747pkanye45pnrwk7p9c3cqncsv:100
        expected_amount_out:
          type: string
          description: the amount of the target asset the user can expect to receive after fees
          example: '10000'
        max_streaming_quantity:
          type: integer
          format: int64
          description: the maximum amount of trades a streaming swap can do for a trade
          example: 10
        streaming_swap_blocks:
          type: integer
          format: int64
          description: the number of blocks the streaming swap will execute over
          example: 100
        streaming_swap_seconds:
          type: integer
          format: int64
          description: approx the number of seconds the streaming swap will execute over
          example: 600
        total_swap_seconds:
          type: integer
          format: int64
          description: total number of seconds a swap is expected to take (inbound conf + streaming swap + outbound delay)
          example: 600
  parameters:
    queryHeight:
      name: height
      in: query
      description: optional block height, defaults to current tip
      required: false
      schema:
        type: integer
        format: int64
        minimum: 0