covr.Docs

Gateway reference

Limits

This page lists every limit the gateway applies to a desk, and the SDK's own timeouts. Stay inside them and you never see a 4429.

Summary

LimitValueApplies toPast it
Sockets per maker16All your /maker and feed sockets, across every token of your quote keyClose 4429 Too many connections
Frame budget100 frames at once, then 20 per secondEach socket: messages and pings you sendClose 4429 Too many frames
Frame size16 384 bytesEach frame you sendClose 1009
Unread data1 MiBData queued for you at a heartbeatSocket terminated, no close frame
Heartbeat1 ping every 30 sEach socketSocket terminated if the previous ping was not echoed
JSON-RPC id128 charactersEach requestError invalid JSON-RPC request
Bids per RFQ1 per makerEach RFQError Maker already bid in this auction
RFQ memory120 to 130 s after creationGET /api/rfqs/<id> and every method404 or an unknown-RFQ error

Connections

Sockets per maker

Your quote key may hold 16 open sockets on the gateway at once. /maker sockets and feed sockets count alike. All tokens covr issued for the same quote key share the 16. The 17th upgrade completes only to be closed with 4429 Too many connections. Other desks are not affected.

A socket's slot frees when it closes. A dead socket that never closed keeps its slot until the heartbeat reaps it, within about 60 s.

Shared capacity

The endpoint also holds a fixed total number of desk connections, shared by every desk, and a fixed number of refusals in progress. When either is full, a new upgrade is dropped, or answered with HTTP 503, before any WebSocket handshake. Back off and retry.

At most 32 refusals (4401, 4403, 4429 Too many connections) are in progress at once across all callers. Each lasts about 1 s at most. A caller past that is dropped without a close code.

Frame budget

Each socket has a token bucket:

  • It holds at most 100 frames and starts full.
  • It refills at 20 frames per second.
  • Every message you send costs 1. Every WebSocket ping you send costs 1.
  • Pongs cost nothing, so answering the gateway's heartbeat is free.

When a frame arrives with less than 1 left, the gateway closes the socket with 4429 Too many frames and reads nothing more from it. Frames already read are still answered.

A normal desk uses a tiny fraction of this: about 2 frames per RFQ it bids on, plus 1 ping every 15 s from GatewayClient. Never retry a refused request in a tight loop.

Frame size

The gateway reads frames of up to 16 384 bytes. A larger frame closes the socket with 1009 (message too big). The largest legitimate desk frame, a quote, is under 1 KB (931 bytes for the golden vector).

GatewayClient refuses to send a frame over GATEWAY_MAX_FRAME_BYTES (16 384) and rejects the request locally. It also refuses frames over that size from the gateway.

Unread data and heartbeat

Every 30 s the gateway terminates a socket that has more than 1 MiB of data queued for it, or that did not echo the previous ping. Read your sockets continuously, including feeds you are not using right now. See Heartbeat.

Quote admission capacity

The gateway runs at most 4 quote admissions at a time, across all makers, and lets at most 8 more wait for a slot. A waiting quote starts only while the hard deadline has not passed. A quote that arrives while 4 are running and 8 are waiting, or that is still waiting or running at the hard deadline, is refused with Ordinary V3 quote admission unavailable, and the award passes.

HTTP

LimitValue
Request headers must arrive within10 s
Whole request must finish within15 s
Through covr's public endpoint, the gateway must answer within5 s, else 502 Gateway unavailable

GET /api/rfqs/<id> costs nothing against your frame budget. Call it once per RFQ, not in a polling loop: one read gives you everything you need to bid.

SDK timeouts

GatewayClient adds its own bounds. All are GatewayClientOptions in milliseconds or counts:

OptionDefaultRangeWhat it bounds
requestTimeoutMs5 0001 to 60 000Wait for a reply on /maker. On timeout the request rejects with OutcomeUnknownError, and the client sends nothing more for that RFQ.
httpTimeoutMs5 0001 to 60 000getRfq.
handshakeTimeoutMs10 0001 to 60 000Each socket upgrade.
heartbeatIntervalMs15 0001 to 300 000Time between the client's pings.
heartbeatTimeoutMs30 0001 to 300 000Time to wait for a pong before ending the socket.
maxQueuedEvents1 0001 to 1 000 000Unread events. One more closes the client with code 1008.

The request timeout (5 s) is longer than the whole award window (3 s), so a timeout never tells you that you missed awardUntil. Check awardUntil yourself before you sign. If a quote reply never arrives, its outcome is unknown: treat the quote as live.