nautechsystems/nautilus_trader · error · PyValueError

Hyperliquid does not provide historical quotes via HTTP API

Error message

Hyperliquid does not provide historical quotes via HTTP API

What it means

Hyperliquid's HTTP API does not expose historical quote ticks, so the Python HTTP client's request_quote_ticks is intentionally a stub that always returns an error via a rejected future. This is a supported-operation limitation of the adapter, not a transient failure: any call to this method will always fail with this message. Use the WebSocket data channel (quote ticks via subscription) or a different data source instead.

Source

Thrown at crates/adapters/hyperliquid/src/python/http.rs:255

                let py_list = PyList::new(py, &py_instruments)?;
                Ok(py_list.into_any().unbind())
            })
        })
    }

    #[pyo3(name = "request_quote_ticks", signature = (instrument_id, start=None, end=None, limit=None))]
    fn py_request_quote_ticks<'py>(
        &self,
        py: Python<'py>,
        instrument_id: InstrumentId,
        start: Option<jiff::Timestamp>,
        end: Option<jiff::Timestamp>,
        limit: Option<u32>,
    ) -> PyResult<Bound<'py, PyAny>> {
        let _ = (instrument_id, start, end, limit);
        pyo3_async_runtimes::tokio::future_into_py(py, async move {
            Err::<Vec<u8>, _>(to_pyvalue_err(anyhow::anyhow!(
                "Hyperliquid does not provide historical quotes via HTTP API"
            )))
        })
    }

    #[pyo3(name = "request_trade_ticks", signature = (instrument_id, start=None, end=None, limit=None))]
    fn py_request_trade_ticks<'py>(
        &self,
        py: Python<'py>,
        instrument_id: InstrumentId,
        start: Option<jiff::Timestamp>,
        end: Option<jiff::Timestamp>,
        limit: Option<u32>,
    ) -> PyResult<Bound<'py, PyAny>> {
        let _ = (instrument_id, start, end, limit);
        pyo3_async_runtimes::tokio::future_into_py(py, async move {
            Err::<Vec<u8>, _>(to_pyvalue_err(anyhow::anyhow!(
                "Hyperliquid does not provide historical market trades via HTTP API"

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Subscribe to quotes via the Hyperliquid WebSocket client instead of requesting historical quotes
  2. Record/subscribe to quotes live and persist them yourself if you need historical quotes
  3. Route historical quote requests to a different data client/adapter that supports them
  4. For trade history use available endpoints where supported (note request_trade_ticks is also stubbed; candle/ohlcv endpoints may cover the need)

Example fix

// before
quotes = client.request_quote_ticks(instrument_id, start, end)  # always errors
// after
# subscribe live instead
client.subscribe_quote_ticks(instrument_id)
# or request candles which Hyperliquid does support via HTTP
Defensive patterns

Strategy: fallback

Validate before calling

# Python: check capability before requesting historical quotes
if isinstance(data_client, HyperliquidDataClient) and request_type == QuoteTicks:
    raise UnsupportedOperation("use WebSocket subscription for Hyperliquid quotes")

Type guard

def supports_historical_quotes(client) -> bool:
    return not type(client).__name__.startswith("Hyperliquid")

Try / catch

try:
    quotes = client.request_quote_ticks(instrument_id, start, end)
except ValueError as e:
    if "historical quotes" in str(e):
        client.subscribe_quote_ticks(instrument_id)  # fallback: live stream
    else:
        raise

Prevention

When it happens

Trigger: Calling the Hyperliquid HTTP data client's request_quote_ticks from Python (or via the DataEngine's historical-request path routed to it), with any instrument_id/start/end/limit arguments.

Common situations: Configuring a Hyperliquid data client as the source for historical quote requests (e.g. backfill or LoadDataEngine-style queries); migrating code from another adapter (Binance etc.) where quote history exists; assuming parity between trade and quote endpoints.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/bc50c12c3fa5860b. Report an issue: GitHub.