- Remove permanently unreachable guard branches from evaluateRecenterOpportunity - Remove orphaned getWalletAddress() from BlockchainService - Simplify RecenterAccessStatus type: drop always-null recenterAccessAddress and slot fields, narrow hasAccess to boolean - Update /status endpoint to match simplified type - Remove test script (no test files remain) - Revert unrelated kraiken-lib/package-lock.json churn Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src | ||
| .env.template | ||
| .gitignore | ||
| .graphql | ||
| .lintstagedrc.json | ||
| .prettierrc | ||
| AGENTS.md | ||
| eslint.config.js | ||
| package.json | ||
| README.md | ||
| tsconfig.build.json | ||
| tsconfig.json | ||
txnBot
Automation worker that monitors staking positions and calls recenter() / payTax() when profitable.
Environments
The bot supports four environments shared across the stack:
BASE_SEPOLIA_LOCAL_FORK– Anvil fork of Base Sepolia started byscripts/dev.shBASE_MAINNET_LOCAL_FORK– Anvil fork of Base mainnet started byscripts/dev.shBASE_SEPOLIA– Public Base Sepolia testnetBASE– 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.
Generate a New Operator Key
Run npm run generate-key to produce a fresh EOA. The command writes the private key and address as JSON log entries to txnbot.log. Be sure to rotate the log or move the credentials to a secure store immediately after use.