Market-maker RFQ auth is a WebSocket-only challenge-response flow. Do not use
POST /v1/auth/wallet or POST /v1/auth/session for the RFQ bot handshake;
those endpoints are for first-party/API user login. The WebSocket handshake
returns the MM bearer session used by MM-authenticated HTTP routes.Flow
Receive the challenge
Server replies with
auth_challenge containing a 32-byte hex nonce and a
Unix-seconds timestamp.Sign the 75-byte message
Build
b"longshot:mm:ws-auth:v1:longshot.xyz" || nonce_bytes || little_endian_u64(timestamp)
and sign those 75 bytes with EIP-191 personal-sign. Do not sign the nonce
hex string.Messages
auth_challenge — server → client
Always
"auth_challenge".64 hex characters (32 random bytes).
Server time in Unix seconds.
auth_response — client → server
Must be
"auth_response".Registered EVM wallet address (EIP-55 checksum or lowercase hex).
130 hex characters. EIP-191 personal-sign over
b"longshot:mm:ws-auth:v1:longshot.xyz" || nonce_bytes || little_endian_u64(timestamp)
(65-byte r || s || v; v may be 0/1 or 27/28). The signed payload is
75 bytes before the EIP-191 prefix is applied: 35-byte domain, 32-byte decoded
nonce, and 8-byte little-endian timestamp.auth_result — server → client
Always
"auth_result".true when the signature verified and the wallet matches a known market
maker.Failure reason when
success is false.Bearer session token when
success is true. Use it as
Authorization: Bearer <session_token> for MM-authenticated HTTP routes such
as taker PnL. Valid for 1 hour.Operational Limits
- Authenticate within 10 seconds of connecting.
- Submit
auth_responsebefore the server challenge expires. The challenge lifetime is 30 seconds. - Heartbeat interval is 15 seconds; the server disconnects after 3 missed heartbeats.
Heartbeats
The server sends JSON heartbeats:pong:
auth_result has the same 1-hour lifetime. Reconnect
and re-authenticate if the connection drops, the server sends AUTH_EXPIRED,
or the bearer session expires.