- Node.js (v20+)
- Docker
- Copy
dev.envto.envand fill in the empty values - Run
pnpm installto install dependencies
# Build the code, spin-up docker-compose, and start processing
pnpm run processMost notifications are managed through alert rules in the config database, not code.
-
Ensure the contract ABI is loaded:
pnpm run fetch-abi <address> <name> [chain] # Saves to abi/<name>.json pnpm run generate-abi-seed # Regenerates seed-abis.sql
-
Create an alert rule via the admin UI or insert directly into the
alert_ruletable with:chain_id— 1 (mainnet), 8453 (base), 146 (sonic)match_type—eventortraceaddresses— contract addresses to watchtopic0s— event signatures to matchtopic— Discord channel (OETH, OUSD, ARM, etc.)severity— low, medium, high, critical, broken, highlight
-
Rules are cached for 5 minutes — changes take effect without redeployment.
For alerts requiring custom business logic (e.g., OGN buybacks with USD calculations), add processors in src/topics/. See src/topics/ogn-buybacks/ for an example.
# Start processing at a specific block
BLOCK_FROM=12345678 pnpm run process
# Filter code-driven processors by name
PROCESSOR=Buyback pnpm run process
# Filter config-driven alert rules by name
ALERT="Lido ARM" pnpm run processThe v3 branch auto-deploys to Subsquid Cloud. To deploy:
- Merge your feature branch into
main - Merge
mainintov3
Manual deploy (requires updating squid.yaml first):
sqd deploy . --update # Deploy to Subsquid Cloud (use --update to prevent gaps)For new contract addresses, either:
- Add entries to
CONTRACT_ADDR_TO_NAMEinsrc/utils/addresses/names.ts - Add them to the
wallet_labeltable in the Railway database