ssquant: Instructions file for Codex

AGENTS.md

ssquant AGENTS.md is an instructions file for Codex, OpenCode from songshuquant/ssquant. It costs 1,705 tokens per session, scanned A, original, MIT.

Repository-specific instructions for the SSQuant project, a Python framework for Chinese futures trading and backtesting. They describe the project structure, configuration, trading modes, and conventions for coding agents.

In plain words
What is it for?
Use them when developing or changing SSQuant strategies, backtests, simulated trading, live trading, data handling, reports, or its agent backend.
Why use it?
They reduce the chance of an agent using the wrong project entry points, interfaces, data settings, or trading assumptions.

Instructions file for CodexOpenCode

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

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

Reuse

Borrowing it

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

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 ssquant AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/songshuquant/ssquant/agents-md/github.svg)](https://agentmods.dev/instructions/songshuquant/ssquant/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/songshuquant/ssquant/agents-md"><img src="https://agentmods.dev/badge/instructions/songshuquant/ssquant/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ssquant AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/songshuquant/ssquant/agents-md"><img src="https://agentmods.dev/badge/instructions/songshuquant/ssquant/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,705 This file is loaded in full into every session.
When invoked 1,705 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.01705 $0.01705
Opus 5.5 $0.00682 $0.00682
Sonnet 5.5 $0.00341 $0.00341
Haiku 4.5 $0.00170 $0.00170

Measured 2d ago against content hash c3bcb3c1ce59, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ssquant 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 2d 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 · 114 lines

How it starts

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

SSQuant — AI Agent 项目上下文

Version: 0.4.6 License: MIT Language: Python 3.9-3.14


项目定位

SSQuant(松鼠Quant)是中国期货 CTP 专业量化交易与回测框架,支持一套代码三处运行:回测 / SIMNOW 仿真 / 实盘。

v0.4.6 核心变化:

  • 价格双轨制:复权策略价映射真实价格,用真实价格计算回测指标
  • 本地数据复权与连续合约映射修复,提升专业期货回测可信度
  • 回测报告增强:复权信息、真实成交价、回测配置和关键指标更清晰
  • AI Agent 后端更新为 backend.py + start_server.py,支持工作区、历史、报告元数据管理
  • README / SKILL 已重写,面向用户和 AI Agent 解释完整框架

目录结构

ssquant/
├── api/
│   └── strategy_api.py          # StrategyAPI(策略唯一入口)
├── backtest/
│   ├── backtest_core.py         # 回测引擎主循环
│   ├── unified_runner.py        # BACKTEST / SIMNOW / REAL_TRADING 统一入口
│   ├── live_trading_adapter.py  # 实盘/SIMNOW 桥接
│   ├── backtest_results.py      # 回测结果与权益曲线
│   ├── backtest_report.py       # 文本/结构化报告
│   ├── html_report.py           # HTML 报告
│   └── rollover_engine.py       # 自动移仓
├── config/
│   ├── trading_config.py        # 俱乐部数据账号、本地/CTP/SIMNOW/实盘账户配置
│   ├── config_helpers.py        # get_config() 等配置生成逻辑
│   └── _server_config.py        # data_server 连接配置
├── data/
│   ├── data_source.py           # 数据源、缓存、真实价格映射
│   ├── api_data_fetcher.py      # REST API + SQLite 缓存
│   ├── local_data_loader.py     # 本地 SQLite 导入/加载
│   ├── local_adjust.py          # 前复权/后复权
│   └── contract_mapper.py       # 888/777 连续合约映射
├── ctp/py39~py314/              # CTP 二进制
├── pyctp/                       # CTP 客户端封装
└── indicators/

examples/                        # 策略示例,新手必须先跑通
ai_agent/                        # AI 策略助手
046.MD                           # v0.4.6 更新文档
README.md                        # 项目介绍和使用说明
SKILL.md                         # 面向 Codex / Claude Code 的完整框架指南

关键约定

  1. 策略唯一入口:所有交易操作必须通过 StrategyAPI。
  2. 连续合约:当前约定只有 888(主力)和 777(次主力),不要写 000。
  3. 复权类型:adjust_type='0' 不复权 / '1' 后复权 / '2' 前复权。
  4. 价格双轨制:策略用复权价格产生信号,框架映射真实价格计算成交、盈亏、权益、回撤等回测指标。
  5. 数据模式:
    • data_source_mode='data_server':远程数据,需俱乐部账号。
    • data_source_mode='local':本地 SQLite,免会员;TICK 回测必须使用本地模式。
    • 远程行情与会员鉴权统一通过 ssquant/data/sdk_client.py 复用官方 ssquantdata 客户端;不要恢复旧 /api/auth/verify、直接 IP HTTP/WS 或独立令牌缓存。
    • SDK 0.1.4 与支持 resume_kline_v1 的服务端可按原序号补发:补齐期间暂停策略回调、更新缓存,RecoveryEvent 后等待新的实时触发;不补执行历史交易信号。无法证明完整时仍终止策略,历史快照不能提供恢复保证。
  6. 默认高性能写法:在 initialize(api) 中用 api.register_indicator() 注册指标,strategy() 中 O(1) 查表。
  7. examples 是重要保障:覆盖约 80% 常见期货策略类型,新手和 AI 写策略前都应先参考并跑通示例。

Read the full file on GitHub · 114 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. 2d ago First seen · 114 lines · 1,705 tokens per session scan A c3bcb3c1ce59

Subscribe to this mod's changes

ssquant AGENTS.md is an instructions file published in the GitHub repository songshuquant/ssquant (123 stars, last pushed 16d ago), licensed MIT. It adds 1,705 tokens to every session, about $0.0068 per session on Opus 5.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-11-04.

Related

ssquant AGENTS.md compared with instructions from other repositories

ssquant AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
ssquant AGENTS.mdsongshuquant/ssquantInstructions file12316d agoMITA1,705Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode