Trading systems is an AI agent skill from the GitHub repository rnavarych/alpha-engineer. Guides trading system design: order matching engines (price-time priority, pro-rata), market data feeds (WebSocket, FIX protocol), order types (market, limit, stop, stop-limit), position management, P&L calculation, risk limits, low-latency architecture, and market microstructure. Use when building
Claude Code: save it as .claude/skills/trading-systems/SKILL.md
Cursor: save it as .cursor/rules/trading-systems.md
Codex: save it as .agents/skills/trading-systems/SKILL.md
ChatGPT, Gemini and other assistants: paste it into custom or project instructions
Skill file
Trading Systems
When to use
Designing or reviewing an order matching engine (price-time vs pro-rata)
Implementing FIX protocol sessions or WebSocket market data feeds
Adding advanced order types (iceberg, FOK, IOC, trailing stop)
Building real-time position tracking and P&L calculation (realized/unrealized)
Implementing pre-trade risk checks with <1ms latency budget
Optimizing for low-latency with lock-free design or kernel bypass networking
Core principles
Matching engine is single-threaded — deterministic, no locking, nanosecond timestamps; concurrency buys nothing here
Pre-trade checks are the last line of defense — all checks under 1ms or you're adding slippage for your users
Kill switch is non-negotiable — cancel all orders and flatten positions in one operation; no exceptions
Journal lines are P&L truth — running MTM is a cache; reconcile against fills at end of day
Binary protocols over JSON at co-location — SBE/Cap'n Proto at microsecond latency; JSON is for dashboards
Reference Files
references/order-matching-market-data.md — price-time and pro-rata matching algorithms, order book data structure, matching engine requirements, WebSocket Level 1/2 feeds, FIX protocol sessions, market data architecture
references/orders-positions-pnl.md — basic and advanced order types, order validation rules, real-time position tracking, position limits, realized P&L (FIFO/LIFO/weighted avg), unrealized MTM, P&L attribution
Use this skill with your AI agent:Open on Skill Issue to copy, download, or add to your library.
Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.