Hydra
Docs

How to install and configure the Hydra Polymarket bot.

Setup & Configuration

Installation

git clone https://github.com/hydra-app/polymarket-bot
cd polymarket-bot
npm install

Environment Variables

# Hydra API
HYDRA_JWT="eyJhbGci..."               # Your Hydra JWT
HYDRA_WS_URL="wss://api.hydra.app/stream"
HYDRA_API_URL="https://api.hydra.app/v1"
HYDRA_STREAMS="signals,markets,alerts" # Streams to subscribe to

# Polymarket
POLYMARKET_API_KEY="your-pm-api-key"
POLYMARKET_PRIVATE_KEY="0xYourEthPrivKey"  # For signing orders

# Strategy
DRY_RUN=true               # true = log only, no real orders
MAX_POSITION_SIZE=100      # USD per trade
KELLY_FRACTION=0.25        # Fraction of Kelly criterion to use
MIN_SIGNAL_SEVERITY=3      # Ignore signals below this severity
CORRELATION_THRESHOLD=0.6  # Min correlation score to flag a market
⚠️
Warning

Never commit your POLYMARKET_PRIVATE_KEY to version control. Use environment variables or a secrets manager. Start with DRY_RUN=true to validate your configuration before enabling live trading.

Running

# Dry run (no orders placed)
DRY_RUN=true npm run bot

# Live trading
DRY_RUN=false npm run bot

# With PM2 (persistent)
pm2 start ecosystem.config.js

Getting a Polymarket API Key

  1. Go to polymarket.com and connect your wallet
  2. Navigate to Profile → API Keys
  3. Generate a new key
  4. The key is scoped to your wallet — orders are signed client-side with your private key

Logging

The bot logs all decisions in structured JSON:

{
  "level": "info",
  "event": "signal_received",
  "signalId": "clxxx",
  "category": "NAVAL",
  "severity": 4,
  "ts": 1710000000000
}

{
  "level": "info",
  "event": "market_correlated",
  "marketId": "market-xyz",
  "question": "Will...",
  "correlationScore": 0.84,
  "currentPrice": 0.22
}

{
  "level": "info",
  "event": "order_placed",
  "marketId": "market-xyz",
  "outcome": "Yes",
  "side": "buy",
  "size": 50,
  "price": 0.23,
  "dryRun": false
}

Pipe to a file or log aggregator: npm run bot 2>&1 | tee bot.log