| name | add-signal |
| description | End-to-end workflow for adding a new predictive signal to the market maker |
| disable-model-invocation | true |
| context | fork |
| agent | general-purpose |
| argument-hint | [signal-name] [prediction-target] |
| allowed-tools | Read, Grep, Glob, Edit, Write, Bash |
Add Signal Workflow
Step-by-step process for adding a new predictive signal. Follow measurement-before-modeling: define what you're predicting, log it, measure baseline, then build.
Step 1: Define the Signal
Before writing code, answer:
- What does it predict? (price direction, fill probability, adverse selection, volatility)
- At what horizon? (100ms, 1s, 10s, 60s)
- What is the prediction target metric? (Brier Score for binary, IR for continuous)
- What is the baseline? (naive predictor, e.g., always predict 50% for binary)
Step 2: Implement the Estimator
Create a new file in src/market_maker/estimator/:
pub struct MySignalEstimator {
}
impl MySignalEstimator {
pub fn new(config: MySignalConfig) -> Self { ... }
pub fn update(&mut self, data: &MarketData) { ... }
pub fn signal_value(&self) -> f64 { ... }
pub fn confidence(&self) -> f64 { ... }
}
Conventions
- Use
_bps suffix for basis point values
- Use
_s suffix for seconds
- Use EWMA with configurable halflife for online stats
- Add
#[serde(default)] to any checkpoint fields for backward compat
- Include a
warmup_observations: usize counter
Step 3: Register in mod.rs
Add the module to src/market_maker/estimator/mod.rs:
pub mod my_signal;
pub use my_signal::MySignalEstimator;
Step 4: Wire into Signal Integration
src/market_maker/strategy/signal_integration.rs is the central hub. Add your signal:
- Add field to the struct that holds estimators
- Call
update() in the appropriate update method
- Add signal output to
compute_signals() or equivalent
- Include in prediction logging
IMPORTANT: Only the strategy teammate edits signal_integration.rs in team mode. Others propose changes via messages.
Step 5: Add Model Gating
In src/market_maker/calibration/model_gating.rs:
- Add your signal to the gating system
- Set initial weight to 0.0 (disabled until validated)
- Define MI threshold for activation
- Signal should only contribute when
should_use_model() returns true
Step 6: Add Prediction Logging
Ensure your signal's predictions are logged for calibration:
- Add to
PredictionRecord in checkpoint/prediction system
- Log both the signal value and the prediction target outcome
- Include market state conditioning variables
Step 7: Set Up Calibration
In src/market_maker/calibration/:
- Add Brier Score tracking for your signal's predictions
- Add Information Ratio computation
- Set up conditional calibration (by regime, volatility, time of day)
- Define warning thresholds (IR < 1.0 = warning, IR < 0.8 = critical)
Step 8: Verify
cargo clippy -- -D warnings
cargo test --lib
cargo build
Step 9: Validate Live
- Run paper trader with signal enabled (weight = 0.0 initially)
- Collect at least 24h of prediction data
- Compute Brier Score and IR
- If IR > 1.0, gradually increase weight via model gating
- Monitor for 1 week before full deployment
Checklist