binance-trading-bot: Instructions file for Codex

AGENTS.md

binance-trading-bot AGENTS.md is an instructions file for Codex, OpenCode from chrisleekr/binance-trading-bot. It costs 4,344 tokens per session, scanned A, original, Apache-2.0.

Engineering instructions for a Binance trading bot, software that manages trading strategies and accounts through the Binance exchange. They describe its architecture, configuration, and rules for preserving correctness.

In plain words
What is it for?
Use them when changing exchange integrations, account handling, trading strategies, system rules, or the package structure that supports strategy plug-ins.
Why use it?
They help an agent understand how accounts, strategy profiles, and shared wallets relate, which lowers the risk of unsafe or incompatible trading changes.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions Claude Code; mentions Codex.

This is chrisleekr/binance-trading-bot's own configuration. It tells Codex and OpenCode how to work on binance-trading-bot 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 binance-trading-bot configures →

About the project

binance-trading-bot is a self-hosted program that connects to a Binance account and automatically decides when to buy or sell cryptocurrency using selectable trading strategies. It is for operators who want to run grid, momentum, or rebalancing strategies, test them against historical data, and monitor live activity through a dashboard.

chrisleekr/binance-trading-bot · 5,557 stars · on GitHub · chrisleekr.github.io

Reuse

Borrowing it

Nothing to install: this file belongs to chrisleekr/binance-trading-bot. 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/chrisleekr/binance-trading-bot/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/chrisleekr/binance-trading-bot

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 binance-trading-bot AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/chrisleekr/binance-trading-bot/agents-md.svg)](https://agentmods.dev/instructions/chrisleekr/binance-trading-bot/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/chrisleekr/binance-trading-bot/agents-md"><img src="https://agentmods.dev/badge/instructions/chrisleekr/binance-trading-bot/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 4,344 This file is loaded in full into every session.
When invoked 4,344 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.04344 $0.04344
Opus 5 $0.02172 $0.02172
Sonnet 5 $0.00869 $0.00869
Haiku 4.5 $0.00434 $0.00434

Measured today against content hash 3758b3d93727, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

binance-trading-bot AGENTS.md 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 today.

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 · 109 lines

How it starts

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

Engineering charter

Charter for any coding agent in this repo (Claude Code, Cursor, Codex, …). Keep it short — architecture, config, and ops live in docs/ (built by mkdocs). Generic engineering principles (think-first, simplicity, goal-driven): .claude/rules/principles.md.

Project

binance-trading-bot: single-operator, multi-account, multi-profile, reliability-first, mobile-first trading platform on Binance. One operator owns N first-class Binance accounts (each = one API key pair + one environment + one user-data stream); each account runs N strategy profiles against its shared wallet. Strategy is a plugin — trailing-trade is the first; source of truth is packages/strategy/trailing-trade/, contract in packages/strategy/core/ + docs/architecture/extensibility.md.

Architecture principles

Correctness first. Before coding, confirm the design is sound: surface tradeoffs, pick the simplest option that holds the invariants below, cite authoritative sources for any version/API claim, and push back rather than guess. Greenfield, not yet deployed — no back-compat debt, so prefer the correct extensible design over the minimal diff and restructure freely; the invariants still bind, and you name a large refactor before starting it.

Core invariants

  1. Extensibility. Strategies are plugins behind packages/strategy-core; notifier providers behind @app/notify's ./providers/* subpath exports. apps/api/apps/worker MUST NOT import a specific strategy-* package or an @app/notify/providers/* provider outside their registry bootstrap; apps/web MAY import strategy packages for typed event payloads. Adding a strategy = new package + registry entry; adding a notifier = new provider module + buildNotifyRegistry entry — never an edit to apps/api/apps/worker.
  2. Reliability. Crash-only. Idempotent jobs. Per-account Binance-rate isolation. No silent failures.
  3. Approachable & responsive. Solo operator, not a finance pro: plain language, gloss a trading term the first time it appears, never assume off-screen knowledge. Mobile-first — every view usable at 375×667 — then scale up.
  4. Account-scoped by row, not convention.
    • Model: one operator (users) → many accounts → many profiles. accounts.owner_id → users.id; each account holds one Binance key pair, one binance_mode, one user-data stream. profiles.account_id binds each profile to its account, sharing that account's key/wallet/stream.
    • Branded two-tier scope: AccountScope{db,operatorId,accountId} from scopeAccount, ProfileScope{db,operatorId,accountId,profileId} from scopeProfile — proves the ownership chain in one query. UserId and AccountId are distinct branded types (misplacing one won't compile).
    • Access rule: app code reaches account-scoped data ONLY through profileRepo(...) / profileRepoFromScope(scope) — or accountRepo(...) / accountRepoFromScope for account-level surfaces like api-keys — from @app/db. No manual (db, operatorId, …) threading; every account-scoped repo fn takes an AccountScope/ProfileScope first, minted only by scopeAccount/scopeProfile — ownership proven exactly once at compile time. Flat repo.<x> stays only for operator/global fns (repo.users.*, repo.accounts.create/listForOwner, retention sweeps).
    • Routes: API under /api/accounts/:accountId/..., web under /accounts/$accountId/....
    • Enforcement: packages/db/__tests__/repo/ast-check.test.ts + cross-account integration tests. No DB-side RLS. See docs/architecture/{account-isolation,database}.md.
    • Strategy state is per-(profile, symbol) in storage and in tick() — one slice per symbol per call. Cross-symbol state goes through the per-profile KV store: emit set-kv/delete-kv under a strategy-owned namespaced key and read the merged snapshot back via TickInput.profileKv (opt in with capabilities.needsProfileKv). A KV write lands for sibling symbols on later ticks, never the same tick.

Read the full file on GitHub · 109 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. today Changed · +21 tokens per session 3758b3d93727
  2. 8d ago First seen · 109 lines · 4,323 tokens per session scan A eac5cccfbafa

Subscribe to this mod's changes

binance-trading-bot AGENTS.md is an instructions file published in the GitHub repository chrisleekr/binance-trading-bot (5,557 stars, last pushed today), licensed Apache-2.0. It adds 4,344 tokens to every session, about $0.0217 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.

Related

Other instructions, from other repositories

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens