config/default.json. All configuration parameters are loaded at runtime via src/config.js.
Configuration Structure
The configuration is organized into six top-level groups:- engine — Prediction model parameters (EWMA, momentum, abstention rules)
- feeds — Data source configuration (Chainlink, Polymarket APIs)
- storage — Data persistence paths
- bot — Main loop timing
- risk — Position sizing and risk management
Engine Configuration
The engine group controls the prediction model’s behavior, including volatility estimation, momentum analysis, abstention logic, and probability calculation.EWMA Volatility
Exponentially weighted moving average volatility estimator parameters.Decay factor for EWMA volatility calculation. Higher values (closer to 1.0) give more weight to recent observations.Range: 0.0 - 1.0
Recommended: 0.90 - 0.96Used in
Recommended: 0.90 - 0.96Used in
src/engine/volatility.js to compute exponentially weighted realized volatility:Momentum
Momentum analyzer configuration for rate-of-change and mean reversion signals.Maximum number of ticks stored in the momentum buffer. Controls the lookback window for ROC and mean reversion calculations.Range: 100 - 500
Recommended: 250 - 350Larger buffers capture longer-term trends but use more memory. At 1 tick/second, 300 ticks = 5 minutes of data.
Recommended: 250 - 350Larger buffers capture longer-term trends but use more memory. At 1 tick/second, 300 ticks = 5 minutes of data.
Abstention
The 7-condition abstention system prevents trading when the model has no edge.Minimum number of price ticks required before making predictions.Abstention condition 1: Insufficient dataPrevents predictions before the EWMA volatility estimator has enough samples. See
src/engine/predictor.js:83.Threshold for near-50% base probabilities. If
Example: With
|baseProb - 0.5| < deadZone, abstain.Abstention condition 2: Dead zonePrevents trading when Black-Scholes base probability is too close to 50% (no directional edge).Range: 0.05 - 0.15Example: With
deadZone=0.10, abstain if base probability is between 40% and 60%.Anomalous volatility threshold as a multiple of mean volatility.Abstention condition 3: Anomalous regimeIf
Recommended: 2.0 - 2.5
currentSigma > sigmaMultiplier * meanSigma, the market is in an unusual regime and the model abstains.Range: 1.5 - 3.0Recommended: 2.0 - 2.5
Minimum accuracy threshold for the rolling window.Abstention condition 4: Cold streakIf accuracy over the last
Default: 0.40 (40% accuracy)
minAccuracyWindow predictions drops below this threshold, suspend trading.Range: 0.35 - 0.50Default: 0.40 (40% accuracy)
Number of recent predictions to evaluate for cold streak detection.Works with
Recommended: 20
minAccuracy to implement condition 4. See src/engine/predictor.js:109.Range: 15 - 30Recommended: 20
Minimum expected value required to place a bet.Abstention condition 5: Insufficient EVIf
Example:
EV = (p/q - 1) < minEV, abstain. Enforced in src/index.js after fetching market price q.Range: 0.03 - 0.10Example:
minEV=0.05 means require at least +5% expected value per dollar wagered.Minimum edge (in percentage points) between model probability
Example:
p and market probability q.Abstention condition 6: Insufficient marginIf |p - q| < minMargin, abstain. Prevents trading on small edges that may be within model noise.Range: 0.10 - 0.20Example:
minMargin=0.15 requires at least 15pp edge (e.g., p=80%, q=65%).Prediction
Core prediction engine parameters for logit-space probability combination.Fallback probability when prediction fails (directional bias: UP).Range: 0.50 - 0.70
Note: Rarely used in production. Exists for graceful degradation.
Note: Rarely used in production. Exists for graceful degradation.
Fallback probability when prediction fails (directional bias: DOWN).Must satisfy:
fallbackDown = 1 - fallbackUpWeight applied to momentum factor in logit space.Critical tuning parameter. Controls how much momentum ROC influences the final prediction.Used in Range: 50 - 300
Recommended: 120 - 180
src/engine/predictor.js:130:Recommended: 120 - 180
Weight applied to mean reversion factor in logit space.Critical tuning parameter. Controls how much mean reversion influences the final prediction.Range: 40 - 150
Recommended: 60 - 100
Recommended: 60 - 100
Seconds before expiry when momentum/reversion adjustments are disabled.When
Rationale: Very close to expiry, momentum becomes noise and Black-Scholes distance-to-strike dominates.
timeRemaining <= nearExpiryGuardSec, the model uses only the Black-Scholes base probability without logit adjustments.Range: 3 - 10Rationale: Very close to expiry, momentum becomes noise and Black-Scholes distance-to-strike dominates.
Feeds Configuration
Data source configuration for price feeds and market APIs.Chainlink
Chainlink WebSocket feed parameters.Maximum allowed price change between ticks as a fraction.If
Example:
|newPrice - lastPrice| / lastPrice > spikeThreshold, the tick is rejected as a spike.Range: 0.05 - 0.20Example:
0.10 allows 10% jumps, rejecting anything larger.Implemented in src/feeds/chainlink.js to guard against WebSocket data corruption.Polymarket
Polymarket API configuration for market discovery and price fetching.Base URL for Polymarket Gamma API (event and market discovery).
Base URL for Polymarket CLOB API (market prices).
Slug prefix for filtering 5-minute BTC binary markets.Used in event discovery to identify relevant markets. Example market slug:
btc-updown-5m-2026-03-04-1430Seconds between Polymarket API polls for market prices.Range: 3 - 10
Recommended: 5Higher values reduce API load but may miss price updates. Lower values increase API request volume.
Recommended: 5Higher values reduce API load but may miss price updates. Lower values increase API request volume.
Fallback time offsets (in seconds) for market discovery when API fails.Type:
Example:
number[]Example:
[-300, 300] searches from 5 minutes before to 5 minutes after the target timestamp.Master switch for Polymarket feed.Set to
false to disable market price fetching (model predictions will still run, but EV/bet sizing will show N/A).Storage Configuration
Data persistence paths.Path to the JSON file storing interval history.Managed by
Auto-created: Yes (parent directory created automatically)
src/tracker/history.js. Contains all resolved intervals with predictions, outcomes, and metadata.Format: JSON array of interval objectsAuto-created: Yes (parent directory created automatically)
Bot Configuration
Main event loop timing.Main loop sleep interval in milliseconds.The bot runs a tick-update-predict-display cycle, then sleeps for this duration.Range: 500 - 2000
Recommended: 1000 (1 second)Lower values increase responsiveness but consume more CPU. Higher values reduce overhead but may miss rapid price changes.
Recommended: 1000 (1 second)Lower values increase responsiveness but consume more CPU. Higher values reduce overhead but may miss rapid price changes.
Risk Configuration
Position sizing and risk management parameters.Base Risk Parameters
Starting bankroll in USD.Used for position sizing and drawdown calculations. Update this to match your actual trading capital.
Maximum bet as a fraction of bankroll.Range: 0.02 - 0.10
Example:
Example:
0.05 caps bets at 5% of bankroll regardless of Kelly calculation.Prevents overexposure from aggressive Kelly fractions.Minimum bet size in USD.Bets smaller than this threshold are skipped (treated as abstention).Rationale: Avoids dust trades that don’t justify gas costs or trading fees.
Base Kelly fraction (deprecated in favor of Brier-based alpha tiers).Note: This parameter is not currently used. Position sizing uses the
brierTiers system instead.Drawdown Thresholds
4-level drawdown system with percentage thresholds from high-water mark.Yellow level: 10% drawdown from high-water mark.Effect: Warning indicator (no impact on bet sizing).
Red level: 20% drawdown from high-water mark.Effect: Reduces Kelly alpha by 50%.
Critical level: 30% drawdown from high-water mark.Effect: Trading suspended (all bets blocked).
Cold Streak Detection
Number of consecutive misses before triggering cold streak warning.Note: Currently informational only. The abstention system uses the rolling window accuracy check instead (
engine.abstention.minAccuracy).Minimum confidence level for a prediction to count toward the cold streak counter.Rationale: Low-confidence misses (e.g., 55% predictions) are less concerning than high-confidence misses (e.g., 85% predictions).
Brier Tiers
Dynamic Kelly fraction based on model calibration quality (Brier Score).Array of Brier tier objects that map model performance to Kelly fraction Default tiers:
Implemented in
alpha.Structure:| Tier | Brier Score | Min Predictions | Alpha | Fractional Kelly |
|---|---|---|---|---|
| 0 | Any | 0-99 | 0.00 | No trading |
| 1 | > 0.26 | 100+ | 0.10 | 10% Kelly |
| 2 | 0.22-0.26 | 100+ | 0.20 | 20% Kelly |
| 3 | 0.18-0.22 | 100+ | 0.25 | 25% Kelly |
| 4 | < 0.18 | 100+ | 0.40 | 40% Kelly |
src/risk/position-sizer.js:28-44.Configuration Loader
The configuration is loaded synchronously at startup viasrc/config.js:6:
- No environment variable overrides (all config in JSON)
- No runtime reloading (requires bot restart to apply changes)
- Single source of truth:
config/default.json
Next Steps
Tuning Parameters
Learn how to tune EWMA lambda, logit weights, and abstention thresholds for optimal performance.
Environment Setup
Set up data directories, configure logging, and prepare your environment for production.