harb/services/txnBot
2025-09-24 14:02:28 +02:00
..
.env.template merge liquidity and liquidation bot 2024-09-17 11:23:43 +02:00
.gitignore merge liquidity and liquidation bot 2024-09-17 11:23:43 +02:00
.graphql merge liquidity and liquidation bot 2024-09-17 11:23:43 +02:00
AGENTS.md fix agent 2025-09-24 09:57:20 +02:00
generateKey.js merge liquidity and liquidation bot 2024-09-17 11:23:43 +02:00
package.json replaced subgraph with ponder 2025-09-23 19:24:05 +02:00
README.md replaced subgraph with ponder 2025-09-23 19:24:05 +02:00
service.js fix web-app 2025-09-24 14:02:28 +02:00

txnBot

Automation worker that monitors staking positions and calls recenter() / payTax() when profitable.

Environments

The bot supports three environments shared across the stack:

  • BASE_SEPOLIA_LOCAL_FORK Anvil fork started by scripts/local_env.sh
  • BASE_SEPOLIA Public Base Sepolia testnet
  • BASE Base mainnet

Set ENVIRONMENT alongside the other variables listed below to target the desired chain.

Configuration

Create an environment file (e.g. .env) with:

ENVIRONMENT=BASE_SEPOLIA
PROVIDER_URL=<rpc-url>
PRIVATE_KEY=<hex-private-key>
LM_CONTRACT_ADDRESS=<liquidity-manager-address>
STAKE_CONTRACT_ADDRESS=<stake-contract-address>
GRAPHQL_ENDPOINT=<ponder-graphql-url>
# Optional: PORT=43069

scripts/local_env.sh start generates these values automatically for the local fork, writes them to a temporary file, and keeps the process running in the background.

Local Run

npm install
npm start

The service exposes a lightweight status endpoint at GET /status reporting uptime, balances, and the most recent automation activity.