Expand description
Provides an ergonomic wrapper around the dYdX v4 Indexer REST API – https://docs.dydx.exchange/api_integration-indexer/indexer_api.
This module exports two complementary HTTP clients following the standardized two-layer architecture pattern established in OKX, Bybit, and BitMEX adapters:
DydxRawHttpClient: Low-level HTTP methods matching dYdX Indexer API endpoints.DydxHttpClient: High-level methods using Nautilus domain types with instrument caching.
§Two-Layer Architecture
The raw client handles HTTP communication, rate limiting, retries, and basic response parsing.
The domain client wraps the raw client in an Arc, maintains an instrument cache using DashMap,
and provides high-level methods that work with Nautilus domain types.
§Key Responsibilities
- Rate-limiting based on the public dYdX specification.
- Zero-copy deserialization of large JSON payloads into domain models.
- Conversion of raw exchange errors into the rich
DydxHttpErrorenum. - Instrument caching with standard methods:
cache_instruments(),cache_instrument(),get_instrument().
§Important Note
The dYdX v4 Indexer REST API does NOT require authentication or request signing. All endpoints are publicly accessible using only wallet addresses and subaccount numbers as query parameters. Order submission and trading operations use gRPC with blockchain transaction signing, not REST API.
§Official documentation
| Endpoint | Reference |
|---|---|
| Market data | https://docs.dydx.exchange/api_integration-indexer/indexer_api#markets |
| Account data | https://docs.dydx.exchange/api_integration-indexer/indexer_api#accounts |
| Utility endpoints | https://docs.dydx.exchange/api_integration-indexer/indexer_api#utility |
Structs§
- Dydx
Http Client - Provides a higher-level HTTP client for the dYdX v4 Indexer REST API.
- Dydx
RawHttp Client - Provides a raw HTTP client for interacting with the dYdX v4 Indexer REST API.
- Dydx
Response - Represents a dYdX HTTP response wrapper.
Statics§
- DYDX_
REST_ QUOTA - Default dYdX Indexer REST API rate limit.