Bybit.Net AI API Map

June 29, 2026 ยท View on GitHub

This map helps AI assistants generate Bybit.Net code that matches the current project API shape. Prefer the V5 API versions unless a user explicitly asks for older or legacy behavior.

Package and Clients

using Bybit.Net;
using Bybit.Net.Clients;
using Bybit.Net.Enums;

var restClient = new BybitRestClient();
var socketClient = new BybitSocketClient();

Authenticated clients:

var restClient = new BybitRestClient(options =>
{
    options.ApiCredentials = new BybitCredentials("API_KEY", "API_SECRET");
});

var socketClient = new BybitSocketClient(options =>
{
    options.ApiCredentials = new BybitCredentials("API_KEY", "API_SECRET");
});

REST Root

Bybit.Net uses a single V5 REST root:

restClient.V5Api

Do not generate Binance-style SpotApi, UsdFuturesApi, CoinFuturesApi, or GeneralApi roots for Bybit.Net.

REST Groups

GroupPurposeCommon methods
V5Api.ExchangeDataPublic and mostly unauthenticated market dataGetSpotTickersAsync, GetLinearInverseTickersAsync, GetKlinesAsync, GetOrderbookAsync, GetTradeHistoryAsync, GetFundingRateHistoryAsync, GetOpenInterestAsync
V5Api.AccountBalances, assets, deposits, withdrawals, transfers, account settingsGetBalancesAsync, GetAllAssetBalancesAsync, GetAssetBalanceAsync, GetApiKeyInfoAsync, GetFeeRatesAsync, CreateInternalTransferAsync, CreateUniversalTransferAsync
V5Api.TradingOrders, positions, executions, spread tradingPlaceOrderAsync, EditOrderAsync, CancelOrderAsync, CancelAllOrderAsync, GetOrdersAsync, GetOrderHistoryAsync, GetPositionsAsync, GetUserTradesAsync
V5Api.SubAccountSub-account managementUse for sub-account operations when requested
V5Api.CryptoLoanCrypto loan endpointsUse for loan orders and loan history when requested
V5Api.EarnEarn endpointsUse for savings/earn products when requested
V5Api.SharedClientCryptoExchange.Net shared REST clientUse for exchange-agnostic code; call Discover() to inspect supported features

Market Data Patterns

Spot ticker:

var ticker = await restClient.V5Api.ExchangeData.GetSpotTickersAsync("ETHUSDT");
if (!ticker.Success) { return; }

var first = ticker.Data.List.First();
Console.WriteLine(first.LastPrice);

Linear derivative ticker:

var ticker = await restClient.V5Api.ExchangeData.GetLinearInverseTickersAsync(
    Category.Linear,
    symbol: "ETHUSDT");

Klines:

var klines = await restClient.V5Api.ExchangeData.GetKlinesAsync(
    Category.Linear,
    "ETHUSDT",
    KlineInterval.OneMinute,
    limit: 100);

Order book:

var orderBook = await restClient.V5Api.ExchangeData.GetOrderbookAsync(
    Category.Linear,
    "ETHUSDT",
    limit: 25);

Account Patterns

Wallet balance:

var balances = await restClient.V5Api.Account.GetBalancesAsync(AccountType.Unified, "USDT");
if (!balances.Success) { return; }

foreach (var account in balances.Data.List)
{
    foreach (var asset in account.Assets)
        Console.WriteLine($"{asset.Asset}: {asset.WalletBalance}");
}

Asset balance:

var assetBalance = await restClient.V5Api.Account.GetAssetBalanceAsync(
    AccountType.Fund,
    "USDT");

Fee rates:

var fees = await restClient.V5Api.Account.GetFeeRatesAsync(Category.Linear, symbol: "ETHUSDT");

Trading Patterns

Place a linear limit order:

var order = await restClient.V5Api.Trading.PlaceOrderAsync(
    Category.Linear,
    "ETHUSDT",
    OrderSide.Buy,
    NewOrderType.Limit,
    quantity: 0.1m,
    price: 2000m,
    timeInForce: TimeInForce.GoodTillCanceled,
    positionIdx: PositionIdx.OneWayMode);

Place a spot order:

var order = await restClient.V5Api.Trading.PlaceOrderAsync(
    Category.Spot,
    "ETHUSDT",
    OrderSide.Buy,
    NewOrderType.Limit,
    quantity: 0.01m,
    price: 2000m,
    timeInForce: TimeInForce.GoodTillCanceled);

Open orders:

var orders = await restClient.V5Api.Trading.GetOrdersAsync(
    Category.Linear,
    symbol: "ETHUSDT",
    limit: 20);

Positions:

var positions = await restClient.V5Api.Trading.GetPositionsAsync(
    Category.Linear,
    symbol: "ETHUSDT");

Cancel an order:

var cancel = await restClient.V5Api.Trading.CancelOrderAsync(
    Category.Linear,
    "ETHUSDT",
    orderId: "ORDER_ID");

Product Categories

ProductUse
SpotCategory.Spot
USDT/USDC linear perpetual/futuresCategory.Linear
Inverse perpetual/futuresCategory.Inverse
USDC optionsCategory.Option

WebSocket Roots

RootPurpose
socketClient.V5SpotApiSpot public streams
socketClient.V5LinearApiLinear derivatives public streams
socketClient.V5InverseApiInverse derivatives public streams
socketClient.V5OptionsApiOptions public streams
socketClient.V5SpreadApiSpread public streams
socketClient.V5PrivateApiPrivate account/order/position/trade/wallet streams and WebSocket trading

WebSocket Patterns

Spot ticker:

var sub = await socketClient.V5SpotApi.SubscribeToTickerUpdatesAsync(
    "ETHUSDT",
    update => Console.WriteLine(update.Data.LastPrice));

Linear ticker:

var sub = await socketClient.V5LinearApi.SubscribeToTickerUpdatesAsync(
    "ETHUSDT",
    update => Console.WriteLine(update.Data.MarkPrice));

Private order updates:

var sub = await socketClient.V5PrivateApi.SubscribeToOrderUpdatesAsync(
    update => Console.WriteLine(update.Data.Length));

Always check subscription result and unsubscribe:

if (!sub.Success) { return; }
await socketClient.UnsubscribeAsync(sub.Data);

Result Model

REST:

HttpResult<T>

WebSocket:

WebSocketResult<T>

Shared non-I/O symbol/cache helpers:

ExchangeCallResult<T>

Pattern:

if (!result.Success)
{
    Console.WriteLine(result.Error);
    return;
}

var data = result.Data;

Common AI Mistakes to Prevent

  • Using raw Bybit endpoint URLs and hand-written signing.
  • Generating old or nonexistent client roots such as restClient.SpotApi.
  • Forgetting V5 Category arguments.
  • Using passphrase credentials.
  • Reading .Data without checking .Success.
  • Using symbol formats from other exchanges.
  • Creating a new client for each request.
  • Blocking with .Result or .Wait().
  • Forgetting WebSocket teardown.

Source References

  • Bybit.Net/Interfaces/Clients/V5/IBybitRestClientApi.cs
  • Bybit.Net/Interfaces/Clients/V5/IBybitRestClientApiExchangeData.cs
  • Bybit.Net/Interfaces/Clients/V5/IBybitRestClientApiAccount.cs
  • Bybit.Net/Interfaces/Clients/V5/IBybitRestClientApiTrading.cs
  • Bybit.Net/Interfaces/Clients/V5/IBybitSocketClientSpotApi.cs
  • Bybit.Net/Interfaces/Clients/V5/IBybitSocketClientLinearApi.cs
  • Bybit.Net/Interfaces/Clients/V5/IBybitSocketClientPrivateApi.cs
  • Examples/ai-friendly/