Skip to content

route.quote

A one-shot price quote for a trade. Returns the current best route without creating a subscription.

Request

{
  "id": 1,
  "method": "route.quote",
  "params": {
    "sell": "bch",
    "buy": "b79bfc8246b5fc4707e7c7dedcb6619ef1ab91f494a790c20b0f4c422ed95b92",
    "amount": "1",
    "side": "buy"
  }
}

Parameters

Field Type Required Description
sell string yes Sold asset: "bch" or 64-char hex token category
buy string yes Bought asset: "bch" or 64-char hex token category
amount string yes Exact-in amount in sold asset's base units

Cannot trade BCH for BCH (returns bad_request).

See the full JSON Schema for request parameters.

Response

Token↔BCH (Cauldron)

{
  "id": 1,
  "result": {
    "kind": "cauldron",
    "input_amount": "47299668",
    "input_is_bch": true,
    "output_amount": "1",
    "output_is_bch": false,
    "market_pre_price": "42910750.590909090909090909090909090",
    "market_post_price": "47206484.809523809523809523809523809",
    "pools": 1
  }
}

The beta endpoint routes native token↔BCH. The schema also defines combined (token↔token) and wrapped route kinds; they are not part of the beta and will be documented when they ship.

Errors

Code Cause
bad_request Malformed params, invalid asset, BCH↔BCH trade
route_failed No pools for this pair, or no fill at this amount