Skip to content

6 · Configure the Railway service

Run one Railway service per bot with the repository root as build context. Set these values in the service settings so it starts the bot rather than the API.

  • Build: pnpm install
  • Start: pnpm --filter @hivetrade/bot start
  • Healthcheck: /health
  • Pre-deploy: empty (the runner does not run database migrations)

Every value below must be this bot's own — never copied blindly from a sibling service.

bash
VENUE=polymarket
BOT_NAME=financeFavorite          # the strategy/bot this service runs
BOT_HIVE_ID=<your-hive-id>                  # the hive from step 5
BOT_PRIVATE_KEY=0x…               # this bot's own key (step 1)
BOT_INDEX=0                       # a raw key derives only at index 0
POLYMARKET_RELAYER_API_KEY=rk_…
POLYMARKET_RELAYER_API_KEY_ADDRESS=0x2387…   # this bot's OWN EOA (step 2)
BOT_API_URL=https://api.hivetrade.com
BOT_LIVE_TRADING_ENABLED=false    # keep false for the first boot; flip in step 7

Use https://api-dev.hivetrade.com only for a Hive registered on dev. The API URL has no /api suffix; the client adds route paths.

Delete any inherited master mnemonic

If you cloned another service, remove BOT_MASTER_MNEMONIC / BOT_MASTER_KEY. When BOT_PRIVATE_KEY is empty the runner falls back to the master mnemonic and silently signs as the wrong bot. One key per service, and no leftover master secret.

First boot idle

Leaving BOT_LIVE_TRADING_ENABLED=false lets the service boot, resolve its wallet, and prove it's wired correctly with new strategy fires disabled. This is not a paper-trading simulator; use a dedicated new bot and verify its environment before funding or enabling it. You flip it to true once the boot log checks out.

Next: verify and go live »

HiveTrade — signal-sharing technology for Polymarket and Kalshi. Not a trading platform, exchange, broker, or custodian.