Keeper Bots
Keeper bots keep Velocity operational by performing automated actions as off-chain agents. Keepers are rewarded depending on the duties they perform.
| Bot Type | Difficulty | Capital Required | Rewards | Link |
|---|---|---|---|---|
| Matching Bot | Basic | No | TBD | Tutorial: Order Matching Bot |
| Order Trigger | Basic | No | TBD | Tutorial: Order Trigger Bot |
| Liquidator | Advanced | Yes | TBD | Tutorial: Liquidation Bot |
| JIT Maker Bot | Advanced | Yes | TBD | Tutorial: JIT Maker Bot |
Note: all bots require some SOL for rent and transaction fees.
The reference implementation lives at apps/keeper-bots-v2 inside the velocity-v1 monorepo — unlike Drift’s standalone keeper-bots-v2 repo, there is no separate devnet/mainnet-beta branch split; the app’s ENV config value selects the cluster.
Clone the monorepo and install
git clone https://github.com/velocity-exchange/velocity-v1.git
cd velocity-v1
bun install # run once, at the repo root — this is a Bun workspaceConfigure environment + YAML config
From apps/keeper-bots-v2, copy the env template and set required values:
cd apps/keeper-bots-v2
cp .env.example .envRequired env vars:
KEEPER_PRIVATE_KEY: keypair array or path tokeypair.jsonENDPOINT: RPC endpointENV:devnetormainnet-beta
The app uses a YAML config for bot selection and per-bot settings. Start from example.config.yaml and set:
global.endpointglobal.keeperPrivateKey(or env var)enabledBots+botConfigs
Initialize a Velocity user (if needed)
Bots that place orders or manage positions require a Velocity user account. The app provides a helper flag:
bun run dev --init-userif (!(await velocityClient.getUser().exists())) {
logger.info(`Creating User for ${wallet.publicKey}`);
const [txSig] = await velocityClient.initializeUserAccount();
logger.info(`Initialized user account in transaction: ${txSig}`);
}Deposit collateral (if needed)
Required for liquidators and JIT makers that keep open positions:
# deposit 10,000 of spot market 0's quote asset (USDC on mainnet-beta; dUSDT on devnet)
bun run dev --force-deposit 10000Run the bots
bun run dev --config-file=example.config.yaml