Give each bot its own home
Use a separate persistent data directory for each bot instance. For dYdX, separate strategy subaccounts also make positions easier to reconcile. Do not run multiple instances against the same saved state.
Keep the journal with the state
Compose mounts ./data. state.json stores strategy progress; exchange.json records client IDs before submission. Back them up together. For TradingView, include jobs.sqlite3 and SQLite journal files. Stop the bot for a consistent backup, and remember that exchange orders can still execute while it is stopped.
Inspect before restarting
If a request times out, the exchange might already have accepted it. The bot reuses the recorded client ID to reconcile that order rather than treating a timeout as permission for a second trade. If reconciliation fails, inspect open orders, fills, positions, logs and saved state before restarting. Do not delete state to bypass the check.
Handle partial fills deliberately
Recovery rules vary. Grid and Martingale stop on certain partial-fill cases. OTO stops if siblings execute unexpectedly. DCA records a partial IOC execution without topping it up. Binance grid accounts for partial sibling fills before rebuilding. Read the guide for the actual bot, rather than assuming every cancellation is unfilled.
Observe the process and the exchange
docker compose ps
docker compose logs --tail=100
docker compose logs -fLogs describe software activity. Exchange order and fill records establish what actually executed. Include funding, network fees and unrealised positions when reviewing account-level results; a strategy's reported matched or realised profit is not total account P&L.
Change configuration between reconciled runs
Stop the process, inspect exchange orders and positions, and reconcile the current strategy before editing settings. Saved state binds the active settings and account. Keep an archive before migrating. Stop or cancel outstanding orders explicitly when required.
Migrate from dYdX v3
The updated bots use dYdX Chain. v3 API credentials, STARK keys and saved state are not compatible. Reconcile old exchange orders and positions, archive the old state, and configure a Chain wallet, endpoints and fresh data directory. This is not an automatic state conversion.
Run the offline tests
docker build --target test -t bot-test .
docker run --rm --network none bot-testUse the repository's Docker test target. Networking is disabled for the suite; credentials are not needed. Passing tests does not prove live exchange availability or trading returns.
Update carefully
Read the repository changes before pulling an update. Keep a consistent backup, rebuild the image and inspect recovery on testnet. Maintain your server, rotate compromised credentials and monitor disk space, memory, process health and failed execution.
Open a bot guide