Skip to content

Add Binance symbol-sync validation and VPS requirements hardening#2

Open
EJMM17 wants to merge 1 commit intomainfrom
codex/review-code-for-bugs-before-mainet-deployment-qkr4yp
Open

Add Binance symbol-sync validation and VPS requirements hardening#2
EJMM17 wants to merge 1 commit intomainfrom
codex/review-code-for-bugs-before-mainet-deployment-qkr4yp

Conversation

@EJMM17
Copy link
Owner

@EJMM17 EJMM17 commented Feb 16, 2026

Motivation

  • Prevent runtime failures caused by misformatted or non-tradable Binance pairs by validating configured symbols before live trading starts.
  • Make the Binance adapter tolerant of common symbol formats and reduce surprises from exchange responses during order/candle/ticker flows.
  • Provide clear VPS requirements and preflight steps so deployments to a VPS are stable and avoid timestamp/recvWindow issues.

Description

  • Added symbol normalization and symbol-sync APIs to the Binance adapter: _normalize_symbol(), get_exchange_symbols() (5 minute cache) and validate_symbols() in darwin_agent/exchanges/binance.py and applied normalization in get_candles, get_ticker, place_order, close_position, and set_leverage.
  • Added startup preflight validate_exchange_symbol_sync() in darwin_agent/main.py and invoked it after router.connect_all() so mode=live fails fast on invalid/non-tradable Binance symbols.
  • Hardened router lifecycle compatibility by ensuring ExchangeRouter exposes backward-compatible hooks (connect_all, get_all_statuses, disconnect_all, close) and adjusted set_leverage result propagation in darwin_agent/exchanges/router.py.
  • Added a Spanish VPS runbook MAINNET_VPS_RUNBOOK_ES.md with minimum VPS requirements, secure env handling, systemd service, preflight checks and update/kill-switch procedures.
  • Added/extended tests in test_binance_adapter_safety.py, test_main_runtime_compat.py, and test_router_set_leverage.py covering symbol normalization, exchangeInfo caching, validation behavior, and router hooks.

Testing

  • Ran pytest -q test_binance_adapter_safety.py test_main_runtime_compat.py test_router_set_leverage.py and all tests passed (12 passed).
  • Ran python -m compileall -q darwin_agent with no errors reported.

Codex Task

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant