Highlights
This release is a major architectural refactor that splits the monolithic client into a modular workspace monorepo with independent, testable packages.
Modular workspace architecture
The bot is now organized into six packages, each with its own build, types, and test suite:
apps/config— Single source of truth for chain configs, venue/pricer/data-provider registrations, and all tunable parametersapps/client— Bot orchestration and on-chain execution (no config or secrets hardcoded)apps/data-providers— Pluggable data provider interface with factory patternapps/liquidity-venues— Pluggable liquidity venue interface with factory patternapps/pricers— Pluggable pricer interface with factory patternapps/hyperindex— Envio HyperIndex indexer for on-chain event indexing
Pre-liquidation support
- Full support for Morpho Blue pre-liquidations via the HyperIndex data provider
- Fetches pre-liquidation contracts, user authorizations, and on-chain oracle prices
- Filters positions by whitelisted markets and authorization status
- Selects the best pre-liquidation contract per user per market (highest seizable collateral)
New data provider: HyperIndex
- GraphQL-based data provider powered by Envio HyperIndex
- Supports both liquidations and pre-liquidations
- Paginated position fetching (handles large markets beyond Hasura's default limit)
- Authorization queries filtered by pre-liquidation contract addresses
- Can be self-hosted with RPCs or use the Envio hosted service (recommended)
Bug fixes & improvements
- 1inch venue: Fixed duplicate
chainIdparameter (path + query) causing Bad Request errors; upgraded API to v6.1 - Skim refactoring: Replaced
erc20Skim(requires transient storage support) with a reusableskimfunction using on-chainbalanceOf+erc20Transfer, compatible with older executor contracts - Error handling: All data provider errors now include chain ID for multi-chain debugging; errors passed as objects (not string-interpolated) to preserve stack traces;
Promise.allSettledused for market fetching so one failed market doesn't discard all results - CI: Added Claude Code review workflow, updated test scripts
Breaking changes
- Package structure has changed — imports from
@morpho-blue-liquidation-bot/*packages replace direct file imports - Configuration now lives entirely in
apps/config— the client, venues, pricers, and data providers read from it via package imports - Data providers are now multi-chain: a single instance is shared across all chains
Full Changelog: v3.0.0...v4.0.0