Backpack Exchange API

This WebSocket stream provides real-time updates on RFQs (Request for Quotes) that are relevant to makers. Events are pushed to this stream whenever there is a significant state change in an RFQ or its associated quotes, allowing makers to monitor and respond to RFQs as they progress through various states.

Event Types

For RFQs that submitted by other requesters.

  • rfqActive: Indicates that an RFQ is active and open for quotes.

For RFQs that submitted by your account.

  • rfqAccepted: Indicates that an RFQ has been accepted and is no
  • rfqRefreshed: Indicates that an RFQ has been refreshed, is active and open for quotes.
  • rfqCancelled: Indicates that an RFQ has been cancelled or expired.
  • rfqCandidate: RFQ has received a new best quote.
  • rfqFilled: Indicates that an RFQ has been fully filled with a quote.

For Quotes submitted by your account.

  • quoteAccepted: Indicates that a quote submitted by the maker has been accepted.
  • quoteCancelled: Indicates that a quote has been cancelled due to quote submission, RFQ being filled, refreshed, cancelled, or expired.

Quote Submission and RFQ Timing

Makers should submit quotes before the submission time (w field) is reached, as indicated in each rfqActive event. An RFQ remains active until the expiration time (W field). If no quote is accepted or the RFQ is not cancelled, makers may continue to submit quotes until expiration.

RFQs can periodically request new quotes by issuing additional rfqActive events. Each new rfqActive event will have the same RFQ ID (R field) but updated values for submission time and expiration time, allowing makers to participate in extended or renewed quoting periods for ongoing RFQs.

Stream Name Format

  • For all markets: account.rfqUpdate
  • For single market: account.rfqUpdate.<symbol>

Example Messages

RFQ Accepted (sent to requester)

{
  "e": "rfqAccepted",            // Event type
  "E": 1730225420369829,         // Event time in microseconds
  "R": 113392053149171712,       // RFQ ID
  "C": "123",                    // Client RFQ ID
  "s": "SOL_USDC_RFQ",           // Symbol
  "S": "Bid",                    // RFQ side
  "q": "10",                     // Quantity (if quantity in base asset)
  "w": 1730225480368,            // Submission time in milliseconds
  "W": 1730225540368,            // Expiry time in milliseconds
  "X": "New",                    // RFQ status
  "T": 1730225420368765          // Engine timestamp in microseconds
}

RFQ Active (broadcast to all rfq listeners)

{
  "e": "rfqActive",              // Event type
  "E": 1730225420369829,         // Event time in microseconds
  "R": 113392053149171712,       // RFQ ID
  "s": "SOL_USDC_RFQ",           // Symbol
  "q": "10",                     // Quantity (optional) (if quantity in base asset)
  "w": 1730225480368,            // Submission time in milliseconds
  "W": 1730225540368,            // Expiry time in milliseconds
  "X": "New",                    // RFQ status
  "T": 1730225420368765          // Engine timestamp in microseconds
}

RFQ Refreshed (sent to requester)

{
  "e": "rfqRefreshed",           // Event type
  "E": 1730225450369829,         // Event time in microseconds
  "R": 113392053149171712,       // RFQ ID
  "C": "123",                    // Client RFQ ID
  "s": "SOL_USDC_RFQ",           // Symbol
  "S": "Bid",                    // RFQ side
  "q": "10",                     // Quantity (optional) (if quantity in base asset)
  "w": 1730225480368,            // Submission time in milliseconds
  "W": 1730225540368,            // Expiry time in milliseconds
  "X": "New",                    // RFQ status
  "T": 1730225450368765          // Engine timestamp in microseconds
}

RFQ Cancelled (sent to taker only)

{
  "e": "rfqCancelled",           // Event type
  "E": 1730225460369829,         // Event time in microseconds
  "R": 113392053149171712,       // RFQ ID
  "C": "123",                    // Client RFQ ID
  "s": "SOL_USDC_RFQ",           // Symbol
  "S": "Bid",                    // RFQ side
  "Q": "150",                    // Quote quantity (optional) (if quantity in quote asset)
  "w": 1730225480368,            // Submission time in milliseconds
  "W": 1730225540368,            // Expiry time in milliseconds
  "X": "Cancelled",              // RFQ status
  "T": 1730225460368765          // Engine timestamp in microseconds
}

Quote Accepted (sent to quoter)

{
  "e": "quoteAccepted",          // Event type
  "E": 1730225434631394,         // Event time in microseconds
  "R": 113392053149171712,       // RFQ ID
  "u": 113392054083780608,       // Quote ID
  "C": "123",                    // Client Quote ID
  "s": "SOL_USDC_RFQ",           // Symbol
  "X": "New",                    // Quote status
  "T": 1730225434629778          // Engine timestamp in microseconds
}

Quote Cancelled (sent to quoter)

{
  "e": "quoteCancelled",         // Event type
  "E": 1730225583761963,         // Event time in microseconds
  "R": 113392061354344448,       // RFQ ID
  "u": 113392062870847488,       // Quote ID
  "C": "123",                    // Client Quote ID
  "s": "SOL_USDC_RFQ",           // Symbol
  "X": "Cancelled",              // Quote status
  "T": 1730225583753811          // Engine timestamp in microseconds
}

RFQ Candidate (sent to requester with quote details)

{
  "e": "rfqCandidate",           // Event type
  "E": 1730225490648996,         // Event time in microseconds
  "R": 113392053149171712,       // RFQ ID
  "u": 113392054083780608,       // Quote ID
  "C": "123",                    // Client RFQ ID
  "s": "SOL_USDC_RFQ",           // Symbol
  "S": "Bid",                    // RFQ side
  "q": "10",                     // RFQ quantity (in base asset)
  "Q": "150",                    // RFQ quote quantity (in quote asset)
  "p": "15.50",                  // Taker price (quote price + fee)
  "X": "New",                    // RFQ status
  "T": 1730225490647080          // Engine timestamp in microseconds
}

RFQ Filled (sent to both requester and quoter)

// To requester
{
  "e": "rfqFilled",              // Event type
  "E": 1730225497648996,         // Event time in microseconds
  "R": 113392053149171712,       // RFQ ID
  "u": 113392054083780608,       // Quote ID
  "C": "123",                    // Client RFQ ID
  "s": "SOL_USDC_RFQ",           // Symbol
  "S": "Bid",                    // RFQ side
  "Q": "150",                    // RFQ quote quantity (optional) (if quantity in quote asset)
  "p": "15.50",                  // Taker price (quote price + fee)
  "X": "Filled",                 // RFQ status
  "T": 1730225497647080          // Engine timestamp in microseconds
}

// To quoter
{
  "e": "rfqFilled",              // Event type
  "E": 1730225497648996,         // Event time in microseconds
  "R": 113392053149171712,       // RFQ ID
  "u": 113392054083780608,       // Quote ID
  "C": "123",                    // Client Quote ID
  "s": "SOL_USDC_RFQ",           // Symbol
  "p": "15.00",                  // Price
  "X": "Filled",                 // Quote status
  "T": 1730225497647080          // Engine timestamp in microseconds
}

Field Descriptions

  • e - Event type (e.g., rfqActive, rfqAccepted, rfqRefreshed, rfqCancelled, quoteAccepted, quoteCancelled, rfqCandidate, rfqFilled).
  • E - Event time in microseconds.
  • R - RFQ ID, identifying the request for quote.
  • u - Quote ID, identifying the specific quote.
  • C - Client ID (either Client RFQ ID or Client Quote ID depending on context).
  • s - Symbol the RFQ is for.
  • S - Side of the RFQ, either "Bid" or "Ask".
  • q - Quantity for the RFQ (in base asset, if quantity in base asset).
  • Q - Quote quantity for the RFQ (in quote asset, if quantity in quote asset).
  • p - Price associated with the quote/fill event.
  • w - Submission time for the RFQ in milliseconds.
  • W - Expiry time for the RFQ in milliseconds.
  • X - Order status (e.g., New, Cancelled, Filled).
  • o - System order type (e.g., CollateralConversion). Only present for system-initiated RFQs.
  • T - Engine timestamp in microseconds.

Some fields are conditional and may be present only in specific events. RFQs are either requested in base quantity or quote quantity, but not both. Either q or Q will be present.