Settings & Verification Flow
Legend
- Red nodes → Blocking decisions
- Yellow nodes → Warning states
- Green nodes → Verified/fresh state
State Refresh Behavior
- Auto-refresh: Every 30 seconds (configurable)
- Force Refresh: When explicitly requested (UI refresh button)
- Cache: In-memory cache keyed by
userId_accountId with maxAgeSeconds (default: 30s)
- Staleness: State marked stale if age >
maxAgeSeconds
Verification Behavior
- Verification Enabled:
verify_topstepx_state = true (default)
- Tolerance: 1% difference allowed
- Fail-Closed: Blocks trading on mismatch if
fail_closed = true (default)
- Warning Mode: Logs warning but continues if
fail_closed = false
Warning Badges
- Stale State: Shown if
fetchedAt age > 10 seconds
- Mismatch: Shown if verification mismatch detected (even if
fail_closed = false)
- 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