# What you can do

> Every feature of the C# SDK, the calls that use it, and which STX exchange has it today.

Source: https://docs.stxapp.io/sdks/csharp/capabilities/

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.

## Features and their calls

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

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

## Ask the exchange

```csharp
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.

## When a feature is not available

```csharp
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>`.
