dYdX
The dYdX adapter.
Config
Define the dYdX configuration classes.
class DYDXDataClientConfig
Bases: LiveDataClientConfig
Configuration for DYDXDataClient
instances.
- Parameters:
- wallet_address (str , optional) – The dYdX wallet address.
If
None
then will source DYDX_WALLET_ADDRESS or DYDX_TESTNET_WALLET_ADDRESS environment variables. - testnet (bool , default False) – If the client is connecting to the dYdX testnet API.
- update_instruments_interval_mins (PositiveInt or None , default 60) – The interval (minutes) between reloading instruments from the venue.
- max_ws_send_retries (int , optional) – Maximum retries when sending websocket messages.
- max_ws_retry_delay_secs (float , optional) – The delay (seconds) between retry attempts when resending websocket messages.
- wallet_address (str , optional) – The dYdX wallet address.
If
wallet_address : str | None
is_testnet : bool
update_instruments_interval_mins : Annotated[int, msgspec.Meta(gt=0)] | None
max_ws_send_retries : Annotated[int, msgspec.Meta(gt=0)] | None
max_ws_retry_delay_secs : Annotated[float, msgspec.Meta(gt=0.0)] | None
dict() → dict[str, Any]
Return a dictionary representation of the configuration.
- Return type: dict[str, Any]
classmethod fully_qualified_name() → str
Return the fully qualified name for the NautilusConfig class.
- Return type: str
handle_revised_bars : bool
property id : str
Return the hashed identifier for the configuration.
- Return type: str
instrument_provider : InstrumentProviderConfig
json() → bytes
Return serialized JSON encoded bytes.
- Return type: bytes
json_primitives() → dict[str, Any]
Return a dictionary representation of the configuration with JSON primitive types as values.
- Return type: dict[str, Any]
classmethod parse(raw: bytes | str) → Any
Return a decoded object of the given cls.
- Parameters:
- cls (type) – The type to decode to.
- raw (bytes or str) – The raw bytes or JSON string to decode.
- Return type: Any
routing : RoutingConfig
validate() → bool
Return whether the configuration can be represented as valid JSON.
- Return type: bool
class DYDXExecClientConfig
Bases: LiveExecClientConfig
Configuration for DYDXExecutionClient
instances.
- Parameters:
- wallet_address (str , optional) – The dYdX wallet address.
If
None
then will source DYDX_WALLET_ADDRESS or DYDX_TESTNET_WALLET_ADDRESS environment variables. - subaccount (int , optional) – The subaccount number. The venue creates subaccount 0 by default.
- mnemonic (str , optional) – The mnemonic string which is used to generate the private key.
The private key is used to sign transactions like submitting orders.
If
None
then will source DYDX_MNEMONIC or DYDX_TESTNET_MNEMONIC environment variables. - base_url_http (str , optional) – The HTTP client custom endpoint override.
- base_url_ws (str , optional) – The WebSocket client custom endpoint override.
- is_testnet (bool , default False) – If the client is connecting to the dYdX testnet API.
- max_retries (PositiveInt , optional) – The maximum number of times a submit, cancel or modify order request will be retried.
- retry_delay (PositiveFloat , optional) – The delay (seconds) between retries. Short delays with frequent retries may result in account bans.
- wallet_address (str , optional) – The dYdX wallet address.
If