Use staging for anything you’re building.
env="production" trades with real balances — don’t point a new integration at it until you’ve exercised the code path on staging.Prerequisites
- Python 3.11 or newer (
python3 --version) - An STX account that can log into app-staging.on.sportsxapp.com
pip(shipped with Python)
Walkthrough
Set credentials
The SDK reads credentials from three places, in this precedence: keyword arguments → environment variables → For long-lived setups, see Configuration → Profile files.
~/.stx/credentials profile.For a first run, env vars are fastest:Place your first (dry) order
Orders are authenticated the same way; no extra setup.To actually place it, swap
previewOrder for confirmOrder. See Trading for the full surface.What you just did
- Installed
stx-pythonfrom PyPI. - Logged in with email/password — the SDK cached a JWT and will auto-refresh it at minute 59 of each 60-minute window.
- Ran a GraphQL query with a narrowed field
Selection(small payload). - Previewed an order without hitting the order book.
- (Optionally) joined a Phoenix channel for live market updates.
Next steps
Authentication
2FA, long-lived profiles, and how tokens are refreshed.
Market data
Query orderbooks, event metadata, and historical data.
Trading
Place, cancel, and amend orders; fetch positions and fills.
WebSockets
Subscribe to the full catalog of Phoenix channels.

