Trading API & SDK · Advanced API Patterns · 8/8
API Integration Challenge
Test your knowledge of Hyperliquid API patterns including order result parsing, portfolio management, and rate limiting.
1. When parsing a Hyperliquid order result, what does a status containing `{"resting": {"oid": 123}}` indicate?
A "resting" status means the order was accepted and is now on the order book waiting to be filled. The "oid" field contains the unique order identifier.
2. What should you check first when parsing the result from `exchange.order()`?
Always check result["status"] first. If it is not "ok", the entire API request failed and there are no individual order statuses to parse.
3. How is margin_ratio calculated in a portfolio summary?
Margin ratio = margin_used / account_value. This represents what fraction of your account is being used as margin. A higher ratio means more leverage is being used.
4. In a rate limiter, what is the correct approach before checking if a new call is allowed?
Before checking the rate limit, you should clean up expired timestamps by filtering out calls older than the period window. Then check if the remaining count is below max_calls.
5. As of October 2026, how are Hyperliquid's IP-based REST rate limits measured?
REST requests share a weight budget of 1200 per minute per IP. Unbatched /exchange actions weigh 1, l2Book/allMids/clearinghouseState weigh 2, and most other /info requests weigh 20. Actions are also subject to a separate address-based limit tied to traded volume (an initial buffer of 10,000 requests plus 1 per 1 USDC traded).