LLM_trader AGENTS.md

LLM_trader AGENTS.md is an instructions file for Codex, OpenCode from qrak/LLM_trader. It costs 22,821 tokens per session, scanned A, original, MIT.

A repository instruction file that gives coding agents the rules, architecture, and working procedures for an experimental, paper-trading bot. The bot uses market data, news, chart images, and language models to produce buy, sell, or hold decisions.

In plain words
What is it for?
Following the project's coding standards, testing rules, lifecycle, and governance while working on its multi-agent trading system.
Why use it?
It gives agents one authoritative source of guidance, reducing conflicting instructions and uncertainty about how the project should be changed or run.

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/qrak/llm_trader/agents-md
Clone the repo
git clone --depth 1 https://github.com/qrak/LLM_trader

Made for: Codex, OpenCode.

Per session 22,821 This file is loaded in full into every session.
When invoked 22,821 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.22821 $0.22821
Opus 5 $0.11411 $0.11411
Sonnet 5 $0.04564 $0.04564
Haiku 4.5 $0.02282 $0.02282

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

Security

Grade A, and why

LLM_trader 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 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 · 1,803 lines

How it starts

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

LLM Trader — Master Architecture Blueprint

Repository: https://github.com/qrak/LLM_trader.git Python: 3.13, .venv/, python start.py Status: BETA / Research Edition — paper-trading mode only Live Dashboard: https://semanticsignal.qrak.org


0. Instruction Authority

Root AGENTS.md is the single instruction source of truth in this repository across all IDEs, agents, and harnesses.

  • Root AGENTS.md is canonical for system-wide rules, architecture, coding standards, testing, terminal behavior, and governance.
  • IDE-specific instruction files are non-authoritative and should not contain policy that is missing from AGENTS.md.
  • .github/workflows/* defines CI execution behavior, not instruction authority.

1. System Overview

SEMANTIC SIGNAL LLM (LLM Trader) is an autonomous, asyncio-first trading bot that converts market data, news (via RAG), and chart images into structured BUY / SELL / HOLD decisions via large language models. The system operates a distributed multi-agent intelligence architecture: specialized agents for technical analysis, pattern recognition, news retrieval, risk validation, outcome-aware learning, and reflection-based rule synthesis — all coordinated through a central trading loop.

flowchart TB
    subgraph External["External Layer"]
        EX["Exchanges<br/>(Binance, KuCoin, Gate.io,<br/>MEXC, Hyperliquid)<br/>&#8209; CCXT"]
        CG["CoinGecko<br/>DeFiLlama"]
        ALT["Alternative.me<br/>(Fear & Greed)"]
        RSS["RSS Feeds<br/>(CoinDesk, CoinTelegraph,<br/>Decrypt, CryptoSlate)"]
        AI_PROV["AI Providers<br/>Google Gemini (primary)<br/>LM Studio (local text fallback)<br/>OpenRouter (secondary configurable provider)"]
    end

    subgraph DataIngestion["Data Ingestion Layer"]
        DF["DataFetcher<br/>OHLCV + Order Book + Trade Flow"]
        RAG["RAG Engine Agent<br/>News + Fundamentals"]
    end

    subgraph AnalysisLayer["Analysis Layer"]
        TA["Analysis Engine Agent<br/>Technical Calculator<br/>50+ Indicators"]
        PE["Pattern Engine<br/>Deterministic Indicator<br/>Pattern Detection<br/>Numba JIT compiled"]
        CGEN["Chart Generator<br/>4K PNG Candlestick<br/>SMA/RSI/Volume/CMF+OBV"]
    end

    subgraph BrainLayer["Learning & Memory Layer"]
        BRAIN["🧠 Brain Agent<br/>TradingBrainService"]
        VM["Vector Memory<br/>ChromaDB<br/>Trade Experiences<br/>Semantic Rules<br/>Confidence Stats"]
        REFL["Reflection Engine<br/>Best‑practice Rules<br/>Anti‑patterns<br/>AI Mistake Rules"]
    end

    subgraph RiskLayer["Risk & Execution Layer"]
        RP["Risk Manager<br/>Dynamic SL/TP<br/>Position Sizing"]
        GP["Order Governance Pipeline<br/>Symbol Guard<br/>Max Size Guard<br/>Cooldown Guard"]
        STRAT["Trading Strategy<br/>Exit Monitor<br/>Position Status Monitor"]
    end

    subgraph Output["Output Layer"]
        DASH["📊 Dashboard<br/>FastAPI + WebSocket"]
        LOGS["Audit Trail<br/>Position Logs<br/>SQLite Trade History"]
    end

    subgraph Providers["Provider Orchestration"]
        PO["Provider Orchestrator<br/>Fallback Chain"]
    end

    %% Data Flow
    EX --> DF
    RSS --> RAG
    CG --> RAG
    ALT --> TA
    DF --> TA
    TA --> PE
    TA --> CGEN
    
    RAG --> TA
    TA --> PO
    PO --> AI_PROV
    
    AI_PROV -->|"Structured Signal"| RP
    RP --> GP
    GP --> STRAT
    
    STRAT -->|"Closed Trade"| BRAIN
    BRAIN --> VM
    VM -->|"Reflection Loop"| REFL
    REFL -->|"Rules"| VM
    VM -->|"Context Injection"| BRAIN
    BRAIN -->|"Confidence + Rules"| TA
    
    TA --> DASH
    STRAT --> DASH
    STRAT --> LOGS

Read the full file on GitHub · 1,803 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 · 1,803 lines · 22,821 tokens per session scan A 3a36c7826e67

Subscribe to this mod's changes

LLM_trader AGENTS.md is an instructions file published in the GitHub repository qrak/LLM_trader (121 stars, last pushed 4d ago), licensed MIT. It adds 22,821 tokens to every session, about $0.1141 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

TradingAgents-astock CLAUDE.md

Claude Code instructions for simonlin1212/TradingAgents-astock, covering tradingagents-astock, 项目概述, 架构, 数据层(v0.2.5 全部直连 http,零第三方数据库依赖) and agent 角色(7 个).

simonlin1212/TradingAgents-astock · 3,359 tokens

Binance.Net copilot-instructions.md

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

JKorf/Binance.Net · 640 tokens

GitNexus AGENTS.md

AGENTS.md instructions for abhigyanpatwari/GitNexus, covering scope, model configuration, execution sequence (complex tasks), claude code hooks and context budget.

abhigyanpatwari/GitNexus · 4,123 tokens

GitNexus CLAUDE.md

Claude Code instructions for abhigyanpatwari/GitNexus, covering scope, model configuration, execution sequence (complex tasks), claude code hooks and context budget.

abhigyanpatwari/GitNexus · 2,334 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

kucoin-net

Use Kucoin.Net when generating C#/.NET code that interacts with the Kucoin cryptocurrency exchange API, including Spot, Margin, High Frequency spot trading, Futures, Unified Account, REST endpoints, WebSocket subscriptions, account management, market data, or order placement. Triggers on any request mentioning Kucoin…

JKorf/Kucoin.Net · 1,971 tokens