Skip to content

What you can do

One SDK works against every STX exchange. Not every exchange has every feature yet. A call that needs a feature the exchange does not have throws STXNotAvailableException, and GetCapabilitiesAsync() tells you up front, so the same code runs against Ontario production today and picks up new features as each exchange gets them.

Feature Id SDK calls Guide
Markets, events and prices GetMarketsAsync, GetAllMarketsAsync, GetMarketAsync, GetEventsAsync, GetAllEventsAsync; channels OrderbookAsync, TickerAsync, TradesAsync, MarketAsync, MarketsAsync, MarketStatsAsync, MarketUpdatesAsync Markets, WebSockets
Trading PlaceOrderAsync, PlaceOrdersAsync, CancelOrderAsync, CancelOrdersAsync, CancelAllOrdersAsync, GetOrdersAsync, GetOrderAsync; cancel-on-disconnect on OrdersAsync Trading
Your account GetMeAsync, GetBalanceAsync, GetPositionsAsync, GetFillsAsync, GetSettlementsAsync, GetAccountMarketStatsAsync, GetDepositsAsync, GetWithdrawalsAsync, GetAdjustmentsAsync, GetFeesAsync, GetLoyaltyAsync, AcceptTermsAsync; AccountViewAsync and the account channels Portfolio, WebSockets
Combos combos RfqAsync, ComboQuoteAsync Combos
Leaderboard leaderboard GetLeaderboardAsync, GetLeaderboardStandingAsync, UpdateProfileAsync
Market types market_types GetMarketTypesAsync
Event players event_players GetEventPlayersAsync
Create markets markets.create CreateMarketsAsync Create markets

GetCapabilitiesAsync() also reports oauth, oauth.member, oauth.app, connect, terms.stx_page and markets.create, from the exchange’s published OAuth metadata.

using var client = new STXClient();
var caps = await client.GetCapabilitiesAsync();
foreach (var f in caps.Features.Values)
Console.WriteLine($"{f.Id}: {f.Available?.ToString() ?? "unknown"} ({f.How})");
// leaderboard: False (GET /api/v1/leaderboard?limit=1 answers 404 'Leaderboard is not enabled')
// combos: True (rfq join answered 'unauthorized' (the channel exists))

Every probe is a read: discovery documents, GET routes, and one channel join that is left at once. Nothing is created, changed or placed. The answer is cached on the client; refresh: true asks again, and probeChannels: false skips the socket (combos is then unknown).

caps.Available("combos") is true only when the exchange showed it has the feature; a feature that could not be decided is null and counts as not available. caps.Require("combos") throws STXNotAvailableException when the feature is known to be absent.

try
{
var types = await client.GetMarketTypesAsync();
}
catch (STXNotAvailableException ex)
{
Console.WriteLine($"{ex.Feature}: {ex.Message}");
// market_types: Market types are not available on demo.stxapp.ca yet.
}

Nothing else on the client is affected: only the call that needs the feature throws. A channel the exchange does not have throws STXChannelUnavailableException, whose Feature is channel.<name>.