Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.quanux.org/llms.txt

Use this file to discover all available pages before exploring further.

The TopstepX integration gives QuanuX full access to the TopstepX platform: account management, order execution, position tracking, and real-time market data. It is split into two decoupled components that run alongside the QuanuX core. The TopstepX extension handles REST API calls — authentication, orders, account queries, and trade history. The SignalR bridge maintains a persistent WebSocket connection to TopstepX’s real-time hubs, streaming market data and user events into the QuanuX message bus.

Architecture

The two components are independent. You can run the REST extension without the SignalR bridge if you only need account management and order placement, or run just the bridge if you only need real-time data.

Prerequisites

You need three pieces of information from TopstepX before you can connect:
  • Username: your TopstepX account username
  • Password: your TopstepX account password
  • API key: your TopstepX API key, available from the TopstepX dashboard

Setup

1

Store your credentials

Use quanuxctl to save your TopstepX credentials to the OS keyring. These are never written to a file on disk.
quanuxctl topstepx user "your_topstepx_username"
quanuxctl topstepx password "your_topstepx_password"
quanuxctl topstepx apikey "your_topstepx_api_key"
Never store TopstepX credentials in environment files or commit them to version control. Use quanuxctl exclusively.
2

Verify your environment

Confirm that all credentials are accessible:
quanuxctl topstepx env
This command reads each credential from the keyring and prints its status without revealing the values.
3

Install Python dependencies

The TopstepX REST extension is Python-based. Install its dependencies:
quanuxctl topstepx install
This installs the packages required by extensions/python/topstepx.
4

Generate a bridge key

Generate a key so both extensions can authenticate to the QuanuX core:
  1. Open the QuanuX web interface.
  2. Go to Settings → QuanuX Extensions.
  3. Click Generate Key and store the value:
quanuxctl secrets set QUANUX_TOPSTEP_BRIDGE_KEY "your_key_here"
5

Start the SignalR bridge

Check the bridge status, then start it:
quanuxctl bridge status
quanuxctl bridge run
The bridge connects to both the user hub and the market hub on startup. Once running, real-time events flow into the QuanuX message bus automatically.

Credentials reference

All credentials are managed through quanuxctl and stored in the OS keyring under the following keys:
Keyring keyquanuxctl commandDescription
QUANUX_TOPSTEP__USERNAMEquanuxctl topstepx userTopstepX account username
QUANUX_TOPSTEP__PASSWORDquanuxctl topstepx passwordTopstepX account password
QUANUX_TOPSTEP__API_KEYquanuxctl topstepx apikeyTopstepX API key

Endpoint configuration

The extensions connect to TopstepX’s production endpoints by default. You can override any endpoint — for example, to point at a simulation environment.
VariableDefaultDescription
QUANUX_TOPSTEP__BASE_API_URLhttps://api.topstepx.comREST API base URL
QUANUX_SIGNALR_USER_HUBhttps://rtc.topstepx.com/hubs/userReal-time user events hub
QUANUX_SIGNALR_MARKET_HUBhttps://rtc.topstepx.com/hubs/marketReal-time market data hub
To override an endpoint for a simulation environment:
quanuxctl topstepx user-hub "https://sim-rtc.topstepx.com/hubs/user"
quanuxctl topstepx market-hub "https://sim-rtc.topstepx.com/hubs/market"

Managing the SignalR bridge

The bridge runs as a separate process managed by QuanuX. It maintains a persistent WebSocket connection to both TopstepX real-time hubs.
quanuxctl bridge status
The SignalR bridge uses a Node.js worker by default to handle TopstepX’s proprietary SignalR protocol. A Flask fallback is also available if Node.js is not present.

REST extension modules

The TopstepX Python extension lives in extensions/python/topstepx/src. Its modules correspond directly to the TopstepX API surface:
ModulePurpose
auth.pyAuthentication and token lifecycle management
orders.pyOrder placement and management
positions.pyPosition tracking
history.pyHistorical bar retrieval

REST API endpoints

The QuanuX server exposes the following routes for the TopstepX integration. These are used internally by the QuanuX core and can also be called directly for debugging.
POST /topstep/loginAuthenticates with TopstepX and returns a session token.
{
  "username": "your_username",
  "password": "your_password",
  "apikey": "your_api_key"
}