Skip to main content
STX.Sdk is the official .NET SDK for the SportsX trading exchange. It wraps the GraphQL HTTP API and Phoenix WebSocket channels as a set of strongly-typed services you register into the .NET dependency-injection container and resolve anywhere in your app. The primary audience is market makers building low-latency .NET trading bots, but any integrator targeting SportsX from a .NET app can use it.
Targets net8.0. Published to NuGet as STX.Sdk. MIT-licensed.

What the SDK includes

One ConfigureSTXServices call registers every component the SDK provides:
  • HTTP services for every exchange operation: login, markets, events, orders, trades, settlements, profile, terms-and-conditions, and geolocation.
  • WebSocket channel wrappers for real-time data: portfolio balance, active orders, active trades, positions, market price ticks, and user info.
  • Automatic session management: background services keep the JWT refreshed and the geolocation token current so your bot stays connected without manual intervention.

Quick look

dotnet add package STX.Sdk
// Register all services once in Program.cs
services.ConfigureSTXServices(
    graphQLUri:  "https://in-api-staging.stxapp.io/graphiql",
    channelsUri: "wss://in-api-staging.stxapp.io/socket/websocket?token={0}&vsn=2.0.0");

// Resolve and use anywhere via DI
var markets = await marketService.GetMarketInfosAsync();

Where to go next

Installation

NuGet setup, supported runtimes, and package dependencies.

Authentication

Email/password login, 2FA, token refresh, and background session keep-alive.

Configuration

DI registration, environment endpoints, and logging setup.

Market data

Query markets, events, sports, and competitions.

Trading

Place, batch, and cancel orders; query order and trade history.

WebSockets

Phoenix channels for real-time orders, trades, balance, and price ticks.

Settlements

Fetch settlement history and subscribe to live settlement events.

Errors & retries

Typed exceptions, automatic Polly retries, and rate-limit guidance.

Example apps

Two reference apps ship alongside the SDK:
  • cssdk-console — CLI trading bot demonstrating login, market subscriptions, and order placement from a BackgroundService.
  • cssdk-demo — ASP.NET web API that exposes the SDK services over HTTP for manual testing.
Both are MIT-licensed and make good starting points for your own project:
git clone https://github.com/betstackai/cssdk-console.git
git clone https://github.com/betstackai/cssdk-demo.git