Shadow-mode starter for a Base/Morpho liquidation keeper agent.
This repository is prepared for:
- Railway first — fast hosted shadow worker.
- VPS migration later — Docker Compose deployment with restart policy and persistent logs.
This starter is intentionally read-only.
- No private key required.
EXECUTION_ENABLED=trueis blocked.SHADOW_MODE=falseis blocked.- Solidity execution contract is a placeholder and reverts.
pnpm install
cp .env.example .env
pnpm devHealth check:
curl http://127.0.0.1:8080/health- Push this repository to GitHub.
- In Railway, create a new project from the GitHub repository.
- Set variables from
.env.example. - Keep these safety variables:
SHADOW_MODE=true
EXECUTION_ENABLED=false
NO_PRIVATE_KEY=trueThe service exposes /health on port 8080.
cp .env.example .env
# edit .env
docker compose up -d --build
docker logs -f base-keeper-agentReboot test:
sudo reboot
# reconnect
cd base-keeper-agent
docker ps
docker logs --tail=100 base-keeper-agentThe worker:
- connects to Base RPC;
- reads the latest block;
- runs a shadow scan loop;
- exposes
/health; - writes JSONL events to
DATA_DIR; - never sends transactions.
The Morpho scanner is intentionally a safe placeholder. Add real Morpho market/position reading in packages/morpho-client after selecting initial markets.
pnpm start
pnpm typecheck
pnpm docker:build
pnpm docker:run- Configure 3–5 initial Morpho market IDs.
- Add Morpho market data reader.
- Add borrower/position scanner.
- Implement health factor calculation per real market data.
- Persist candidates.
- Run Railway shadow mode for 7 days.
- Migrate to VPS and run in parallel for 24–48 hours.
- Add simulator only after scanner is stable.
- Add execution only after simulator and security review.