Must be
"quote".97 bytes of
QuoteResponse, encoded as standard base64 without padding
(130 characters).QuoteResponse (97 bytes)
All integer fields are little-endian.
| Offset | B | Field | Type | Meaning |
|---|---|---|---|---|
| 0 | 16 | request_id | uuid | RFQ UUID from the broadcast |
| 16 | 4 | odds | uint32 LE | decimal odds in basis points (e.g. 25000 = 2.5×) |
| 20 | 8 | max_fill_micros | uint64 LE | maximum fill in USDC micros |
| 28 | 4 | reserved | — | zero padding |
| 32 | 65 | signature | bytes65 | EIP-191 personal-sign over bytes 0..32 |
Sign the first 32 bytes of the quote with EIP-191 personal-sign semantics. The
signature is the 65-byte
r || s || v value. Longshot accepts v as 0/1 or
27/28.Liability Calculation
Quote liability is calculated from the quote payload:Build Example
build_quote fills the 97-byte QuoteResponse layout above, signs the
first 32 bytes with EIP-191 personal-sign, and returns the { type, data }
envelope ready to send over the authenticated WebSocket from
Authentication.
Error Codes
Quote submissions can fail in three different envelopes. Know which one you’re looking at before handling.Rate-limit frame
When your tier’s quote token bucket runs dry, the server sends a dedicatedrate_limit frame (not an error frame):
quote_ack rejection reasons
When the server receives a quote but refuses to route it, you get a negative
quote_ack with a human-readable error string. Every reason below is a
rejection of this specific quote only — the session stays authenticated.
error string | Meaning |
|---|---|
invalid base64 encoding | Outer data field is not valid standard base64 (no-padding) or the encoded length is not exactly 130 characters. The JSON path length-checks the base64 string before decoding, so any wrong-length payload surfaces here — not as invalid quote size. |
invalid_signature | The signature does not recover to the wallet that authenticated this WebSocket. |
duplicate_quote | The authenticated maker already submitted this exact quote tuple. |
rfq_expired | The RFQ deadline passed before the quote could be routed. |
zero_max_fill, max_fill_exceeds_rfq_amount, invalid_odds, or zero_maker_liability | The quote failed public validation before routing. |
Quote maker liability outside valid range | The quote’s maker-liability calculation overflowed the supported range. |
RFQ not found or no longer accepting quotes | The RFQ session closed, the request_id is unknown, or the MM is not eligible for this RFQ. |
Session-level error frames
Anything that tears down the WebSocket (AUTH_EXPIRED, HEARTBEAT_TIMEOUT,
NOT_AUTHENTICATED, MALFORMED_JSON, BINARY_NOT_SUPPORTED, etc.) arrives
as an error frame on the socket, not in a quote_ack. The full table and
recovery actions live on Receive RFQs → Error Codes.