Skip to content

C# SDK

This guide describes version 2 of STX.Sdk.

STX.Sdk is the .NET SDK for the STX exchange. Read markets, place and cancel orders, follow your account, and stream the WebSocket channels, with every request signed by your API key and every response typed. Response fields are described in the API reference. It targets .NET 10.

dotnet add package STX.Sdk
using STX.Sdk;
// Reads your API key and exchange from STX_* environment variables or ~/.stx/credentials.
using var client = new STXClient();
var me = await client.GetMeAsync();
var page = await client.GetMarketsAsync(status: ["open"], limit: 5);
Console.WriteLine($"{me.UserId} {string.Join(", ", page.Select(m => m.Symbol))}");
// bc2d4b34-5d21-4a2a-8af6-d1ad3846ac3f STXNCAAF-26OCT212000NMSUSHSU-GAMESHSU, STXNBA-26OCT212200PHXPOR-GAMEPOR, ...

Authentication shows how to give the client your API key, and Environments lists the exchanges and where to get a key. What you can do maps every feature to its SDK calls and shows which exchange has which.

Amounts come back as decimal strings, exactly as the API sends them (order.Price == "0.0100"), and orders take strings too: price: "0.58", quantity: "100". Parse with decimal.Parse(value, CultureInfo.InvariantCulture) when you need arithmetic, never double.

Response models are generated from the REST specification. Properties are PascalCase (order.ClientOrderId) and every one is nullable; fields the SDK does not know yet are kept in AdditionalProperties.

Released under the MIT license.

STX is operated by XV Exchange, LLC, a Designated Contract Market regulated by the U.S. Commodity Futures Trading Commission (CFTC). Contracts traded on STX are cleared by XV Clearing, LLC, a CFTC-registered Derivatives Clearing Organization. Trading involves substantial risk of loss and may not be appropriate for everyone. Members risk losing the cost to enter any transaction, including fees. Consider whether trading is appropriate for you in light of your experience and financial resources. Nothing on this site is investment advice or a recommendation to trade. Past performance is not indicative of future results.

© 2026 STX. All rights reserved.llms.txtllms-full.txtView as Markdown
Docs version v1.10.5