crypto-trading-bot AGENTS.md

crypto-trading-bot AGENTS.md is an instructions file for Codex, OpenCode from Oakshen/crypto-trading-bot. It costs 845 tokens per session, scanned A, original, Apache-2.0.

Repository instructions for a Go-based automated cryptocurrency trading bot. They describe its market analysis, decision process, Binance futures trading, storage, scheduling, and monitoring parts.

In plain words
What is it for?
Use them when working on market data, trading decisions, Binance orders, session records, configuration, scheduled runs, or the monitoring web service.
Why use it?
They give contributors the project’s intended workflow and configuration points, reducing the risk of changing one trading stage without accounting for the others.

Instructions file for CodexOpenCode

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

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/oakshen/crypto-trading-bot/agents-md
Clone the repo
git clone --depth 1 https://github.com/Oakshen/crypto-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 crypto-trading-bot AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/oakshen/crypto-trading-bot/agents-md.svg)](https://agentmods.dev/instructions/oakshen/crypto-trading-bot/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/oakshen/crypto-trading-bot/agents-md"><img src="https://agentmods.dev/badge/instructions/oakshen/crypto-trading-bot/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 845 This file is loaded in full into every session.
When invoked 845 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.1 $0.00845 $0.00845
Opus 5 $0.00423 $0.00423
Sonnet 5 $0.00169 $0.00169
Haiku 4.5 $0.00085 $0.00085

Measured 6d ago against content hash 17a710650a2e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

crypto-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 6d 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 · 51 lines

What it actually says

AGENTS.md

项目使命

  • 基于 Go 的自动加密货币交易智能体,结合 LLM、技术指标与币安期货执行形成端到端闭环
  • 通过 Cloudwego Eino Graph 管理多智能体并发(分析→决策→执行),以最少人工干预实现稳定策略迭代

最新亮点

  • 外部 Prompt 管理:prompts/ 目录可热更新策略文案,通过 TRADER_PROMPT_PATH 切换不同交易风格
  • 动态杠杆:BINANCE_LEVERAGE=low-high 允许 LLM 依据置信度/趋势/波动在区间内自适应,兼顾收益与风险

多智能体工作流

  • 并行阶段:market_analyst 负责 OHLCV 与技术指标;sentiment_analyst 从 CryptoOracle 拉取情绪
  • 顺序阶段:crypto_analyst 汇总币种专属数据,随后 position_info 查询币安持仓
  • 决策阶段:trader 等待所有上下游数据,优先调用 OpenAI,失败时回落到内置规则;图定义位于 internal/agents/graph.go

核心模块速览

  • internal/agents/:图定义、LLM 工具、决策逻辑
  • internal/dataflows/:市场与情绪数据,含 RSI/MACD/BB/SMA/EMA/ATR 等指标计算
  • internal/executors/:币安期货下单,支持单向/双向持仓、BUY/SELL/CLOSE_* 动作,含指数退避重试
  • internal/storage/:SQLite trading_sessions,记录所有报告与执行结果
  • 其他:internal/config 负责 Viper + .env;internal/scheduler 对齐 K 线节奏;internal/web 提供 Hertz 监控端口

运行 & 调试

make build        # 编译主机器人
make run          # 单次执行
make run-web      # 循环执行 + Web 控制台
make query ARGS="latest 5"  # 查询最近会话
make test / make test-cover  # 测试与覆盖率
  • 调试图时设置 DEBUG_MODE=true,观察日志链路并可用 make query ARGS="latest 1" 检查数据库

配置要点

  • .env 中集中管理,参考 env.example.yaml;修改 internal/config/config.go 记得同步 .env.example
  • 关键开关:BINANCE_TEST_MODE(测试 vs 实盘)、BINANCE_POSITION_MODE(oneway/hedge)、OPENAI_API_KEYCRYPTO_TIMEFRAMETRADER_PROMPT_PATH
  • 杠杆、仓位、止损等需结合 MAX_DRAWDOWNRISK_PER_TRADE 做统一风险设定

测试策略

  • 单元测试集中在 config/storage/scheduler/dataflows/executors 包
  • 集成/币安测试仅在 BINANCE_TEST_MODE=true 下运行,避免真实成交

风险提示

  • BINANCE_TEST_MODE=false 即为实盘,务必先小仓+低杠杆验证
  • LLM 失败会自动退回规则策略,但仍需人工审查关键交易
  • 日志、数据库与 Web 控制台是追踪异常的三大信号来源

协作备注

  • 若代码注释写英文,需紧跟一行中文翻译
  • Prompt 或配置变更请更新 prompts/README.md.env.example
  • 请用中文回答用户的问题
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. 6d ago First seen · 51 lines · 845 tokens per session scan A 17a710650a2e

Subscribe to this mod's changes

crypto-trading-bot AGENTS.md is an instructions file published in the GitHub repository Oakshen/crypto-trading-bot (50 stars, last pushed 8mo ago), licensed Apache-2.0. It adds 845 tokens to every session, about $0.0042 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