-
Notifications
You must be signed in to change notification settings - Fork 34
docs(hyperliquid): fix 4 flagged HL method pages (syncing WS, perp-dex-limits, 2 deprecations) #462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -372,6 +372,88 @@ const monitor = new NodeHealthMonitor('wss://hyperliquid-mainnet.core.chainstack | |
| monitor.connect(); | ||
| ``` | ||
|
|
||
| ## Example request | ||
|
|
||
| `eth_subscribe("syncing")` runs over a WebSocket connection. After subscribing, the node sends a notification with the current state and then another on every change: `false` when fully synced, or an object with `startingBlock`, `currentBlock`, and `highestBlock` while syncing. The Shell tab uses `wscat` for a quick check; the Python, JavaScript, and TypeScript tabs use the WebSocket transport of each library. | ||
|
|
||
| <CodeGroup> | ||
|
|
||
| ```shell wscat | ||
| $ wscat -c wss://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Escape the shell prompt dollar sign in MDX. Use As per coding guidelines, “Always escape dollar signs with backslash ( 🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| # Wait for the connection to be established | ||
|
|
||
| Connected (press CTRL+C to quit) | ||
|
|
||
| > {"id":1,"jsonrpc":"2.0","method":"eth_subscribe","params":["syncing"]} | ||
| < {"jsonrpc":"2.0","id":1,"result":"0x4f9f6872aa4c474b686cf23e352b725c"} | ||
|
|
||
| # A notification is sent immediately with the current state, then on every change. | ||
| # When the node is fully synced: | ||
| < {"jsonrpc":"2.0","method":"eth_subscription","params":{"subscription":"0x4f9f6872aa4c474b686cf23e352b725c","result":false}} | ||
|
|
||
| # When the node is syncing: | ||
| < {"jsonrpc":"2.0","method":"eth_subscription","params":{"subscription":"0x4f9f6872aa4c474b686cf23e352b725c","result":{"startingBlock":"0x0","currentBlock":"0x1234","highestBlock":"0x5678"}}} | ||
| ``` | ||
|
|
||
| ```python web3.py | ||
| import asyncio | ||
| from web3 import AsyncWeb3, WebSocketProvider | ||
|
|
||
|
|
||
| async def main(): | ||
| async with AsyncWeb3(WebSocketProvider("YOUR_CHAINSTACK_ENDPOINT")) as w3: | ||
| subscription_id = await w3.eth.subscribe("syncing") | ||
| print(f"Subscribed with ID: {subscription_id}") | ||
|
|
||
| async for message in w3.socket.process_subscriptions(): | ||
| # result is False when synced, or a progress object while syncing | ||
| print(f"Sync status: {message['result']}") | ||
|
|
||
|
|
||
| asyncio.run(main()) | ||
| ``` | ||
|
|
||
| ```javascript ethers.js | ||
| import { WebSocketProvider } from "ethers"; | ||
|
|
||
| const provider = new WebSocketProvider("YOUR_CHAINSTACK_ENDPOINT"); | ||
|
|
||
| // ethers has no high-level "syncing" event, so listen on the underlying | ||
| // WebSocket and send the eth_subscribe request directly. | ||
| provider.websocket.addEventListener("message", (event) => { | ||
| const message = JSON.parse(event.data.toString()); | ||
| if (message.method === "eth_subscription") { | ||
| // result is false when synced, or a progress object while syncing | ||
| console.log("Sync status:", message.params.result); | ||
| } | ||
| }); | ||
|
|
||
| await provider.send("eth_subscribe", ["syncing"]); | ||
| ``` | ||
|
|
||
| ```typescript viem | ||
| import { createPublicClient, webSocket } from "viem"; | ||
|
|
||
| const client = createPublicClient({ | ||
| transport: webSocket("YOUR_CHAINSTACK_ENDPOINT"), | ||
| }); | ||
|
|
||
| // viem has no high-level syncing action, so use the transport's low-level subscribe. | ||
| const { unsubscribe } = await client.transport.subscribe({ | ||
| params: ["syncing"], | ||
| onData: (data) => { | ||
| // data.result is false when synced, or a progress object while syncing | ||
| console.log("Sync status:", data.result); | ||
| }, | ||
| }); | ||
| ``` | ||
|
|
||
| </CodeGroup> | ||
|
|
||
| <Note> | ||
| **Use your own endpoint in your code.** The code examples use a placeholder Chainstack endpoint (YOUR_CHAINSTACK_ENDPOINT) — replace it with your own Hyperliquid node endpoint from the [Chainstack console](https://console.chainstack.com/). The curl above uses a shared public endpoint for quick checks only; do not use it in production. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Use the required link text for console.chainstack.com. Change As per coding guidelines, “Use 🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| </Note> | ||
|
|
||
| ## Use cases | ||
|
|
||
| The `eth_subscribe("syncing")` method is essential for applications that need to: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,13 +4,13 @@ openapi: /openapi/hyperliquid_node_api/hypercore_info/info_aligned_quote_token_i | |
| description: "The info endpoint with type: \"alignedQuoteTokenInfo\" retrieves supply, rate, and pending payment information for an aligned quote token." | ||
| --- | ||
|
|
||
| <Info> | ||
| This method is available on Chainstack. Not all Hyperliquid methods are available on Chainstack, as the open-source node implementation does not support them yet — see [Hyperliquid methods](/docs/hyperliquid-methods) for the full availability breakdown. | ||
| </Info> | ||
| <Warning> | ||
| **Removed by Hyperliquid (~June 2026).** The Hyperliquid API no longer recognizes the `alignedQuoteTokenInfo` request type — requests fail to deserialize — and the method has been dropped from the official SDKs. There is no direct replacement. For the aligned quote asset mechanism, see [Aligned quote assets](https://hyperliquid.gitbook.io/hyperliquid-docs/hypercore/aligned-quote-assets) in the Hyperliquid docs; for spot token metadata, see [tokenDetails](/reference/hyperliquid-info-token-details). This page is kept for reference. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Use the internal docs link format required for MDX pages. The internal link to As per coding guidelines, “Use relative paths with the 🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| </Warning> | ||
|
|
||
| The `info` endpoint with `type: "alignedQuoteTokenInfo"` retrieves supply, rate, and pending payment information for an aligned quote token. Aligned quote tokens are HIP-1 spot tokens that deployers have registered as collateral for HIP-3 perpetual DEXes through the CoreWriter contract on HyperEVM. | ||
| The `info` endpoint with `type: "alignedQuoteTokenInfo"` returned supply, rate, and pending payment information for an aligned quote token. Aligned quote tokens are HIP-1 spot tokens that deployers had registered as collateral for HIP-3 perpetual DEXes through the CoreWriter contract on HyperEVM. | ||
|
|
||
| Returns `null` if the token has not been registered as an aligned quote asset. | ||
| It returned `null` if the token had not been registered as an aligned quote asset. | ||
|
Comment on lines
+7
to
+13
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift OpenAPI contract and page status are currently inconsistent. This page says 🤖 Prompt for AI Agents |
||
|
|
||
| <Visibility for="humans"> | ||
| <Check> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,11 +4,11 @@ openapi: /openapi/hyperliquid_node_api/hypercore_info/info_batch_clearinghouse_s | |
| description: "The info endpoint with type: \"batchClearinghouseStates\" retrieves perpetuals account summaries for multiple users in one call. On Hyperliquid info." | ||
| --- | ||
|
|
||
| <Info> | ||
| You can only use this endpoint on the official Hyperliquid public API. It is not available through Chainstack, as the open-source node implementation does not support it yet. See [Hyperliquid methods](/docs/hyperliquid-methods) for the full availability breakdown. | ||
| </Info> | ||
| <Warning> | ||
| **Not available.** This batch method is not served by the public Hyperliquid API — requests return `null` for every address — and it is not available through Chainstack. To fetch perpetuals account state for multiple users, call [clearinghouseState](/reference/hyperliquid-info-clearinghousestate) once per address. Some third-party providers offer their own batch aggregators built on per-user calls. This page is kept for reference. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Update internal link path to the MDX docs convention. The As per coding guidelines, “Use relative paths with the 🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| </Warning> | ||
|
|
||
| The `info` endpoint with `type: "batchClearinghouseStates"` retrieves perpetuals account summaries for multiple users in one call. Use this to efficiently fetch positions, margin usage, and account values across many addresses. | ||
| The `info` endpoint with `type: "batchClearinghouseStates"` was intended to retrieve perpetuals account summaries for multiple users in one call — positions, margin usage, and account values across many addresses. | ||
|
|
||
| <Visibility for="humans"> | ||
| <Check> | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,7 +8,7 @@ description: "Reference for the perpDexLimits JSON-RPC method on the Hyperliquid | |||||
| This method is available on Chainstack. Not all Hyperliquid methods are available on Chainstack, as the open-source node implementation does not support them yet — see [Hyperliquid methods](/docs/hyperliquid-methods) for the full availability breakdown. | ||||||
| </Info> | ||||||
|
|
||||||
| The `info` endpoint with `type: "perpDexLimits"` retrieves the configuration limits for perpetual DEXes on Hyperliquid, including maximum number of assets and other deployment constraints. | ||||||
| The `info` endpoint with `type: "perpDexLimits"` retrieves the market limits for a builder-deployed perpetual DEX on Hyperliquid — the total open interest cap, the per-perpetual open interest size cap, the maximum transfer notional, and the per-asset open interest caps. | ||||||
|
|
||||||
| <Visibility for="humans"> | ||||||
| <Check> | ||||||
|
|
@@ -25,30 +25,75 @@ You can sign up with your GitHub, X, Google, or Microsoft account. | |||||
| ### Request body | ||||||
|
|
||||||
| * `type` (string, required) — The request type. Must be `"perpDexLimits"`. | ||||||
| * `dex` (string, required) — The name of the builder-deployed perp DEX, for example `"xyz"`. The empty string is not allowed. Use [perpDexs](/reference/hyperliquid-info-perpdexs) to list deployed perp DEX names. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Use Line 28 links to 🤖 Prompt for AI AgentsSource: Coding guidelines |
||||||
|
|
||||||
| ## Response | ||||||
|
|
||||||
| The response contains the perp DEX deployment limits and configuration constraints. | ||||||
| Returns a perp DEX limits object, or `null` if the DEX has no configured limits. | ||||||
|
|
||||||
| * `totalOiCap` (string) — Total open interest cap across the DEX. | ||||||
| * `oiSzCapPerPerp` (string) — Open interest size cap per perpetual. | ||||||
| * `maxTransferNtl` (string) — Maximum transfer notional amount. | ||||||
| * `coinToOiCap` (array) — Array of `[coin, oiCap]` tuples giving the open interest cap per asset. | ||||||
|
|
||||||
| ## Example request | ||||||
|
|
||||||
| <CodeGroup> | ||||||
|
|
||||||
| ```shell Shell | ||||||
| curl -X POST \ | ||||||
| -H "Content-Type: application/json" \ | ||||||
| -d '{"type": "perpDexLimits"}' \ | ||||||
| -d '{"type": "perpDexLimits", "dex": "xyz"}' \ | ||||||
| https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/info | ||||||
| ``` | ||||||
|
|
||||||
| ```python Python (hyperliquid-python-sdk) | ||||||
| from hyperliquid.info import Info | ||||||
|
|
||||||
| # skip_ws=True avoids opening a WebSocket connection for this REST call | ||||||
| info = Info("YOUR_CHAINSTACK_ENDPOINT", skip_ws=True) | ||||||
|
|
||||||
| # The SDK has no dedicated perpDexLimits helper, so post the request directly. | ||||||
| perp_dex_limits = info.post("/info", {"type": "perpDexLimits", "dex": "xyz"}) | ||||||
| print(perp_dex_limits) | ||||||
| ``` | ||||||
|
|
||||||
| ```typescript TypeScript (@nktkas/hyperliquid) | ||||||
| import { HttpTransport, InfoClient } from "@nktkas/hyperliquid"; | ||||||
|
|
||||||
| // apiUrl points the transport at a custom server (your Chainstack endpoint) | ||||||
| const transport = new HttpTransport({ apiUrl: "YOUR_CHAINSTACK_ENDPOINT" }); | ||||||
| const info = new InfoClient({ transport }); | ||||||
|
|
||||||
| const perpDexLimits = await info.perpDexLimits({ dex: "xyz" }); | ||||||
| console.log(perpDexLimits); | ||||||
| ``` | ||||||
|
|
||||||
| </CodeGroup> | ||||||
|
|
||||||
| <Note> | ||||||
| **Use your own endpoint in your code.** The code examples use a placeholder Chainstack endpoint (YOUR_CHAINSTACK_ENDPOINT) — replace it with your own Hyperliquid node endpoint from the [Chainstack console](https://console.chainstack.com/). The curl above uses a shared public endpoint for quick checks only; do not use it in production. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Use the required label for console links. For Suggested wording fix-... from the [Chainstack console](https://console.chainstack.com/).
+... from the [Chainstack account](https://console.chainstack.com/).📝 Committable suggestion
Suggested change
🤖 Prompt for AI AgentsSource: Coding guidelines |
||||||
| </Note> | ||||||
|
|
||||||
| ## Example response | ||||||
|
|
||||||
| ```json | ||||||
| null | ||||||
| { | ||||||
| "totalOiCap": "7000000000.0", | ||||||
| "oiSzCapPerPerp": "20000000000.0", | ||||||
| "maxTransferNtl": "3000000000.0", | ||||||
| "coinToOiCap": [ | ||||||
| ["xyz:AAPL", "100000000.0"], | ||||||
| ["xyz:ALUMINIUM", "25000000.0"], | ||||||
| ["xyz:AMD", "100000000.0"] | ||||||
| ] | ||||||
| } | ||||||
| ``` | ||||||
|
|
||||||
| ## Use case | ||||||
|
|
||||||
| The `info` endpoint with `type: "perpDexLimits"` is useful for: | ||||||
|
|
||||||
| * Checking deployment constraints before deploying a new perp DEX | ||||||
| * Understanding the maximum number of assets allowed per DEX | ||||||
| * Building deployment tools that validate against current limits | ||||||
| * Checking the open interest caps of a builder-deployed perp DEX before opening positions | ||||||
| * Monitoring per-asset open interest caps on a perp DEX | ||||||
| * Building risk and deployment tools that validate against current market limits | ||||||
Uh oh!
There was an error while loading. Please reload this page.