Skip to content

Configuration

Hydra is configured via a YAML file. This file controls the bot’s operation mode, risk parameters, market discovery logic, and strategy settings.

Below is a complete config.yaml example showcasing all available configuration blocks.

mode: paper
ipc:
host: 127.0.0.1
port: 3000
persistence:
outDir: ./data
snapshotIntervalMs: 1000
risk:
staleness:
polymarketWsMs: 5000
binanceWsMs: 2000
chainlinkMs: 60000
reconciliation:
enabled: true
intervalMs: 60000
limits:
maxDrawdownPercent: 10
maxPositionSizeUSDC: 500
maxOrdersPerMinute: 30
simulation:
feeModel:
maker: 0.0001
taker: 0.0002
latencyMs: 150
fillProbability: 0.95
markets:
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.10
strategies:
enabled:
- latency_arb
latency_arb:
edgeThreshold: 0.02
maxPositionSize: 50
cooldownMs: 5000
volatilityWindowMs: 300000
minVolatility: 0.1
replay:
input: ./recordings/session_20250110.bin
KeyTypeDescription
modeStringExecution mode: replay (historical data), paper (live data, simulated execution), or live (real trading).
ipcObjectConnection settings for the Terminal User Interface (TUI).
persistenceObjectSettings for saving logs, snapshots, and performance data.

The risk section defines safety thresholds to protect capital and ensure data integrity.

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.

Periodically verifies that local state matches the exchange state.

  • enabled: Whether to perform reconciliation.
  • intervalMs: Frequency of reconciliation checks.

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.

Configure the simulation engine used in paper and replay modes.

  • feeModel: Simulated trading fees for maker and taker orders.
  • 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.

The bot automatically discovers and ranks markets based on specific criteria. This allows it to focus on the most profitable or liquid opportunities.

  • 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.

Markets are scored using a weighted average of several factors. Higher scores receive higher priority for tracking and strategy execution.

ParameterDefaultDescription
minVolume24hr100Minimum 24-hour volume required to consider a market.
minLiquidity100Minimum order book liquidity.
maxSpread0.15Maximum bid-ask spread (as a decimal) allowed.
maxStrikeDistancePercent0.15Maximum distance from current price to strike price.
strikeProximityWeight0.35Weight given to how close the current price is to the strike.
volumeWeight0.25Weight given to 24h trading volume.
liquidityWeight0.20Weight given to market liquidity.
spreadWeight0.10Weight given to tight spreads (lower spread = higher score).
edgeWeight0.10Weight given to detected price discrepancies.

The strategies section manages which logic modules are active and their specific parameters.

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.

When mode is set to replay, use this section to specify the source data.

  • input: File path to the binary recording of market data.