Skip to content

3 · Run locally or host your example ​

Installed the starter before 2 November 2026?

Update it to the current main of hive-trade/bots before any live run. Older copies place Polymarket orders from a bot wallet of their own and sign their own stake, and their Kalshi rule accepts only three crypto series. The current starter only signs the Call: HiveTrade places the order in your own HiveTrade account, and each Call stakes the Hive's Amount per Call within its Total budget. Never work around an API refusal by placing a local order.

The public starter uses Node.js 24+ and npm. From its repository root, use npm ci, configure .env, and run npm start.

The command checks one exact market and exits. It is a one-shot job, not an always-on web service; it has no /health endpoint. Begin locally before asking your agent to add scheduling or your own market-discovery rule.

Ask your AI agent to deploy to Railway ​

Today this guided setup runs dry runs only. On the server the bot checks its market on a schedule and places no order, and the logs show a completion line, not the bot's decisions. To trade from a server, use the manual hosting steps below.

The public repository includes a Railway deployment skill and a step-by-step hosting guide. Give your agent this prompt:

Follow the hivetrade-deploy skill in github.com/hive-trade/bots. Use my existing Railway CLI login to deploy my example to a new empty service, with persistent storage and a schedule, then verify a hosted dry run.

Your agent will help fill in the project, environment and service UUIDs, your Hive ID, an open market and the schedule in a public, non-secret JSON config. plan needs the real UUIDs, so create the Railway project and an empty service first. From the public repository, the workflow is:

sh
npm run railway -- plan deploy/railway.local.json
npm run railway -- deploy deploy/railway.local.json
npm run railway -- verify deploy/railway.local.json DEPLOYMENT_UUID

This creates billable Railway resources. The helper uploads only runtime files, attaches a persistent volume, and schedules a single preview job. It uses no HiveTrade login, uploads no .env, and keeps live trading disabled. Verification checks a completion marker from that specific deployment; uploading alone is not success. The generated preview wrapper cannot enable trading through a variable.

Choose a 5, 10, 15, 20, 30 or 60 minute interval. Railway cron runs in UTC and is approximate, so it is unsuitable for precise market timing. The starter still checks one fixed market; you must implement market rollover for continued use when that market closes. The helper requires a new empty service and does not overwrite existing deployments. See its guide for partial-failure recovery and subsequent service changes.

Hosting on Railway or another Node host ​

  • Install with npm ci from the public bot repository root.
  • Supply environment variables through the host's secret settings. With host-provided variables, the start command is node bot.mjs (no .env file required).
  • Use Node.js 24+ and one runner instance.
  • Mount a persistent volume and set STATE_DIR to a directory on that volume.
  • Do not configure an HTTP healthcheck for this one-shot command.
  • Keep BOT_LIVE_TRADING_ENABLED=false for the first run.

A scheduler can invoke the job repeatedly, but the journal prevents a second attempt on the same market. Redeployments must retain that journal. A continuous bot needs your own market-selection rule, cumulative exposure/spending limits, supervision and settlement handling. Keep the duplicate and uncertainty guards.

Moving the private signing key to a host is an explicit choice: use its secret store, never Git or a Dockerfile. Configure only this bot's identity and use the same API environment where its Hive was registered.

Next: verify and go live »

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