Skip to main content

Module endpoint_router

Module endpoint_router 

Source
Expand description

HyperLiquid-specific endpoint router trait.

This module provides the HyperLiquidEndpointRouter trait for routing API requests to the correct HyperLiquid endpoints.

§HyperLiquid API Structure

HyperLiquid uses the simplest endpoint structure among all supported exchanges:

  • REST: api.hyperliquid.xyz - Single REST endpoint for all operations
  • WebSocket: api.hyperliquid.xyz/ws - Single WebSocket endpoint

Unlike centralized exchanges, HyperLiquid is a decentralized perpetual futures exchange built on its own L1 blockchain. It uses:

  • Ethereum wallet private keys for authentication (EIP-712 typed data signatures)
  • Wallet addresses as account identifiers (no registration required)
  • USDC as the sole settlement currency

§Testnet/Sandbox Mode

HyperLiquid provides a separate testnet environment:

  • REST: api.hyperliquid-testnet.xyz
  • WebSocket: api.hyperliquid-testnet.xyz/ws

§Example

use ccxt_exchanges::hyperliquid::{HyperLiquid, HyperLiquidEndpointRouter};

let exchange = HyperLiquid::builder()
    .testnet(false)
    .build()
    .unwrap();

// Get REST endpoint
let rest_url = exchange.rest_endpoint();
assert!(rest_url.contains("api.hyperliquid.xyz"));

// Get WebSocket endpoint
let ws_url = exchange.ws_endpoint();
assert!(ws_url.contains("api.hyperliquid.xyz/ws"));

Traits§

HyperLiquidEndpointRouter
HyperLiquid-specific endpoint router trait.