harb/services/txnBot/README.md
johba 3ab2d9454a health checks (#39)
resolves #35

Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: johba <johba@harb.eth>
Reviewed-on: https://codeberg.org/johba/harb/pulls/39
2025-10-02 14:37:59 +02:00

1.1 KiB
Raw Blame History

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/dev.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/dev.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.