Getting Started

Production base URL, authentication, and your first Rave Trading quote.

Rave Trading is a principal market maker (PMM) that serves a request-for-quote (RFQ) API for tokenized assets, focused first on tokenized stocks, live on BNB Smart Chain (chain ID 56), Ethereum (chain ID 1), Base (chain ID 8453), and Robinhood Chain (chain ID 4663). You request a quote for a token pair, and for firm quotes you receive a ready-to-submit transaction packet. See the Smart Contracts page for deployed contract addresses across chains.

Base URL

The base URL already includes the /api prefix. Set it once and write every endpoint as a relative /v2/... path:

export RAVE_API="https://api.rave-trading.com/api"
  • GET /v2/assets resolves to https://api.rave-trading.com/api/v2/assets.
  • Do not prepend /api to the relative paths — RAVE_API already ends in /api, so $RAVE_API/api/v2/assets (which builds .../api/api/v2/...) is wrong.
  • The OpenAPI document uses the full server https://api.rave-trading.com with /api/v2/... paths; the reference server is https://api.rave-trading.com/api with /v2/... paths. Both resolve to the same URLs.

Use this direct API host for production traffic and latency measurements. https://rave-trading.com/api remains a compatibility path through the apex router, but latency-sensitive RFQ, levels, and stream traffic should use https://api.rave-trading.com/api. Keep HTTP connections warm/reused when measuring quote latency.

Authentication

Send API keys from your backend only. Store the key in your backend secret manager or environment and inject it into the request; the snippets below use *** as a placeholder — replace it with your key at request time.

Authorization: Bearer ***

Never expose the key in browser code, mobile apps, public logs, or customer support screenshots.

First checks

/health is public and does not require a key:

curl -s "$RAVE_API/health"

Expected shape:

{ "status": "ok" }

All quote, asset, and stream endpoints use bearer auth:

curl -s "$RAVE_API/v2/assets" \
  -H "Authorization: Bearer ***"

Expected shape:

[
  {
    "symbol": "AAPLon",
    "ticker": "AAPL",
    "enabled": true,
    "price": { "current": "269.55", "change_24h": "1.23", "change_pct_24h": "0.46" },
    "market": {
      "status": "open",
      "is_open": true,
      "session": "premarket",
      "next_close_at": "2026-05-19T20:00:00Z",
      "next_open_at": "2026-05-20T13:30:00Z",
      "next_open_session": "regular",
      "freshness": { "status": "fresh", "fetched_at": "2026-05-19T10:00:00Z", "ttl_secs": 90 }
    },
    "chains": [
      {
        "chain_id": 56,
        "token": { "symbol": "AAPLon", "address": "0x...", "decimals": 18, "chain_id": 56 },
        "quote_tokens": [{ "symbol": "USDT", "address": "0x...", "decimals": 18, "chain_id": 56 }]
      },
      {
        "chain_id": 1,
        "token": { "symbol": "AAPLon", "address": "0x...", "decimals": 18, "chain_id": 1 },
        "quote_tokens": [{ "symbol": "USDC", "address": "0x...", "decimals": 6, "chain_id": 1 }]
      }
    ]
  }
]

Pick a pair

Before quoting, discover supported pairs and chain-specific amounts from the live API:

  • /v2/assets — consolidated price, market, and chains[] metadata. Use chains[].token and same-chain chains[].quote_tokens to build pairs.
  • /v2/limits — currently quoteable directions, min/max raw input bounds, and allowance targets.
  • /v2/markets/levels or /v2/stream — current pair books and live price updates.

Do not hard-code one asset, stream, or direction. The sample pair below is illustrative only; token_in, token_out, amount, and chain_id should come from the pair the user selects.

First quote

A quote request uses contract addresses and raw base-unit strings. In V2, amount is always the raw quantity of token_in (the token being sent), never the desired token_out amount:

curl -s "$RAVE_API/v2/quotes/soft" \
  -H "Authorization: Bearer ***" \
  -H "Content-Type: application/json" \
  --data @- <<'JSON'
{
  "token_in": "0x55d398326f99059ff775485246999027b3197955",
  "token_out": "0x390a684ef9cade28a7ad0dfa61ab1eb3842618c4",
  "amount": "100000000000000000000",
  "chain_id": 56,
  "slippage_bps": 50
}
JSON

Expected shape:

{
  "type": "soft_quote",
  "schema_version": 2,
  "quote_id": "550e8400-e29b-41d4-a716-446655440000",
  "token_in": { "symbol": "USDT", "address": "0x55d398326f99059ff775485246999027b3197955", "decimals": 18 },
  "token_out": { "symbol": "AAPLon", "address": "0x390a684ef9cade28a7ad0dfa61ab1eb3842618c4", "decimals": 18 },
  "amount_in": "100000000000000000000",
  "amount_out": "361500000000000000",
  "price": "276.625173",
  "expires": "2026-05-15T12:00:30Z",
  "valid_for_secs": 30,
  "slippage_bps": 50,
  "chain_id": 56
}

Soft quotes are indicative and do not include an execution field. Only firm quotes carry an execution.transaction packet.

Next: firm quotes

For firm quotes, add recipient, complete the ERC-20 allowance checklist in the Integration Guide, then submit the returned execution.transaction unchanged from your wallet/RPC layer before expires. If the user changes the token_in amount, recipient, chain, or slippage tolerance, request a fresh firm quote.


Did this page help you?