一键导入
debug-pnl
Step-by-step workflow for diagnosing why the market maker is losing money
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Step-by-step workflow for diagnosing why the market maker is losing money
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
State persistence, prior transfer, and warmup lifecycle. Read when working on checkpoint/, adding new checkpoint fields, debugging cold starts or stale priors, or understanding serde(default) requirements and backward compatibility rules.
Documents auto_derive.rs first-principles parameter derivation from capital and exchange metadata. Use when onboarding new assets, debugging parameter mismatches, understanding why gamma/max_position/target_liquidity have their values, or adding new derived parameters.
WebSocket management, event loop, rate limiting, reconnection, recovery, metrics, and order execution infrastructure. Use when working on orchestrator/, infra/, messages/, core/, fills/, or execution/ modules, debugging connectivity or order placement, adding message handlers, or investigating stale data and latency issues.
Documents the 9 learning feedback loops, SpreadBandit Thompson Sampling, adaptive ensemble, confidence tracking, and baseline tracker. Use when debugging learning behavior, tuning reward attribution, investigating model weight decay, or understanding how fills translate into parameter updates.
Layered risk system with monitors, circuit breakers, kill switch, and position guards. Use when working on risk/, safety/, or monitoring/ modules, debugging position limits, emergency shutdowns, spread widening, or adding new risk monitors. Covers RiskMonitor trait, severity escalation, and defense-first architecture.
Documents the additive spread composition pipeline from GLFT optimal through to final bid/ask prices. Use when debugging wide spreads, investigating spread component contributions, tuning defensive behavior, or understanding why quotes are wider than expected. Critical for incident triage.
基于 SOC 职业分类
| name | debug-pnl |
| description | Step-by-step workflow for diagnosing why the market maker is losing money |
| disable-model-invocation | true |
| context | fork |
| agent | general-purpose |
| argument-hint | [asset] [timerange] |
Structured diagnostic for market maker PnL issues. Follow these steps in order.
Check PnL attribution to find which component is causing losses. Read the relevant analytics:
src/market_maker/analytics/attribution.rs — PnL decomposition
src/market_maker/analytics/edge_metrics.rs — Edge tracking
src/market_maker/analytics/sharpe.rs — Sharpe ratio
PnL decomposes into:
The largest negative component is your priority target.
| Dominant Drag | Check These | Read Skill |
|---|---|---|
| Adverse selection | adverse_selection/, calibration/ | adverse-selection-classifier |
| Spread too tight | strategy/signal_integration.rs | quote-engine |
| Inventory cost | strategy/position_manager.rs, control/ | stochastic-controller |
| Fill rate collapsed | estimator/kappa.rs, simulation/fill_sim.rs | fill-intensity-hawkes |
| Regime misclassification | estimator/regime_hmm.rs | regime-detection-hmm |
| Cascade losses | risk/circuit_breaker.rs, risk/monitors/cascade.rs | risk-management |
For the identified component, check its calibration metrics:
src/market_maker/calibration/brier_score.rs — Brier Score
src/market_maker/calibration/information_ratio.rs — Information Ratio
src/market_maker/calibration/conditional_metrics.rs — Conditional calibration
src/market_maker/calibration/model_gating.rs — Model weight/gating
Key thresholds:
Check if the issue is regime-specific:
conditional_metrics.rs by volatility buckettime_to_funding_settlement_sRegime-specific failures suggest the model needs regime-dependent parameters.
After identifying and fixing the issue:
fill_rate_model.rs for stale estimatespre_fill_classifier.rs z-score computation