Skip to main content

Module limit

Module limit 

Source
Expand description

Request weights against Hyperliquid’s rate limit (the docs’ “Rate limits and user limits”), the last minute’s spend, and the gate a 429 closes. No clock and no I/O: every call is handed the time.

Structs§

Kind
Spent
What went out over the last minute.

Constants§

BASE_COOLDOWN_MS
The first cooldown a 429 closes the gate for; each strike doubles it.
LIMIT
Weight a minute per IP, reads and actions together.
MAX_COOLDOWN_MS
The longest cooldown a strike sets, though a Retry-After may ask longer.
SOFT
What reads may spend of LIMIT a minute before they wait. The last fifth is left to actions, which never wait, and to other clients on the same IP.
WINDOW_MS
The window every figure here is over.

Functions§

action_weight
An action batching batched orders, cancels or modifies: 1, plus 1 per 40.
base_weight
An /info read’s weight before counting what it returns.
per_items
For the reads that charge for what they return: how many items add one unit of weight.
read_weight
A read of kind that returned items.