Quotes

Indicative exchange rates between two currencies.

A quote tells you what a customer would receive if they swapped one currency for another right now. Fetch one before calling transaction.initiateSwap so you can show the user the rate and let them confirm.

Fetching a quote

POST /quote.get
Content-Type: application/json

{
    "currency_in":  { "value": "100", "code": "USD", "decimals": 2 },
    "currency_out": { "value": "0", "code": "USDC", "decimals": 6, "chain": "ethereum" }
}
{
    "data": {
        "bid": { "value": "998000", "code": "USDC", "decimals": 6 },
        "ask": { "value": "1002000", "code": "USDC", "decimals": 6 },
        "direction": "ask",
        "fees": [],
        "stablecoin": null
    }
}

currency_out.value is a placeholder on a quote — "0" asks "what is currency_in worth?". The response carries both sides of the spread plus any fees that would apply. Quotes are indicative, not binding — the executed transaction.initiateSwap re-quotes at execution time and may settle at a slightly different rate.

When to fetch

  • Immediately before showing a swap confirmation to a user
  • Periodically (e.g. every 10 seconds) if the user is sitting on a confirmation screen
  • Not at all if you're executing a known-amount swap server-side — the swap mutation will compute the actual rate

Currencies

Each side is a Currency object: the amount in the currency's smallest denomination as a string (value), the asset code (e.g. USD, AUD, USDC, ETH), and decimals. Crypto currencies also carry a chain (e.g. USDC on Ethereum vs Polygon). The supported codes and exact serialization are described in the API reference.