Skip to main content
.NET 8. Targets net8.0. Published to NuGet as STX.Sdk. MIT-licensed.
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 services you register into the .NET dependency-injection container and resolve anywhere in your app. One package, one ConfigureSTXServices call, dozens of typed service + channel clients.
  • Services for everything the exchange exposes: login, markets, events, orders, trades, settlements, profile, terms-and-conditions, geolocation.
  • Channel wrappers for real-time: portfolio balance, active orders/trades, positions, market updates, user info.
  • Automatic session management: optional background services keep the JWT refreshed and the geolocation token current.
dotnet add package STX.Sdk
// Register once in Program.cs / Startup.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
var markets = await marketService.GetMarketInfosAsync();
Primarily targeted at market makers writing low-latency .NET trading bots, but the surface is generic — any integrator building a .NET app against SportsX can use it.

Where to go next

Quickstart

Install, authenticate, and make your first call in under five minutes.

Installation

NuGet, supported runtimes, dependencies.

Authentication

Email/password login, 2FA, token refresh, background session.

Configuration

DI registration, endpoint URIs per environment.

Market data

Query markets, events, sports, and competitions.

Trading

Place and cancel orders; fetch order/trade history.

WebSockets

Phoenix channels for real-time orders, trades, balance, markets.

Errors & retries

Exceptions you’ll encounter and the built-in Polly retry.

Example apps

Two reference apps ship alongside the SDK:
  • cssdk-console — CLI trading bot showing login, market subscriptions, and order placement from a BackgroundService.
  • cssdk-demo — ASP.NET web API exposing the services over HTTP for manual poking.
Both are MIT-licensed. Clone either as a starting point:
git clone https://github.com/betstackai/cssdk-console.git
git clone https://github.com/betstackai/cssdk-demo.git