v1

latestOpenAPI 3.0.02026-08-0451764.0 KB
Quote

Generate a quote

This endpoint facilitates the creation of a potential quote for executing a swap between two assets. It allows users to obtain pricing information and other essential details necessary to initiate asset swaps within the system. Use this endpoint to explore the potential cost and feasibility of asset exchanges before finalizing transactions.

get/rfq/v2/quote/{chainId}

Path parameters

chainIdinteger required

ID of the blockchain network

Query parameters

pool_addressstring

Address of the pool. If not present, the best pool will be calculated

time_in_secondsinteger

Amount of time between accepting a quote and receiving the quote on the blockchain. As this value increases, the quote will get worse for the user.

output_amountstring

Desired quantity of assets to receive as part of the swap. This field is mutually exclusive with input_amount

input_amountstring

Desired quantity of assets you are willing to exchange. This field is mutually exclusive with output_amount

input_asset_symbolstring required

Identifier of the asset you want to provide for the swap. Should correspond to the asset name returned from the pool call

output_asset_symbolstring required

Identifier of the asset you want to receive in the swap. Should correspond to the asset name returned from the pool call

Response

Quote generated successfully

idstring uuid required

Id of the quote, use this value when signing a quote

must_accept_bystring required

Human-readable UTC timestamp by which you must accept the quote and should be expected to be a short duration. If this time has passed already, request a new quote - the server will not sign a quote after must_accept_by has passed

good_untilinteger required

number of seconds that quotes live

chain_idinteger required

Represents the ID of the chain

input_asset_addressstring required

Contract address of the asset you want to provide for the swap

input_amountstring required

Amount of assets to be exchanged

output_asset_addressstring required

Contract address of the asset you want to receive in the swap

output_amountstring required

Amount of assets you will receive in the exchange

input_value_in_usdnumber float required

Amount in dollars to be exchanged

output_value_in_usdnumber float required

Amount in dollars you will receive in the exchange

created_atinteger required

Unix Timestamp indicating the date and time when the quote was created

ratenumber float required

swap rate

Example response

{
  "id": "05a51aa6-41b5-4c61-a452-f1b95d0d43e4",
  "must_accept_by": "2023-10-13 22:24:20.932560+00:00",
  "good_until": 1697235920,
  "chain_id": 1,
  "input_amount": "10000000000000000000",
  "output_amount": "5661947917",
  "input_value_in_usd": 15595.15,
  "output_value_in_usd": 5668.12,
  "created_at": 1697235848,
  "rate": 566.1947917,
  "input_asset_address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
  "output_asset_address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
}