First Request

This guide sends a quote request to swap 1 WETH for DAI on Ethereum mainnet.

Send a Quote

curl -X POST "https://api.infraredtrading.com/v1/quote" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "inputs": [
      {
        "chain_id": 1,
        "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
        "amount": "1000000000000000000"
      }
    ],
    "outputs": [
      {
        "chain_id": 1,
        "address": "0x6B175474E89094C44Da98b954EedeBC836211103",
        "ratio_bps": 10000
      }
    ],
    "taker": "0x742d35Cc6634C0532925a3b844Bc9e7595f8b3c4"
  }'

Request Fields

Field
Type
Required
Description

inputs

array

Yes

Tokens to swap from. Each entry has chain_id (integer), address (hex string), and amount (decimal string in atomic units).

outputs

array

Yes

Desired output tokens. Each entry has chain_id (integer), address (hex string), and ratio_bps (integer, 1-10000). All ratio_bps values must sum to 10000.

taker

string

Yes

The address that holds the input tokens and will execute the transaction. Must be a valid EVM address.

slippage_tolerance_bps

integer

No

Maximum acceptable slippage in basis points. Default: 100 (1%). Range: 0-5000.

For the full set of optional parameters (recipient, max_hops, exclude_protocols, gas_priority, simulate, and more), see the Quote guide.

Response

A successful request returns a JSON object with a data field containing the quote:

Key Response Fields

Field
Description

quote_id

UUID identifying this quote. Pass it to the Build endpoint to assemble an executable transaction.

estimated_outputs

Expected and minimum output amounts per token. minimum_amount reflects your slippage tolerance.

costs

Gas cost breakdown with EIP-1559 parameters. Includes gas_priority tier used.

path

The execution route with token metadata and per-step details (protocol, pool, amounts).

protocols_used

List of protocols involved in the selected route.

approvals

ERC-20 approval requirements, if any, that must be fulfilled before execution.

Next Step

Use the quote_id with the Build endpoint to assemble an executable transaction from this quote.

Last updated