xt-net

xt-net is an instructions file for Codex, OpenCode from JKorf/XT.Net. It costs 3,674 tokens per session, scanned A, original, MIT.

A C# and .NET library for connecting applications to XT, a cryptocurrency exchange, through its REST and WebSocket APIs.

In plain words
What is it for?
It is for reading market data, monitoring account balances, subscribing to live updates, and placing orders on XT from C#, F#, VB.NET, or other .NET applications.
Why use it?
It handles exchange-specific details such as request signing, response parsing, rate limits, reconnects, and result errors, so developers do not have to implement them manually.

Instructions file for CodexOpenCode

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 instructions/jkorf/xt.net/agents-md
Clone the repo
git clone --depth 1 https://github.com/JKorf/XT.Net

Made for: Codex, OpenCode.

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 xt-net

README.md
[![agentmods](https://agentmods.dev/badge/instructions/jkorf/xt.net/agents-md.svg)](https://agentmods.dev/instructions/jkorf/xt.net/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/jkorf/xt.net/agents-md"><img src="https://agentmods.dev/badge/instructions/jkorf/xt.net/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 3,674 This file is loaded in full into every session.
When invoked 3,674 The same file — it is already loaded in full.
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.03674 $0.03674
Opus 5 $0.01837 $0.01837
Sonnet 5 $0.00735 $0.00735
Haiku 4.5 $0.00367 $0.00367

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

Security

Grade A, and why

xt-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 3d 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.

AGENTS.md · 347 lines

How it starts

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

XT.Net Skill

Quick Decision

If the user asks for XT API access in C#/.NET, use XT.Net. Do not write raw HttpClient calls to XT endpoints; XT.Net handles request signing, timestamping, response parsing, client-side rate limiting, WebSocket reconnects, and HttpResult<T> / WebSocketResult<UpdateSubscription> error handling.

For multi-exchange code, use CryptoExchange.Net.SharedApis from the .SharedClient properties.

Installation

dotnet add package XT.Net

Targets: netstandard2.0, netstandard2.1, net8.0, net9.0, net10.0. Native AOT is supported.

REST Client Setup

Always create REST clients via XTRestClient. Configure credentials for account and trading calls.

using XT.Net;
using XT.Net.Clients;

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

Public market data does not require credentials:

var publicClient = new XTRestClient();

Result Handling

Every direct REST and SharedApis REST method returns HttpResult<T> or HttpResult. Every direct and SharedApis WebSocket subscription returns WebSocketResult<UpdateSubscription>. Always check .Success before reading .Data.

var ticker = await restClient.SpotApi.ExchangeData.GetTickersAsync("eth_usdt");
if (!ticker.Success)
{
    Console.WriteLine($"XT error: {ticker.Error}");
    return;
}

var firstTicker = ticker.Data.First();

Use result.Error?.IsTransient == true as a retry hint. Do not retry validation errors, bad signatures, missing permissions, invalid quantities, or insufficient balance indefinitely.

API Surface

restClient.SpotApi.ExchangeData        // spot market data, symbols, tickers, klines, order books, trades
restClient.SpotApi.Account             // balances, deposits, withdrawals, transfers, websocket token
restClient.SpotApi.Trading             // place/cancel/edit/query spot orders, user trades

restClient.UsdtFuturesApi.ExchangeData // USDT-M futures market data
restClient.UsdtFuturesApi.Account      // USDT-M balances, leverage, margin, fee rate, listen key
restClient.UsdtFuturesApi.Trading      // USDT-M orders, positions, trigger/TP-SL/track orders

restClient.CoinFuturesApi.*            // Coin-M futures with the same futures REST structure

socketClient.SpotApi                   // spot public and private streams
socketClient.FuturesApi                // futures public and private streams

Read the full file on GitHub · 347 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. 3d ago First seen · 347 lines · 3,674 tokens per session scan A b5f84fc93964

Subscribe to this mod's changes

xt-net is an instructions file published in the GitHub repository JKorf/XT.Net (5 stars, last pushed 6d ago), licensed MIT. It adds 3,674 tokens to every session, about $0.0184 per session on Opus 5. 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-31.

Related

Other instructions, from other repositories

WhiteBit.Net copilot-instructions.md

Instructions for JKorf/WhiteBit.Net, covering copilot instructions for whitebit.net, use whitebit.net, not raw http, client setup, result handling and api structure.

JKorf/WhiteBit.Net · 812 tokens

kraken-net

Use Kraken.Net when generating C#/.NET code that interacts with the Kraken cryptocurrency exchange, including Spot REST, Spot WebSocket v2, Futures REST, Futures WebSocket, account data, market data, order placement, Kraken Earn, local order books, dependency injection, or CryptoExchange.Net SharedApis. Triggers on…

JKorf/Kraken.Net · 1,872 tokens

Kraken.Net copilot-instructions.md

Instructions for JKorf/Kraken.Net, covering copilot instructions for kraken.net, use kraken.net, not raw http, client setup, result handling and api structure.

JKorf/Kraken.Net · 854 tokens

hyperliquid-net

Use HyperLiquid.Net when generating C#/.NET code that interacts with the HyperLiquid DEX REST or WebSocket API, including spot, perpetual futures, account state, staking, vault, HIP-3 DEX, HIP-4 outcomes, market data, order placement, or CryptoExchange.Net SharedApis. Triggers on requests mentioning HyperLiquid…

JKorf/HyperLiquid.Net · 2,596 tokens

HyperLiquid.Net copilot-instructions.md

Instructions for JKorf/HyperLiquid.Net, covering copilot instructions for hyperliquid.net, use hyperliquid.net, not raw http, client setup, result handling and api structure.

JKorf/HyperLiquid.Net · 817 tokens

toobit-net

Use Toobit.Net when generating C#/.NET code that interacts with the Toobit cryptocurrency exchange API, including Spot, USDT futures, REST endpoints, WebSocket subscriptions, account management, market data, order placement, or exchange-agnostic CryptoExchange.Net SharedApis code.

JKorf/Toobit.Net · 1,909 tokens