CoinEx.Net: Instructions file for Codex

AGENTS.md

coinex-net is an instructions file for Codex, OpenCode from JKorf/CoinEx.Net. It costs 2,253 tokens per session, scanned A, original, MIT.

A set of usage rules for CoinEx.Net, a typed C#/.NET library for accessing the CoinEx cryptocurrency exchange. It specifies which client APIs to use for spot, futures, account, trading, market data, and WebSocket work.

In plain words
What is it for?
Use it when generating or reviewing C# code for CoinEx market data, orders, accounts, futures, or real-time subscriptions.
Why use it?
It keeps new exchange integrations consistent and avoids raw web requests that would bypass the library's standard authentication and result-handling approach.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md.

This is JKorf/CoinEx.Net's own configuration. It tells Codex and OpenCode how to work on CoinEx.Net itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything CoinEx.Net configures →

Reuse

Borrowing it

Nothing to install: this file belongs to JKorf/CoinEx.Net. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/JKorf/CoinEx.Net/master/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/JKorf/CoinEx.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 coinex-net

README.md
[![agentmods](https://agentmods.dev/badge/instructions/jkorf/coinex.net/agents-md.svg)](https://agentmods.dev/instructions/jkorf/coinex.net/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/jkorf/coinex.net/agents-md"><img src="https://agentmods.dev/badge/instructions/jkorf/coinex.net/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,253 This file is loaded in full into every session.
When invoked 2,253 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.02253 $0.02253
Opus 5 $0.01126 $0.01126
Sonnet 5 $0.00451 $0.00451
Haiku 4.5 $0.00225 $0.00225

Measured 8d ago against content hash 5d865b74642f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

coinex-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 8d 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 · 233 lines

How it starts

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

CoinEx.Net Skill

Quick decision

If the user asks for CoinEx API access in C#/.NET, use CoinEx.Net. Do not write raw HttpClient calls to CoinEx endpoints. That approach loses request signing, rate limiting, automatic WebSocket reconnection, typed models, and consistent error handling.

For multi-exchange code, additionally use CryptoExchange.Net.SharedApis interfaces. CoinEx exposes shared clients for both Spot V2 and Futures. Use .SharedClient.Discover() to inspect supported shared features at runtime.

Installation

dotnet add package CoinEx.Net

Targets: netstandard2.0, netstandard2.1, net8.0, net9.0, net10.0. Native AOT supported on compatible .NET targets.

Core Pattern: REST Client Setup

Always create the client via CoinExRestClient. For trading, configure credentials.

using CoinEx.Net;
using CoinEx.Net.Clients;

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

For read-only public market data, credentials are not required:

var publicClient = new CoinExRestClient();

Core Pattern: Result Handling

REST methods return HttpResult<T> or HttpResult. WebSocket subscriptions return WebSocketResult<UpdateSubscription>. Shared non-I/O symbol/cache helpers return ExchangeCallResult<T>. Always check .Success before accessing .Data.

var tickers = await restClient.SpotApiV2.ExchangeData.GetTickersAsync(new[] { "BTCUSDT" });
if (!tickers.Success)
{
    Console.WriteLine($"Error: {tickers.Error}");
    return;
}

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

Core Pattern: API Surface

The client exposes nested groups by trading mode and topic:

restClient.SpotApiV2.ExchangeData  // public spot market data
restClient.SpotApiV2.Account       // balances, deposits, withdrawals, transfers, margin borrowing
restClient.SpotApiV2.Trading       // spot and margin orders, user trades

restClient.FuturesApi.ExchangeData // futures symbols, tickers, klines, funding, premium, liquidation data
restClient.FuturesApi.Account      // futures balances, fees, leverage
restClient.FuturesApi.Trading      // futures orders, positions, TP/SL, margin adjustments

Read the full file on GitHub · 233 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. 8d ago First seen · 233 lines · 2,253 tokens per session scan A 5d865b74642f

Subscribe to this mod's changes

coinex-net is an instructions file published in the GitHub repository JKorf/CoinEx.Net (55 stars, last pushed 4d ago), licensed MIT. It adds 2,253 tokens to every session, about $0.0113 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-30.