Crate dydx_grpc_exec

Crate dydx_grpc_exec 

Source
Expand description

gRPC execution test for dYdX adapter.

This binary tests order submission via gRPC to dYdX v4 mainnet. It demonstrates:

  • Wallet initialization from mnemonic
  • gRPC client setup
  • Instrument loading from HTTP API
  • Order submission via gRPC (market and limit orders)
  • Order cancellation via gRPC

Usage:

# Set environment variables
export DYDX_MNEMONIC="your mnemonic here"
export DYDX_GRPC_URL="https://dydx-grpc.publicnode.com:443"  # Optional
export DYDX_HTTP_URL="https://indexer.dydx.trade"  # Optional

**Requirements**:
- Valid dYdX mainnet wallet mnemonic (24 words)
- Mainnet funds in subaccount 0
- Network access to mainnet gRPC and HTTP endpoints

**WARNING**: This connects to mainnet and can place real orders with real funds!

Structsยง

Credentials ๐Ÿ”’

Constantsยง

DEFAULT_INSTRUMENT ๐Ÿ”’
DEFAULT_PRICE ๐Ÿ”’
DEFAULT_QUANTITY ๐Ÿ”’
DEFAULT_SIDE ๐Ÿ”’
DEFAULT_SUBACCOUNT ๐Ÿ”’

Functionsยง

cancel_order_by_client_id ๐Ÿ”’
fetch_open_orders ๐Ÿ”’
generate_client_id ๐Ÿ”’
load_credentials ๐Ÿ”’
main ๐Ÿ”’
place_edge_test_order ๐Ÿ”’
run_all_edge_case_tests ๐Ÿ”’
run_all_edge_tests ๐Ÿ”’
test_batch_cancel ๐Ÿ”’
test_cancel_by_market ๐Ÿ”’
test_cancel_specific ๐Ÿ”’
test_duplicate_cancel ๐Ÿ”’
test_rapid_sequence ๐Ÿ”’
test_replace_order ๐Ÿ”’