SmallSwap SmallSwap

API Reference / GET /new_rate

GET /api/v1/new_rate

Ask for a quote. Returns a rate, ETA, fee breakdown, and the catalog of provider routes that can fill the pair.

Request

curl 'https://smallswap.example/api/v1/new_rate?ticker_from=xmr&ticker_to=usdt&network_from=monero&network_to=tron&amount_from=1.0' \
  -H 'API-Key: prt_yourkeyhere'

Query parameters

NameRequiredDescription
ticker_fromyesSource ticker, lowercase (e.g. xmr).
ticker_toyesDestination ticker, lowercase.
network_fromyesSource chain (e.g. monero).
network_toyesDestination chain (e.g. tron).
amount_fromone ofAmount of ticker_from. Decimal string. Floating-rate mode.
amount_toone ofAmount of ticker_to. Fixed-rate mode. MVP returns 503 fixed_rate_unsupported.
paymentnoTrue = fixed-rate, False = floating (default). MVP supports floating only.
markupnoBasis points credited to your commission account. Anonymous defaults to 0. Cap configurable per key.
min_kycratingnoTrocador compat (A..D). Accepted and ignored — we are a single provider.
anonnoIf true, omit anything we'd otherwise log per privacy policy.
best_onlynotrue = single route, false = all routes (default).

Response — 200 OK

{
  "amount_from": "1.0",
  "amount_to": "398.32",
  "trade_id": "q_01HZJ4G...",
  "ticker_from": "xmr",
  "ticker_to": "usdt",
  "network_from": "monero",
  "network_to": "tron",
  "rate": "398.32",
  "expires_at": "2026-05-13T15:50:00Z",
  "policy": "self-fill-preferred",
  "as_of": "2026-05-13T15:49:00Z",
  "best_provider": "SmallSwap",
  "fees_breakdown": {
    "network_fee_usd": "1.10",
    "provider_fee_usd": "3.94",
    "partner_markup_usd": "0.00"
  },
  "included_fees_usd": "5.04",
  "price_impact_pct": -1.2,
  "eta_seconds": 360,
  "min_amount_from": "0.05",
  "max_amount_from": "12.4",
  "quotes": {
    "quotes": [
      {
        "provider": "SmallSwap",
        "risk": "precheck",
        "rate": "398.32",
        "amount_to": "398.32",
        "eta_seconds": 360,
        "included_fees_usd": "5.04",
        "kycrating": "A"
      },
      {
        "provider": "ChangeNOW",
        "risk": "controlled",
        "rate": "392.76",
        "amount_to": "392.76",
        "eta_seconds": 600,
        "included_fees_usd": "8.20",
        "kycrating": "B"
      }
    ]
  }
}
  • All amounts are decimal strings. No floats. Matches Trocador.
  • Top-level fields summarize the chosen route; alternatives live under quotes.quotes (nested as Cake's parser expects).
  • trade_id here is the rate ID — pass it back as id on /new_trade for fixed-rate flows.
  • risk: one of auto | flexible | precheck | controlled. See risk levels. SmallSwap-self-fill = precheck.
  • Quotes expire (expires_at). After expiry, /new_trade returns quote_expired.

Error responses

HTTPcodeWhen
400invalid_parameterMissing or malformed query param.
404pair_not_supportedPair isn't in /api/v1/pairs.
422amount_below_minamount_from below pair minimum.
422amount_above_maxamount_from above pair maximum.
503no_route_availableNo provider can fill.
503pricing_staleInternal pricing feed is stale; quote unsafe.
429rate_limit_exceededCaller over rate limit.