spotSnapshot

Unique endpoint allowing to get entire spot positioning of all Hyperliquid spot holders.

💧New endpoint - this endpoint is not a part of original Hyperliquid API and is added by us for builder convenience.

⚠️ This is an add-on endpoint - access has to be purchased separately.

Overview

spotSnapshot endpoint allows you to access all balances of Hypercore users that hold spot assets.

There are two ways to access the data:

  1. Metadata Endpoint (Fast): Check for updates without downloading data

  2. Snapshots Endpoint (Heavy): Download actual market snapshot data

Efficient polling pattern

To minimize bandwidth and server load, you should:

  1. Poll the metadata endpoint to check for updates

  2. Only call the snapshots endpoint when data has changed

  3. Cache the snapshot ID locally to avoid unnecessary downloads

Dependencies and best practices

Dependencies

JavaScript

  • zstd: For decompression (e.g., fzstd, @gera2ld/zstd)

  • msgpack: For decoding (e.g., @msgpack/msgpack)

Python

  • zstd: For decompression (e.g., zstandard)

  • msgpack: For decoding (e.g., msgpack)

  • aiohttp: For async HTTP requests


Best Practices

  1. Always poll metadata first - Don't skip the lightweight metadata check.

  2. Cache snapshots locally - Avoid unnecessary downloads of large files.

  3. Handle errors gracefully - Network issues are common; implement retry logic.

  4. Use appropriate poll intervals - 5-10 seconds is usually sufficient.

  5. Request specific markets - Don't use ['ALL'] unless you truly need all data.

  6. Monitor bandwidth usage - Snapshots can be large (1-35MB+) compressed.

Error handling
  • 404: No snapshots are available yet. Wait and retry.

  • 500: A server error occurred. Retry with exponential backoff.

  • Network errors: Implement retry logic with jitter to avoid overwhelming the server.

  • Parse errors: Log the issue and continue using cached data if available.

Spot Snapshot Metadata (Fast)

  • Endpoint: POST /info

  • Purpose: Check if snapshots have been updated

  • Response Time: ~1ms

Request

Response

Spot Snapshots (Heavy)

  • Endpoint: POST /info

  • Purpose: Download market snapshot data

  • Response Time: ~100ms+

Request

Response Headers

  • Single Market: x-payload-format: msgpack, Content-Encoding: zstd

  • Multiple Markets: x-payload-format: multi-zstd, x-compression: inner-zstd

Data Format

Single Market Response

Format: Raw zstd-compressed MessagePack data

Decompressed Structure:

ℹ️ Balance Tuple Format The format of the balances array has 2 values in the following order:

Multiple Markets Response

Format: Custom binary format with length prefixes

Binary Structure:

Implementation examples

Note: Make sure to set HYDROMANCER_API_KEY in your .env file

Note: Make sure to download required packages

Last updated