This deployment is read-only. It continuously refreshes local OKX candles, rebuilds the ETH nextgen+micro signal intent, records account/position snapshots when credentials are present, writes heartbeat files, and submits no orders.
Order execution remains blocked until the persistent virtual state and target-position reconciliation are implemented.
scripts/run_eth_nextgen_micro_observer.pydeploy/eth-nextgen-micro-observer.servicedeploy/install_eth_nextgen_micro_observer.shTarget host: 66.253.42.170
Install path: /opt/okx-codex-trader
Environment file: /etc/okx-codex-trader/okx.env
Service: eth-nextgen-micro-observer.service
rsync -a --delete --exclude .git --exclude .venv --exclude .pytest_cache --exclude data --exclude var ./ ubuntu@66.253.42.170:/tmp/okx-codex-trader/
ssh ubuntu@66.253.42.170 'cd /tmp/okx-codex-trader && bash deploy/install_eth_nextgen_micro_observer.sh'
Then edit credentials on the server:
sudo nano /etc/okx-codex-trader/okx.env
sudo systemctl restart eth-nextgen-micro-observer.service
systemctl status eth-nextgen-micro-observer.service --no-pager
journalctl -u eth-nextgen-micro-observer.service -f
cat /opt/okx-codex-trader/var/eth-nextgen-micro/heartbeat.json
tail -f /opt/okx-codex-trader/var/eth-nextgen-micro/observer-events.jsonl
Do not add live order submission to this service until all of these are true:
0, 0.5, or 1.0.max_margin_usdt cap is enforced.The live executor should be a separate service from this observer. The observer answers only: latest completed candles, selected engine, intended signal, and current account snapshot.
The executor should process only completed 15m candles. For each candle it should:
0.5, long 1.0, short 0.5, or short 1.0.The first live version should use a hard small margin cap and market/reduce-only orders only. Price-distributed TWAP entry can be added after target reconciliation and fill logging are proven live.
The strategy logic is moving out of ad hoc scripts into package modules:
okx_codex_trader.eth_nextgen_micro builds the ETH nextgen+micro signal payload.okx_codex_trader.live_execution maintains runtime strategy state, converts nextgen virtual legs into one net target position, normalizes OKX positions into strategy units, and builds a pure delta plan.okx_codex_trader.live_execution.render_market_order_bodies converts a tested delta plan into OKX market order bodies with deterministic client order ids and a hard new-margin cap.okx_codex_trader.okx_client.submit_market_order_body can submit a prebuilt market order body, but no deployed service or CLI calls it yet.scripts/run_eth_nextgen_micro_observer.py remains read-only. It writes runtime state and target-position diagnostics, but it still submits no orders.scripts/run_eth_nextgen_micro_executor.py builds a dry-run execution snapshot. It reads the strategy payload and OKX account state, renders order bodies only when current and target positions are known, and always reports orders_submitted: 0.Live order submission is still intentionally unreachable from the daemon. The next required boundary is an executor command or service that calls the submit method, records client order ids, and verifies fills.
Dry-run executor example:
python scripts/run_eth_nextgen_micro_executor.py --margin-per-unit-usdt 5 --max-new-margin-usdt 5