Skip to main content

Module rate_limit

Module rate_limit 

Source
Expand description

Derive v3 request budgets and per-wallet/instrument order pacing.

Request budgets reset in five-second fixed windows. Instrument buckets refill continuously and hold reserved capacity until a signed request is dispatched. HTTP and WebSocket clients on the same API host share wallet state across session keys and subaccounts. Public requests share a separate process-local per-host budget, conservatively assuming one source IP.

Published defaults are a reference snapshot. Read deployed request budgets with public/getRateLimits; it does not report instrument allowances. Client windows cannot observe the venue’s phase, and transport queues can delay departure, so definitive venue throttling remains possible.

See https://docs.derive.xyz/rate-limits.

Constants§

DERIVE_CANCEL_ALL_RATE_KEY
Identifier for the private/cancel_all request budget.
DERIVE_CANCEL_ALL_TPS
Reference private/cancel_all requests per second.
DERIVE_CANCEL_BY_LABEL_RATE_KEY
Identifier for the private/cancel_by_label request budget.
DERIVE_CANCEL_BY_LABEL_TPS
Adapter private/cancel_by_label endpoint allowance, retaining the integrator reference’s 10 TPS for unscoped calls.
DERIVE_DEFAULT_MATCHING_TPS
Reference wallet matching requests per second.
DERIVE_DEFAULT_PER_INSTRUMENT_MATCHING_TPS
Reference per-instrument refill rate for perpetuals and spot.
DERIVE_MATCHING_RATE_KEY
Identifier for the matching request budget.
DERIVE_NON_MATCHING_RATE_KEY
Identifier for the non-matching request budget.
DERIVE_NON_MATCHING_TPS
Reference public request allowance per IP, in requests per second.
DERIVE_RATE_BURST_MULTIPLIER
Instrument capacity multiplier and requests per fixed window per TPS.
DERIVE_RATE_WINDOW_SECS
Request-budget fixed-window duration in seconds.
DERIVE_WEBSOCKET_NON_MATCHING_TPS
Reference authenticated non-matching requests per second.