Skip to main content

Module consts

Module consts 

Source
Expand description

Static constants for the Derive adapter.

Protocol constants (DOMAIN_SEPARATOR, ACTION_TYPEHASH, per-action module addresses) are sourced from the “Protocol Constants” reference at https://docs.derive.xyz/reference/protocol-constants. Both mainnet and testnet values are populated; per-instance overrides on crate::config::DeriveExecClientConfig take precedence.

Constants§

ACTION_TYPEHASH
EIP-712 action typehash. Identical across networks per Derive’s published Protocol Constants.
DECIMAL_SCALE
Fixed-point scale used by all on-chain decimal fields (1e18).
DEPOSIT_MODULE_ADDRESS_MAINNET
Deposit module contract address (mainnet).
DEPOSIT_MODULE_ADDRESS_TESTNET
Deposit module contract address (testnet).
DERIVE
Venue identifier string.
DERIVE_ACCOUNT_REGISTRATION_TIMEOUT_SECS
Default timeout for blocking on account registration during execution client connect(). Matches the BitMEX / Bybit / OKX adapters’ 30-second budget.
DERIVE_CANDLES_DEFAULT_LIMIT
DERIVE_CANDLES_MAX_PAGES
DERIVE_NAUTILUS_REFERRAL_CODE
Referral code for order attribution (zero additional fees), see https://docs.derive.xyz/reference/api-broker for further details.
DERIVE_TRADES_PAGE_SIZE
DOMAIN_SEPARATOR_MAINNET
EIP-712 domain separator (mainnet).
DOMAIN_SEPARATOR_TESTNET
EIP-712 domain separator (testnet).
HEADER_LYRA_SIGNATURE
REST authentication header carrying the session-key signature.
HEADER_LYRA_TIMESTAMP
REST authentication header carrying the signed timestamp.
HEADER_LYRA_WALLET
REST authentication header carrying the Derive Chain smart-contract wallet.
HTTP_TIMEOUT
MIN_SIGNATURE_TTL
Minimum signature TTL the venue accepts for self-custodial actions.
RECONNECT_BACKOFF_FACTOR
RECONNECT_BASE_BACKOFF
RECONNECT_JITTER_MS
RECONNECT_MAX_BACKOFF
RECONNECT_TIMEOUT
REST_URL_MAINNET
REST_URL_TESTNET
TRADE_MODULE_ADDRESS_MAINNET
Trade module contract address (mainnet).
TRADE_MODULE_ADDRESS_TESTNET
Trade module contract address (testnet).
TRANSFER_MODULE_ADDRESS_MAINNET
Transfer module contract address (mainnet).
TRANSFER_MODULE_ADDRESS_TESTNET
Transfer module contract address (testnet).
TRIGGER_ORDER_SIGNATURE_TTL
Signature TTL used for Derive trigger orders.
WITHDRAW_MODULE_ADDRESS_MAINNET
Withdrawal module contract address (mainnet).
WITHDRAW_MODULE_ADDRESS_TESTNET
Withdrawal module contract address (testnet).
WS_DISCONNECT_TIMEOUT
WS_HEARTBEAT_SECS
WS_REQUEST_TIMEOUT
Maximum wait for a JSON-RPC response on the WebSocket transport before the request outcome is treated as unknown, so a silent venue cannot hang connect() or an order write. Matches HTTP_TIMEOUT.
WS_URL_MAINNET
WS_URL_TESTNET

Statics§

DERIVE_CLIENT_ID
Static client ID instance.
DERIVE_VENUE
Static venue instance.

Functions§

domain_separator_for
Returns the EIP-712 domain separator constant for the configured environment.
trade_module_address_for
Returns the Trade module contract address constant for the configured environment.