Installation
Follow these steps to install and configure Hydra.
Option 1: Pre-built Binaries (Recommended)
Section titled “Option 1: Pre-built Binaries (Recommended)”The easiest way to install Hydra is using pre-built binaries. This doesn’t require Bun or any development tools.
Quick Install
Section titled “Quick Install”curl -fsSL https://raw.githubusercontent.com/rnwolfe/hydra/main/scripts/install.sh | bashThis automatically:
- Detects your OS and architecture (Linux, macOS, including Apple Silicon)
- Downloads the appropriate binaries
- Installs to
~/.hydra/bin
Add to PATH
Section titled “Add to PATH”After installation, add Hydra to your PATH:
# For bashecho 'export PATH="$HOME/.hydra/bin:$PATH"' >> ~/.bashrcsource ~/.bashrc
# For zshecho 'export PATH="$HOME/.hydra/bin:$PATH"' >> ~/.zshrcsource ~/.zshrc
# For fishfish_add_path ~/.hydra/binVerify Installation
Section titled “Verify Installation”hydra --helpInstall Specific Version
Section titled “Install Specific Version”curl -fsSL https://raw.githubusercontent.com/rnwolfe/hydra/main/scripts/install.sh | bash -s -- v0.1.0Custom Install Location
Section titled “Custom Install Location”HYDRA_INSTALL=/opt/hydra curl -fsSL https://raw.githubusercontent.com/rnwolfe/hydra/main/scripts/install.sh | bashAvailable Commands
Section titled “Available Commands”The hydra binary provides all functionality through subcommands:
| Command | Description |
|---|---|
hydra run | Start trading (paper mode by default) |
hydra run --mode live | Start live trading |
hydra run --mode replay | Replay recorded session |
hydra record | Record market data sessions |
hydra latency | Network latency diagnostics |
Note: The TUI dashboard (
hydra tui) is only available when running from source due to a library limitation.
Supported Platforms
Section titled “Supported Platforms”| Platform | Architecture |
|---|---|
| Linux | x64, ARM64 |
| macOS | x64, ARM64 (Apple Silicon) |
| Windows | x64 |
Option 2: From Source
Section titled “Option 2: From Source”For development or if you prefer running from source.
Prerequisites
Section titled “Prerequisites”- Git: For cloning the repository
- Bun: Version >= 1.3.5 (installation guide)
Download the Code
Section titled “Download the Code”git clone https://github.com/rnwolfe/hydra.gitcd hydraInstall Dependencies
Section titled “Install Dependencies”bun installRun Commands
Section titled “Run Commands”When running from source, use bun run scripts:
| Binary Command | Source Equivalent |
|---|---|
hydra run | bun run paper |
hydra run --mode live | bun run bot |
hydra record | bun run record |
hydra run --mode replay | bun run replay |
| N/A (source only) | bun run tui |
Configuration
Section titled “Configuration”The bot requires a configuration file to function.
Create Config File
Section titled “Create Config File”cp config.example.yaml config.yamlBy default, the bot looks for config.example.yaml. To use a different file:
# With binaryhydra run --config ./config.yaml
# From sourceBOT_CONFIG=./config.yaml bun run paperEnvironment Variables
Section titled “Environment Variables”| Variable | Description | Required |
|---|---|---|
POLYMARKET_PRIVATE_KEY | Ethereum private key for live trading | Only for live mode |
BOT_CONFIG | Path to config file | Optional (defaults to ./config.example.yaml) |
Example .env File
Section titled “Example .env File”POLYMARKET_PRIVATE_KEY=0x...your...private...key...BOT_CONFIG=./config.yamlBun automatically loads .env files. If using binaries, create the .env in your working directory.
Verification
Section titled “Verification”With Binary
Section titled “With Binary”# Check that binary is installedwhich hydra
# Run paper trading (will connect to live market data)hydra runFrom Source
Section titled “From Source”# Run type checkingbun run typecheck
# Run unit testsbun test
# Start paper tradingbun run paperBuilding from Source
Section titled “Building from Source”To create your own binaries:
# Build all binaries for current platformbun run build:local
# Build for all platformsbun run build:all
# Build specific entriesbun run build -- --entry=bot,tuiBinaries are output to dist/<platform>/.
Note: The TUI cannot be compiled to a binary due to a library limitation. Use
bun run tuifrom source instead.