Configuration
Hydra is configured via a YAML file. This file controls the bot’s operation mode, risk parameters, market discovery logic, and strategy settings.
Complete Example
Section titled “Complete Example”Below is a complete config.yaml example showcasing all available configuration blocks.
mode: paperipc: host: 127.0.0.1 port: 3000persistence: outDir: ./data snapshotIntervalMs: 1000risk: staleness: polymarketWsMs: 5000 binanceWsMs: 2000 chainlinkMs: 60000 reconciliation: enabled: true intervalMs: 60000 limits: maxDrawdownPercent: 10 maxPositionSizeUSDC: 500 maxOrdersPerMinute: 30simulation: feeModel: maker: 0.0001 taker: 0.0002 latencyMs: 150 fillProbability: 0.95markets: coins: - Bitcoin - Ethereum - Solana durations: - 5m - 15m - 1h maxMarkets: 5 scoring: minVolume24hr: 1000 minLiquidity: 500 maxSpread: 0.10 maxStrikeDistancePercent: 0.10 strikeProximityWeight: 0.35 volumeWeight: 0.25 liquidityWeight: 0.20 spreadWeight: 0.10 edgeWeight: 0.10strategies: enabled: - latency_arb latency_arb: edgeThreshold: 0.02 maxPositionSize: 50 cooldownMs: 5000 volatilityWindowMs: 300000 minVolatility: 0.1replay: input: ./recordings/session_20250110.binCore Settings
Section titled “Core Settings”| Key | Type | Description |
|---|---|---|
mode | String | Execution mode: replay (historical data), paper (live data, simulated execution), or live (real trading). |
ipc | Object | Connection settings for the Terminal User Interface (TUI). |
persistence | Object | Settings for saving logs, snapshots, and performance data. |
Risk Management
Section titled “Risk Management”The risk section defines safety thresholds to protect capital and ensure data integrity.
Staleness
Section titled “Staleness”Defines the maximum allowed age of price data before it is considered “stale” and trading is halted.
polymarketWsMs: Max latency for Polymarket WebSocket updates.binanceWsMs: Max latency for Binance price updates.chainlinkMs: Max age for Chainlink oracle data.
Reconciliation
Section titled “Reconciliation”Periodically verifies that local state matches the exchange state.
enabled: Whether to perform reconciliation.intervalMs: Frequency of reconciliation checks.
Limits
Section titled “Limits”Hard bounds on trading activity.
maxDrawdownPercent: Max allowed portfolio drawdown before emergency stop.maxPositionSizeUSDC: Max size for a single position in USDC.maxOrdersPerMinute: Rate limiting for order placement.
Simulation
Section titled “Simulation”Configure the simulation engine used in paper and replay modes.
feeModel: Simulated trading fees formakerandtakerorders.latencyMs: Simulated network latency added to every action.fillProbability: The likelihood (0.0 to 1.0) that a limit order is filled when price touches the limit.
Market Discovery & Scoring
Section titled “Market Discovery & Scoring”The bot automatically discovers and ranks markets based on specific criteria. This allows it to focus on the most profitable or liquid opportunities.
Filtering
Section titled “Filtering”coins: List of underlying assets to monitor (e.g., Bitcoin, Ethereum).durations: Target market durations (e.g., 5m, 1h).maxMarkets: Maximum number of concurrent markets to track.
Smart Scoring Config
Section titled “Smart Scoring Config”Markets are scored using a weighted average of several factors. Higher scores receive higher priority for tracking and strategy execution.
| Parameter | Default | Description |
|---|---|---|
minVolume24hr | 100 | Minimum 24-hour volume required to consider a market. |
minLiquidity | 100 | Minimum order book liquidity. |
maxSpread | 0.15 | Maximum bid-ask spread (as a decimal) allowed. |
maxStrikeDistancePercent | 0.15 | Maximum distance from current price to strike price. |
strikeProximityWeight | 0.35 | Weight given to how close the current price is to the strike. |
volumeWeight | 0.25 | Weight given to 24h trading volume. |
liquidityWeight | 0.20 | Weight given to market liquidity. |
spreadWeight | 0.10 | Weight given to tight spreads (lower spread = higher score). |
edgeWeight | 0.10 | Weight given to detected price discrepancies. |
Strategy Configuration
Section titled “Strategy Configuration”The strategies section manages which logic modules are active and their specific parameters.
Latency Arbitrage
Section titled “Latency Arbitrage”Configures the latency_arb strategy, which exploits price delays between Polymarket and faster venues like Binance.
edgeThreshold: Minimum price discrepancy required to trigger a trade.maxPositionSize: Maximum number of contracts per trade.cooldownMs: Time to wait after a trade before looking for new opportunities.volatilityWindowMs: Time window for calculating asset volatility.minVolatility: Minimum volatility required to enable the strategy.
Replay Settings
Section titled “Replay Settings”When mode is set to replay, use this section to specify the source data.
input: File path to the binary recording of market data.