Integration Guide
All public endpoints, request fields, response fields, and copy-paste examples.
Mental model
token_inis what the user sends.token_outis what the user receives.amountis the raw base-unit GM asset quantity. For buys, it is the desiredtoken_outGM amount; for sells, it is the suppliedtoken_inGM amount.chain_idis56for BNB Smart Chain. Ethereum (chain ID1) and other EVM chains are coming soon.slippage_bpsdefaults to10when omitted.
Do not send V1 fields such as asset, side, or quote_asset to V2 endpoints.
Public endpoints
| Method | Endpoint | Auth | Purpose |
|---|---|---|---|
GET | /health | No | Liveness check |
GET | /api/v2/assets | Yes | List supported assets |
GET | /api/v2/assets/by-address/{address} | Yes | Look up one supported asset |
GET | /api/v2/limits | Yes | Trading limits per asset and side |
GET | /api/v2/markets/levels | Yes | Full pair books with bids/asks |
POST | /api/v2/quotes/soft | Yes | Indicative quote |
POST | /api/v2/quotes/firm | Yes | Firm quote with wallet transaction packet |
GET | /api/v2/quotes/{quote_id} | Yes | Quote lookup |
WSS | /api/v2/stream | Yes | Price stream |
Request fields
POST /api/v2/quotes/soft and POST /api/v2/quotes/firm use the same base body.
| Field | Type | Required | Notes |
|---|---|---|---|
token_in | address string | Yes | Contract address for the token the user sends |
token_out | address string | Yes | Contract address for the token the user receives |
amount | decimal string | Yes | Raw base-unit GM asset quantity; desired output for buys, supplied input for sells |
chain_id | number | Yes | 56 for BNB Smart Chain (1 for Ethereum coming soon) |
slippage_bps | number | No | Client slippage tolerance in basis points; defaults to 10 |
recipient | address string | Firm | Wallet that receives output tokens |
deadline | Unix timestamp | No | Optional client deadline in seconds |
Response fields
Soft and firm quote responses share the public quote fields below. Firm quotes additionally include execution.
| Field | Type | Notes |
|---|---|---|
type | string | soft_quote or firm_quote |
schema_version | number | Public schema version; current value is 2 |
quote_id | string | Stable quote identifier for lookup |
token_in | object | { symbol, address, decimals, chain_id } |
token_out | object | { symbol, address, decimals, chain_id } |
amount_in | decimal string | Raw base-unit input amount |
amount_out | decimal string | Raw base-unit output amount |
price | decimal string | Exact quote price string |
expires | ISO-8601 | Do not use a quote after this timestamp |
valid_for_secs | number | Quote validity window |
slippage_bps | number | Applied slippage tolerance |
chain_id | number | 56 for BNB Smart Chain (1 for Ethereum coming soon) |
execution | object | Present on firm quotes when prepared |
execution.transaction contains the wallet/RPC packet: to, data, value, chain_id, and optional gas_estimate.
Asset fields
GET /api/v2/assets returns supported assets with these public fields:
| Field | Type | Notes |
|---|---|---|
symbol | string | Rave symbol, for example AAPLon |
ticker | string | Display ticker |
price | string | Current display price when available |
price_change_24h | string | 24h price change when available |
price_change_pct_24h | string | 24h percentage change when available |
market_open | boolean | Whether the market is currently open |
market_status | object | Live market status: { status, is_open, reason_code, reason, expected_reopen_at, freshness } |
enabled | boolean | Whether the asset is enabled for public quoting |
bsc_address | string | BSC contract address (Ethereum addresses coming soon) |
token | object | Token metadata { symbol, address, decimals, chain_id } |
quote_tokens | array | Supported quote-token metadata (each with { symbol, address, decimals, chain_id }) |
Smart Contract Addresses
Asset contract addresses are available from the live /api/v2/assets endpoint (see the bsc_address field). For a machine-readable reference of all deployed contract addresses across chains, see the Smart Contracts page.
Health
curl -s "$RAVE_API/health"Expected shape:
{ "status": "ok" }Assets
curl -s "$RAVE_API/api/v2/assets" -H "Authorization: Bearer $RAVE_API_KEY"Look up one asset by contract address:
curl -s "$RAVE_API/api/v2/assets/by-address/0x390a684ef9cade28a7ad0dfa61ab1eb3842618c4" -H "Authorization: Bearer $RAVE_API_KEY"Soft quote
Soft quotes are non-binding and useful for pricing previews.
curl -s "$RAVE_API/api/v2/quotes/soft" -H "Authorization: Bearer $RAVE_API_KEY" -H "Content-Type: application/json" -d '{"token_in":"0x55d398326f99059ff775485246999027b3197955","token_out":"0x390a684ef9cade28a7ad0dfa61ab1eb3842618c4","amount":"1000000000000000000","chain_id":56}'Expected shape:
{
"type": "soft_quote",
"schema_version": 2,
"quote_id": "550e8400-e29b-41d4-a716-446655440000",
"token_in": {
"symbol": "USDT",
"address": "0x55d398326f99059ff775485246999027b3197955",
"decimals": 18,
"chain_id": 56
},
"token_out": {
"symbol": "AAPLon",
"address": "0x390a684ef9cade28a7ad0dfa61ab1eb3842618c4",
"decimals": 18,
"chain_id": 56
},
"amount_in": "276450000000000000000",
"amount_out": "1000000000000000000",
"price": "276.453850",
"expires": "2026-05-05T12:00:30Z",
"valid_for_secs": 30,
"slippage_bps": 10,
"chain_id": 56
}Firm quote
Firm quotes require a recipient address and include the wallet/RPC transaction packet.
curl -s "$RAVE_API/api/v2/quotes/firm" -H "Authorization: Bearer $RAVE_API_KEY" -H "Content-Type: application/json" -d '{"token_in":"0x55d398326f99059ff775485246999027b3197955","token_out":"0x390a684ef9cade28a7ad0dfa61ab1eb3842618c4","amount":"1000000000000000000","chain_id":56,"recipient":"0x000000000000000000000000000000000000dEaD"}'Before submitting, verify:
expiresis still in the future.- The connected wallet is on
chain_id56. - Your UI displays
token_out,amount_out, and price clearly. execution.transaction.to,data,value, andchain_idare passed unchanged to the wallet/RPC call.
Trading limits
curl -s "$RAVE_API/api/v2/limits" -H "Authorization: Bearer $RAVE_API_KEY"Returns per-asset trading limits including buy and sell sides with:
max_notional_value/min_notional_value— USD-denominated order size boundsmax_input_amount/min_input_amount— raw base-unit input boundsallowance_target— settlement contract address for token approval
Use /api/v2/limits to pre-validate order sizes before requesting quotes.
Market levels
curl -s "$RAVE_API/api/v2/markets/levels" -H "Authorization: Bearer $RAVE_API_KEY"Returns full pair books for all supported assets. Filter with query parameters:
| Parameter | Type | Notes |
|---|---|---|
symbol | string | Filter to one asset by Rave symbol (e.g. AAPLon). Cannot be empty. |
chain_id | number | Chain ID. Required when base_token or quote_token is supplied. |
base_token | string | Contract address. Requires chain_id and quote_token. |
quote_token | string | Contract address. Requires chain_id and base_token. |
Filter by symbol only:
curl -s "$RAVE_API/api/v2/markets/levels?symbol=AAPLon" -H "Authorization: Bearer ***Filter by exact chain/pair:
curl -s "$RAVE_API/api/v2/markets/levels?chain_id=56&base_token=0x390a684ef9cade28a7ad0dfa61ab1eb3842618c4"e_token=0x55d398326f99059ff775485246999027b3197955" -H "Authorization: Bearer ***Response envelope:
{
"pairs": [ /* pair book objects (see table below) */ ],
"market_open": true,
"as_of": "2026-05-08T10:00:00Z"
}Each pair includes pair_id, chain_id, base, quote, bids, asks, min_base_amount, max_base_amount, min_base_amount_raw, max_base_amount_raw, indicative, and valid_until. Bid/ask levels include level, base_amount, base_amount_raw, quote_amount, quote_amount_raw, and price.
Quote lookup
curl -s "$RAVE_API/api/v2/quotes/$QUOTE_ID" -H "Authorization: Bearer $RAVE_API_KEY"Use quote lookup to recover state after refreshes or backend job retries. Request a fresh quote whenever the lookup indicates expiration or rejection.
Quote lookup returns the persisted public quote record. In addition to the V2 fields, it may include compatibility aliases such as asset, side, quote_asset, amount, total, amount_in_raw, and amount_out_raw; do not send those aliases in new V2 quote requests.
Price stream
Connect with the API key in a header when your WebSocket client supports custom headers:
wscat -c "wss://rave-trading.com/api/v2/stream" -H "Authorization: Bearer $RAVE_API_KEY"When a client cannot set headers, connect from your backend and forward only the data your application needs.
Stream frames use schema_version: 2 and include two views of the market:
Flat prices (prices)
prices)Every frame includes a prices array with one entry per asset. Each price item includes:
| Field | Type | Notes |
|---|---|---|
symbol | string | Rave symbol e.g. AAPLon |
address | address string | BSC contract address |
bid | decimal string | Raw 18-decimal bid price (wad) |
ask | decimal string | Raw 18-decimal ask price (wad) |
max_size | decimal string | Max trade size available (raw base units) |
min_size | decimal string | Min trade size (smallest level, raw base units) |
updated_at | ISO-8601 | Last price update timestamp |
Market levels (pairs)
pairs)Every frame also includes a pairs array with granular level-based bid/ask books for every supported pair.
| Field | Type | Notes |
|---|---|---|
pair_id | string | eip155 chain-pair identifier |
chain_id | number | Chain ID (56 for BSC) |
base | object | { symbol, address, decimals, chain_id } |
quote | object | { symbol, address, decimals, chain_id } |
bids | array | Cumulative bid levels, smallest first (see level fields) |
asks | array | Cumulative ask levels, smallest first (see level fields) |
min_base_amount | string | Decimal smallest cumulative base amount |
max_base_amount | string | Decimal largest cumulative base amount |
min_base_amount_raw | string | Raw on-chain smallest cumulative base amount |
max_base_amount_raw | string | Raw on-chain largest cumulative base amount |
indicative | boolean | Always true for stream books |
valid_until | ISO-8601 | Book expiry timestamp |
Each bid/ask level entry:
| Field | Type | Notes |
|---|---|---|
level | number | 1-based level index |
base_amount | decimal string | Cumulative base-token amount |
base_amount_raw | decimal string | Cumulative raw on-chain base-token amount |
quote_amount | decimal string | Cumulative quote-token amount |
quote_amount_raw | decimal string | Cumulative raw on-chain quote-token amount |
price | decimal string | Marginal price at this level |
When there are more than 64 pairs, frames are chunked with pair_chunk: { index, count }. Clients reassemble the complete snapshot by collecting all chunks. The prices array is only included in the first chunk (index: 0).
Frame metadata
| Field | Type | Notes |
|---|---|---|
type | string | "price_frame" |
schema_version | number | 2 |
prices | array | Flat asset prices (see above) |
pairs | array | Full pair books with level depth |
pair_chunk | object | Present when pairs > 64: { index, count } |
market_open | boolean | Whether the market is currently open |
timestamp | ISO-8601 | Frame generation timestamp |
Level detail (REST)
For the same pair-book data via REST, use GET /api/v2/markets/levels.
Updated about 16 hours ago