Overview
This reference documents all major data structures used by the bot, including prediction results, interval records, configuration types, and API response shapes.Core Types
Tick
Price tick from ChainlinkFeed.src/feeds/chainlink.js:26
Example:
PredictionResult
Output fromPredictionEngine.predict().
src/engine/predictor.js:68-77
Example - Full prediction:
EVResult
Expected value calculation fromcalculateEV().
src/feeds/polymarket.js:141-150
Example:
BetResult
Bet sizing output from PositionSizer.src/risk/position-sizer.js
Example:
DrawdownState
Risk state from DrawdownTracker.src/risk/drawdown-tracker.js
Example:
IntervalRecord
Complete record of a closed 5-minute interval. Source:src/tracker/interval.js:6-56
Most fields are
null until the appropriate capture window:livePrediction: Updates every tickearlyPrediction+ model/market/bet/risk fields: Captured once at ≤60s remainingprediction: Captured once at ≤30s remainingfinalPrice,result, price dynamics,closedAt: Set when interval closes
API Response Types
VaticResponse
Response from Vatic strike price API.src/feeds/vatic.js:36
Example:
PolymarketMarket
Response fromdiscoverActiveMarket().
src/feeds/polymarket.js:38-46
Example:
Configuration Types
Config
Complete configuration schema fromconfig/default.json.
config/default.json
Example:
Enums
ConnectionStatus
onStatus callback.
Direction
IntervalResult
'UP': Final price > strike price'DOWN': Final price ≤ strike price'ACTIVE': Interval not closed yet
DrawdownLevel
'green': < 10% drawdown (default)'yellow': 10-20% drawdown (raise minEV threshold)'red': 20-30% drawdown (suspend trading)'critical': > 30% drawdown (emergency suspension)
AbstentionReason
Type Guards & Validators
isPrediction()
Check if a PredictionResult is a full prediction (not abstention).isValidTick()
Validate a price tick.src/feeds/chainlink.js:98-111).
isValidEV()
Check if EV result is tradeable.JSON Serialization
All data structures are JSON-serializable by design:- Dates: Stored as ISO strings (e.g.,
closedAt) - Timestamps: Unix seconds (epoch) or milliseconds (ticks)
- Null values: Explicitly stored (not undefined) for clarity
See Also
- PredictionEngine - Working with PredictionResult
- Data Feeds - API response types
- Interval Tracker - IntervalRecord lifecycle
- Configuration - Config schema reference