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
| Name | Required | Description |
|---|---|---|
| ticker_from | yes | Source ticker, lowercase (e.g. xmr). |
| ticker_to | yes | Destination ticker, lowercase. |
| network_from | yes | Source chain (e.g. monero). |
| network_to | yes | Destination chain (e.g. tron). |
| amount_from | one of | Amount of ticker_from. Decimal string. Floating-rate mode. |
| amount_to | one of | Amount of ticker_to. Fixed-rate mode. MVP returns 503 fixed_rate_unsupported. |
| payment | no | True = fixed-rate, False = floating (default). MVP supports floating only. |
| markup | no | Basis points credited to your commission account. Anonymous defaults to 0. Cap configurable per key. |
| min_kycrating | no | Trocador compat (A..D). Accepted and ignored — we are a single provider. |
| anon | no | If true, omit anything we'd otherwise log per privacy policy. |
| best_only | no | true = 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_idhere is the rate ID — pass it back asidon/new_tradefor fixed-rate flows.risk: one ofauto | flexible | precheck | controlled. See risk levels. SmallSwap-self-fill =precheck.- Quotes expire (
expires_at). After expiry,/new_tradereturnsquote_expired.
Error responses
| HTTP | code | When |
|---|---|---|
| 400 | invalid_parameter | Missing or malformed query param. |
| 404 | pair_not_supported | Pair isn't in /api/v1/pairs. |
| 422 | amount_below_min | amount_from below pair minimum. |
| 422 | amount_above_max | amount_from above pair maximum. |
| 503 | no_route_available | No provider can fill. |
| 503 | pricing_stale | Internal pricing feed is stale; quote unsafe. |
| 429 | rate_limit_exceeded | Caller over rate limit. |