.NET

Overview

Overview of SSI FastConnect .NET SDK — REST API and WebSocket streaming

.NET SDK for SSI securities trading platform. Supports REST API and WebSocket streaming, using async/await throughout.

Requirements: .NET 8.0+

Source code: github.com/SSI-Securities-Inc/ssi-sdk-dotnet

Package: SSIDeveloper.FastConnect.Sdk (NuGet)

Installation

dotnet add package SSIDeveloper.FastConnect.Sdk

Client Architecture

The SDK uses a modular architecture with 4 specialized clients:

ClientDescriptionRequires
AuthClientAuthentication & token managementConfig
DataClientMarket data (OHLC, indexes, securities)AuthClient (no OTP needed)
TradingClientTrading + portfolio + accountAuthClient (OTP required)
StreamClientRealtime streaming via WebSocketAuthClient (OTP required)

Initialization flow:

Config → AuthClient → AuthenticateAsync(otp) → DataClient / TradingClient / StreamClient

AuthClient is the root client — manages the REST client and tokens, and implements IDisposable. DataClient, TradingClient, and StreamClient all receive AuthClient as a parameter and share the same HTTP connection. All API methods are async and return Task/Task<T>.

Services provided by each client:

ClientServiceAccessDescription
AuthClientTokenManagerauth.TokenManagerAuthentication, OTP, token refresh
DataClientMarketDataServicedata.MarketDataOHLC, indexes, securities
TradingClientTradingServicetrading.TradingPlace/modify/cancel orders, max buy/sell, conditional orders (FCO)
TradingClientAccountServicetrading.AccountAccount information
TradingClientPortfolioServicetrading.PortfolioBalances, positions, order book, PPMMR
StreamClientStreamingServicestream.StreamingSubscribe/unsubscribe realtime data

Quick Start

Market data only (no OTP needed)

using SsiSdk;

var config = new Config("YOUR_CLIENT_ID")
{
    ApiKey = "YOUR_API_KEY",
    ApiSecret = "YOUR_API_SECRET",
};

using var auth = new AuthClient(config);
await auth.AuthenticateAsync();

var data = new DataClient(auth);
var ohlc = await data.MarketData.GetOhlc1MinuteAsync("SSI");
Console.WriteLine($"Candles: {ohlc.Count}");

Trading (OTP required)

using SsiSdk;

var config = new Config("YOUR_CLIENT_ID")
{
    ApiKey = "YOUR_API_KEY",
    ApiSecret = "YOUR_API_SECRET",
    PrivateKey = "YOUR_PRIVATE_KEY",
};

using var auth = new AuthClient(config);
await auth.AuthenticateAsync("YOUR_OTP");

var trading = new TradingClient(auth);

var accounts = await trading.Account.GetAccountInfoAsync();
Console.WriteLine($"Accounts: {accounts.Count}");

var result = await trading.Trading.PlaceLimitOrderAsync("YOUR_ACCOUNT_NO", "SSI", OrderSide.Buy, 100, 66000);
Console.WriteLine($"Order ID: {result.OrderId}, Status: {result.Status}");

Realtime streaming (OTP required)

using SsiSdk;
using SsiSdk.Models;

var config = new Config("YOUR_CLIENT_ID")
{
    ApiKey = "YOUR_API_KEY",
    ApiSecret = "YOUR_API_SECRET",
    PrivateKey = "YOUR_PRIVATE_KEY",
};

using var auth = new AuthClient(config);
await auth.AuthenticateAsync("YOUR_OTP");

using var stream = new StreamClient(auth);

stream.Streaming.SetOnData(msg =>
{
    if (msg is TradeMessage trade)
        Console.WriteLine($"[TRADE] {trade.Symbol} | {trade.Price} | {trade.Quantity}");
});

await stream.ConnectAsync();
await stream.Streaming.SubscribeSymbolTradeAsync(["SSI"]);
await stream.WaitAsync();

Use Case Mapping

Use caseClientAuthentication
Market data (OHLC, indexes, securities)DataClientNo OTP needed
Place/modify/cancel orders, account, portfolioTradingClientOTP required
Realtime WebSocket streamingStreamClientOTP required

Documentation Navigation

  • Installation & Configuration: environment, NuGet package, Config.
  • Client Classes: AuthClient, DataClient, TradingClient, StreamClient — initialization and usage.
  • Service Classes: detailed API methods for each service. It includes batch orders, real-time index data and the Trading WebSocket.
  • Configuration: full Config reference, including the batch limit, retry, rate limit and TradingWsOptions.
  • Error Handling: the exception tree (including Smart OTP, rate limit, DuplicateRequestException, TradingWsError) and handling patterns.
  • Enums: constants like OrderSide, OrderType, Board, ...
  • Models: response data models, batch order models and streaming message types.

On this page