Integration Guide

All public endpoints, request fields, response fields, and copy-paste examples.

Mental model

  • token_in is what the user sends.
  • token_out is what the user receives.
  • amount is the raw base-unit GM asset quantity. For buys, it is the desired token_out GM amount; for sells, it is the supplied token_in GM amount.
  • chain_id is 56 for BNB Smart Chain. Ethereum (chain ID 1) and other EVM chains are coming soon.
  • slippage_bps defaults to 10 when omitted.

Do not send V1 fields such as asset, side, or quote_asset to V2 endpoints.

Public endpoints

MethodEndpointAuthPurpose
GET/healthNoLiveness check
GET/api/v2/assetsYesList supported assets
GET/api/v2/assets/by-address/{address}YesLook up one supported asset
GET/api/v2/limitsYesTrading limits per asset and side
GET/api/v2/markets/levelsYesFull pair books with bids/asks
POST/api/v2/quotes/softYesIndicative quote
POST/api/v2/quotes/firmYesFirm quote with wallet transaction packet
GET/api/v2/quotes/{quote_id}YesQuote lookup
WSS/api/v2/streamYesPrice stream

Request fields

POST /api/v2/quotes/soft and POST /api/v2/quotes/firm use the same base body.

FieldTypeRequiredNotes
token_inaddress stringYesContract address for the token the user sends
token_outaddress stringYesContract address for the token the user receives
amountdecimal stringYesRaw base-unit GM asset quantity; desired output for buys, supplied input for sells
chain_idnumberYes56 for BNB Smart Chain (1 for Ethereum coming soon)
slippage_bpsnumberNoClient slippage tolerance in basis points; defaults to 10
recipientaddress stringFirmWallet that receives output tokens
deadlineUnix timestampNoOptional client deadline in seconds

Response fields

Soft and firm quote responses share the public quote fields below. Firm quotes additionally include execution.

FieldTypeNotes
typestringsoft_quote or firm_quote
schema_versionnumberPublic schema version; current value is 2
quote_idstringStable quote identifier for lookup
token_inobject{ symbol, address, decimals, chain_id }
token_outobject{ symbol, address, decimals, chain_id }
amount_indecimal stringRaw base-unit input amount
amount_outdecimal stringRaw base-unit output amount
pricedecimal stringExact quote price string
expiresISO-8601Do not use a quote after this timestamp
valid_for_secsnumberQuote validity window
slippage_bpsnumberApplied slippage tolerance
chain_idnumber56 for BNB Smart Chain (1 for Ethereum coming soon)
executionobjectPresent 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:

FieldTypeNotes
symbolstringRave symbol, for example AAPLon
tickerstringDisplay ticker
pricestringCurrent display price when available
price_change_24hstring24h price change when available
price_change_pct_24hstring24h percentage change when available
market_openbooleanWhether the market is currently open
market_statusobjectLive market status: { status, is_open, reason_code, reason, expected_reopen_at, freshness }
enabledbooleanWhether the asset is enabled for public quoting
bsc_addressstringBSC contract address (Ethereum addresses coming soon)
tokenobjectToken metadata { symbol, address, decimals, chain_id }
quote_tokensarraySupported 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:

  1. expires is still in the future.
  2. The connected wallet is on chain_id 56.
  3. Your UI displays token_out, amount_out, and price clearly.
  4. execution.transaction.to, data, value, and chain_id are 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 bounds
  • max_input_amount / min_input_amount — raw base-unit input bounds
  • allowance_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:

ParameterTypeNotes
symbolstringFilter to one asset by Rave symbol (e.g. AAPLon). Cannot be empty.
chain_idnumberChain ID. Required when base_token or quote_token is supplied.
base_tokenstringContract address. Requires chain_id and quote_token.
quote_tokenstringContract 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&quote_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)

Every frame includes a prices array with one entry per asset. Each price item includes:

FieldTypeNotes
symbolstringRave symbol e.g. AAPLon
addressaddress stringBSC contract address
biddecimal stringRaw 18-decimal bid price (wad)
askdecimal stringRaw 18-decimal ask price (wad)
max_sizedecimal stringMax trade size available (raw base units)
min_sizedecimal stringMin trade size (smallest level, raw base units)
updated_atISO-8601Last price update timestamp

Market levels (pairs)

Every frame also includes a pairs array with granular level-based bid/ask books for every supported pair.

FieldTypeNotes
pair_idstringeip155 chain-pair identifier
chain_idnumberChain ID (56 for BSC)
baseobject{ symbol, address, decimals, chain_id }
quoteobject{ symbol, address, decimals, chain_id }
bidsarrayCumulative bid levels, smallest first (see level fields)
asksarrayCumulative ask levels, smallest first (see level fields)
min_base_amountstringDecimal smallest cumulative base amount
max_base_amountstringDecimal largest cumulative base amount
min_base_amount_rawstringRaw on-chain smallest cumulative base amount
max_base_amount_rawstringRaw on-chain largest cumulative base amount
indicativebooleanAlways true for stream books
valid_untilISO-8601Book expiry timestamp

Each bid/ask level entry:

FieldTypeNotes
levelnumber1-based level index
base_amountdecimal stringCumulative base-token amount
base_amount_rawdecimal stringCumulative raw on-chain base-token amount
quote_amountdecimal stringCumulative quote-token amount
quote_amount_rawdecimal stringCumulative raw on-chain quote-token amount
pricedecimal stringMarginal 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

FieldTypeNotes
typestring"price_frame"
schema_versionnumber2
pricesarrayFlat asset prices (see above)
pairsarrayFull pair books with level depth
pair_chunkobjectPresent when pairs > 64: { index, count }
market_openbooleanWhether the market is currently open
timestampISO-8601Frame generation timestamp

Level detail (REST)

For the same pair-book data via REST, use GET /api/v2/markets/levels.