Skip to main content
You should have an API key and wallet private key for the same Trepa account (API keys, Wallet private key). This page uses Trepa’s official @trepa/sdk package. You create a small project, store both secrets in .env, then run a script built around trepa.bots.run. You start with a tiny fixed forecast and each pool’s minimum stake, then swap in a live BTC spot feed from Binance for the forecast. You need Node.js 22.12 or newer installed locally before you begin.

1. Create the project

Create .env next to package.json:
Keep secrets out of git:

2. Add the bot script

Create bot.ts. The smallest loop fixes a forecast and uses the pool’s minimum stake:
That version hard-codes the forecast. Below, the same structure reads the latest BTCUSDT price from Binance and uses it as the forecast each round:
bots.run waits for an open pool, runs your function, signs with the wallet key, submits, then waits again.

3. Run it

From the project directory:
Press Ctrl+C to stop. The SDK signs out cleanly before the process exits. When you are ready to change behaviour such as skipping rounds, hooks, or revising a forecast, continue to Writing bots. Next: Writing bots.
Last modified on June 13, 2026