Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Logs & State

State files and logs are stored in the Docker named volume opentrader_state (persists across restarts):

# Stream logs in realtime
docker logs opentrader -f

# View state file
docker exec opentrader cat /app/state/opentrader_state.json

# Tail bot log
docker exec opentrader tail -f /app/state/opentrader.log

Main files

  • /app/state/opentrader.log: runtime activity log
  • /app/state/opentrader_state.json: live runtime state for open trades and counters
  • /app/state/opentrader.db: SQLite database for historical and scanner data

SQLite databases / tables

The main SQLite file is usually:

/app/state/opentrader.db

Key tables:

TablePurposePopulated by
pump_signalsPump Momentum alert history + later outcome fieldsapp/strategies/pump_signals_db.py
market_context_snapshotsHistorical MarketContext audit snapshotsapp/market/context_db.py
compression_statePersistent compression-state memoryapp/market/context_db.py
watch_statePersistent watch-regime memoryapp/market/context_db.py
tradesClosed trade historyapp/trade_history.py
pending_entriesManual LIMIT entries waiting for fillapp/trade_history.py

Useful inspection commands

# List SQLite tables
docker exec opentrader sqlite3 /app/state/opentrader.db '.tables'

# View recent closed trades
docker exec opentrader sqlite3 /app/state/opentrader.db \
  'select symbol, direction, pnl, closed_at from trades order by id desc limit 10;'

# View recent pump alerts
docker exec opentrader sqlite3 /app/state/opentrader.db \
  'select symbol, stage, confidence, timestamp_signal from pump_signals order by timestamp_signal desc limit 10;'