Skip to main content

Settings & Verification Flow

Legend

  • Red nodes → Blocking decisions
  • Yellow nodes → Warning states
  • Green nodes → Verified/fresh state

State Refresh Behavior

  1. Auto-refresh: Every 30 seconds (configurable)
  2. Force Refresh: When explicitly requested (UI refresh button)
  3. Cache: In-memory cache keyed by userId_accountId with maxAgeSeconds (default: 30s)
  4. Staleness: State marked stale if age > maxAgeSeconds

Verification Behavior

  1. Verification Enabled: verify_topstepx_state = true (default)
  2. Tolerance: 1% difference allowed
  3. Fail-Closed: Blocks trading on mismatch if fail_closed = true (default)
  4. Warning Mode: Logs warning but continues if fail_closed = false

Warning Badges

  1. Stale State: Shown if fetchedAt age > 10 seconds
  2. Mismatch: Shown if verification mismatch detected (even if fail_closed = false)
  3. Assumed Floor: Shown if funded + MLL zero + floorSource = 'assumed'

Key Points

  • Settings validated before save
  • State always fetched from TopstepX in live mode
  • Verification mismatch can block trading (fail-closed) or show warning
  • UI warnings help operators identify potential issues