Kalshi Paper Trading
Use this skill for Kalshi paper execution and ledger management.
Kalshi-native paper trading should use a dedicated ledger and CLI rather than the generic paper-trading skill.
When to Use
Use this skill when the user wants to:
- - design or build a Kalshi-specific paper trader
- inspect or reconcile Kalshi paper positions
- store Kalshi prices correctly in cents without mixing units
- compute Kalshi realized and unrealized PnL
- add Kalshi-native exposure or risk rules
Key Rule
Do not route Kalshi paper executions through the generic skills/paper-trading ledger unless the user explicitly asks to keep that compatibility.
Default assumptions for this skill:
- - Kalshi execution prices are stored as integer cents in INLINECODE2
- settlement is
100 or 0 cents - positions are keyed by INLINECODE5
- risk controls are based on premium and event exposure, not stop-distance percent risk
- live market sync supports both legacy cent fields and modern Kalshi
*_dollars quote fields
Primary Commands
Initialize the paper account:
CODEBLOCK0
Check status:
CODEBLOCK1
Sync a live market quote into the ledger:
CODEBLOCK2
Open a paper trade from the live Kalshi ask:
CODEBLOCK3
Reconcile a finalized market:
CODEBLOCK4
Review account performance:
CODEBLOCK5
Integration
Pair this skill with a separate Kalshi API read skill for:
- - market discovery
- liquidity validation
- trades and orderbook checks
- pre-trade candidate ranking
This skill owns the paper ledger and execution side only.
Design Reference
Read the proposal before making structural changes:
Use that document for:
- - schema design
- command surface
- valuation rules
- settlement logic
- migration plan away from the generic paper trader
Tests
Run the Kalshi paper-trader test file:
CODEBLOCK6
Kalshi 模拟交易
使用此技能进行 Kalshi 模拟执行和账本管理。
Kalshi 原生模拟交易应使用专用账本和 CLI,而非通用的 paper-trading 技能。
使用场景
当用户希望执行以下操作时使用此技能:
- - 设计或构建 Kalshi 专用模拟交易器
- 检查或核对 Kalshi 模拟持仓
- 以美分为单位正确存储 Kalshi 价格,避免单位混淆
- 计算 Kalshi 已实现和未实现盈亏
- 添加 Kalshi 原生风险敞口或风控规则
关键规则
除非用户明确要求保持兼容性,否则不要将 Kalshi 模拟执行路由到通用的 skills/paper-trading 账本。
此技能的默认假设:
- - Kalshi 执行价格以整数美分存储在 [0, 100] 范围内
- 结算价格为 100 或 0 美分
- 持仓以 marketticker + contractside 为键
- 风险控制基于保费和事件风险敞口,而非止损距离百分比风险
- 实时市场同步支持传统美分字段和现代 Kalshi *_dollars 报价字段
主要命令
初始化模拟账户:
bash
node --experimental-strip-types {baseDir}/scripts/kalshi_paper.ts init --account kalshi --starting-balance-usd 1000
检查状态:
bash
node --experimental-strip-types {baseDir}/scripts/kalshi_paper.ts status --account kalshi --format json --pretty
将实时市场报价同步到账本:
bash
node --experimental-strip-types {baseDir}/scripts/kalshi_paper.ts sync-market --market --format json --pretty
从 Kalshi 实时卖盘开立模拟交易:
bash
node --experimental-strip-types {baseDir}/scripts/kalshi_paper.ts buy-from-market --account kalshi --market --side YES --contracts 1 --format json --pretty
核对已结算市场:
bash
node --experimental-strip-types {baseDir}/scripts/kalshi_paper.ts reconcile --account kalshi --market --winning-side YES
查看账户表现:
bash
node --experimental-strip-types {baseDir}/scripts/kalshi_paper.ts review --account kalshi --format json --pretty
集成
将此技能与单独的 Kalshi API 读取技能配合使用,用于:
- - 市场发现
- 流动性验证
- 交易和订单簿检查
- 交易前候选排名
此技能仅负责模拟账本和执行端。
设计参考
在进行结构性更改前请阅读提案:
使用该文档了解:
- - 模式设计
- 命令界面
- 估值规则
- 结算逻辑
- 从通用模拟交易器的迁移计划
测试
运行 Kalshi 模拟交易器测试文件:
bash
node --test {baseDir}/tests/kalshi_paper.test.mjs