bybit-net

bybit-net is a cursor rule for Cursor from JKorf/Bybit.Net. It costs 0 tokens per session (889 once invoked), scanned A, original, MIT.

A set of coding conventions for using the Bybit.Net C#/.NET library to connect to Bybit, a cryptocurrency exchange. It describes client setup, market-data access, account and trading APIs, WebSockets, and result checking.

In plain words
What is it for?
It is for writing C#/.NET code that reads market data, accesses accounts, places or manages trades, uses WebSocket feeds, and handles API results.
Why use it?
It keeps Bybit integrations consistent with the library already used by the codebase and helps prevent reading failed API responses as if they were valid data.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/jkorf/bybit.net/bybit-net
Clone the repo
git clone --depth 1 https://github.com/JKorf/Bybit.Net

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for bybit-net

README.md
[![agentmods](https://agentmods.dev/badge/rules/jkorf/bybit.net/bybit-net.svg)](https://agentmods.dev/rules/jkorf/bybit.net/bybit-net)
Your own site
<a href="https://agentmods.dev/rules/jkorf/bybit.net/bybit-net"><img src="https://agentmods.dev/badge/rules/jkorf/bybit.net/bybit-net.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 889 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00889
Opus 5 $0.00000 $0.00445
Sonnet 5 $0.00000 $0.00178
Haiku 4.5 $0.00000 $0.00089

Measured 4d ago against content hash b3b0b259a800, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

bybit-net scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/bybit-net.mdc · 111 lines

How it starts

The opening of the file, as written. The whole thing — 111 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Bybit.Net Conventions

This codebase uses Bybit.Net for Bybit cryptocurrency exchange access. Do not write raw HttpClient calls to Bybit endpoints.

Client setup pattern

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

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

For public market data only, no credentials are needed: new BybitRestClient().

Result pattern

REST methods return HttpResult<T>, WebSocket subscriptions return WebSocketResult<T>, and shared WebSocket order management returns QueryResult<T>. Always check .Success before reading .Data:

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

API surface

  • restClient.V5Api.ExchangeData
  • restClient.V5Api.Account
  • restClient.V5Api.Trading
  • restClient.V5Api.SubAccount
  • restClient.V5Api.CryptoLoan
  • restClient.V5Api.Earn
  • restClient.V5Api.SharedClient
  • socketClient.V5SpotApi
  • socketClient.V5LinearApi
  • socketClient.V5InverseApi
  • socketClient.V5OptionsApi
  • socketClient.V5SpreadApi
  • socketClient.V5PrivateApi

Use Category.Spot, Category.Linear, Category.Inverse, or Category.Option when V5 methods require a category.

Order placement

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);

WebSocket pattern

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

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

Use V5PrivateApi for authenticated order, position, wallet, user trade, and Greek updates.

Read the full file on GitHub · 111 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 111 lines · 0 tokens per session scan A b3b0b259a800

Subscribe to this mod's changes

bybit-net is a cursor rule published in the GitHub repository JKorf/Bybit.Net (127 stars, last pushed 10d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 889 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.