Liquidation Bot Development: Compound, Morpho & Spark
By Merunas Grincalaitis (X · GitHub · DEV · Hashnode · Telegram), Founder & Lead MEV Engineer at MEV DAO — Ethereum smart contract, Flashbots & MEV builder since 2017. Last updated: October 2026.
TL;DR: In liquidation bot development on Ethereum in 2026, targeting only Aave V3 is a mistake because dozens of entrenched searchers bid away 92%–98% of standard Aave liquidation bonuses to block builders. The highest risk-adjusted margins today come from building a multi-protocol liquidation bot that covers Morpho Blue (isolated markets with custom oracle adapters and permissionless LLTVs), Compound V3 (Comet) (absorb() + Dutch-auction buyCollateral() pricing), SparkLend, and Euler V2 / Curve LlamaLend—all executed with zero upfront capital via atomic flash loans and private mev-share / oracle backrun bundles.
Part of the Custom MEV Bot Architecture, Arbitrage, Liquidations & Hiring Topic Cluster: Start with our Pillar Guide, Custom MEV Bot Development: What to Know Before You Hire, for the complete architectural blueprint. This guide focuses specifically on liquidation bot development with production Ethereum mainnet parameters and runnable verification steps.
In our earlier breakdown of How Liquidation Bots Work on Aave (And Why They're Hard to Win), we explained why cloning a basic Aave V3 script from GitHub rarely lands a single contested mainnet liquidation.
When funds or solo searchers come to us for liquidation bot development, our first engineering recommendation is always the same: go where the liquidation mechanics are slightly harder to index. Because 90% of amateur liquidation bot github repos only hardcode Aave's liquidationCall(), protocols with isolated markets, two-step absorption/Dutch auctions, or custom oracle adapters have 5x to 10x less searcher competition and keep far larger net profit margins.
Here is how modern liquidation bot development works across Morpho Blue, Compound V3, SparkLend, and Aave V3, with working architecture patterns you can reference alongside our open-source mev-arbitrage-and-liquidation-reference GitHub repository.
Protocol comparison for liquidation bot development (2026)
| Lending Protocol | Liquidation Function & Mechanism | How Collateral Discount Is Determined | Oracle Architecture | Searcher Competition & Net Profit Kept |
|---|---|---|---|---|
Aave V3 (Pool) |
Single-step liquidationCall(collateral, debt, user, debtToCover, false) |
Fixed Liquidation Bonus (4% – 10% depending on asset e-Mode) |
Chainlink Price Feeds (transmit()) |
Extreme (Builders capture 90%–98% of bonus via MEV-Share / OEV auctions) |
Morpho Blue (Morpho Singleton) |
Single-step liquidate(MarketParams, borrower, seizedAssets, repaidShares, callbackData) |
Dynamic Liquidation Incentive Factor (LIF) scaled by market's LLTV (1.04x – 1.15x) |
Per-market custom IOracle (Chainlink, RedStone, Pyth, Curve TWAP, vault exchange rates!) |
Low to Moderate on long-tail / RWA / LRT isolated markets (30%–70% net margin kept!) |
Compound V3 (Comet) |
Two-step (combinable in 1 tx): absorb(absorber, accounts[]) + buyCollateral(asset, minAmount, baseAmount, recipient) |
Dynamic Dutch-style discount (storeFrontPriceFactor × oracle discount) |
Chainlink + custom compound scaling | Moderate (Requires exact math on quoteCollateral vs DEX slippage) |
| SparkLend | Aave V3 fork (liquidationCall) + Maker/Sky D3M & sDAI/USDS integrations |
Fixed Liquidation Bonus (4.5% – 10%) |
Chronicle / Chainlink oracles | Moderate to High (Chronicle oracle updates trigger on different heartbeat transactions than Chainlink!) |
Target #1: Morpho Blue (`liquidate` + built-in free flash callback)
Why is Morpho Blue the single best target in 2026 for custom liquidation bot development?
- Hundreds of Isolated Markets With Custom Oracles: Unlike Aave V3 (which has one curated asset list), Morpho Blue is a permissionless singleton contract (
0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb) hosting hundreds of isolated(loanToken, collateralToken, oracle, irm, lltv)markets—including Pendle PT tokens, liquid restaking tokens (ezETH,weETH,rsETH), and tokenized RWAs. - Composite Oracle Triggers (Not Just Chainlink!): Many Morpho Blue markets use composite oracles that multiply a Chainlink feed by an ERC-4626 vault's
convertToAssets()exchange rate or a Pendle TWAP. A standard bot that only watches Chainlinktransmit()transactions in the mempool completely misses liquidations triggered by vault slashing, rebase updates, or interest accrual across block boundaries! - Zero-Fee Native Flash Liquidation Callback (
IMorphoLiquidateCallback): Morpho Blue lets your executor contract seize the borrower's collateral first, passes it to youronMorphoLiquidate(uint256 repaidAssets, bytes calldata data)callback so you can swap the collateral intoloanTokenon Uniswap V3/V4 or Curve, and only pulls therepaidAssetsat the end of the call—with 0% flash-loan fee!
// Zero-capital Morpho Blue Liquidation Executor Pattern:
interface IMorpho {
function liquidate(
MarketParams memory marketParams,
address borrower,
uint256 seizedAssets,
uint256 repaidShares,
bytes calldata data
) external returns (uint256, uint256);
}
contract MorphoLiquidator {
IMorpho constant MORPHO = IMorpho(0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb);
function onMorphoLiquidate(uint256 repaidAssets, bytes calldata data) external {
require(msg.sender == address(MORPHO), "Unauthenticated");
// 1. Collateral tokens are ALREADY in this contract!
// 2. Swap seized collateral -> loanToken on Uniswap V3/V4 or Curve
// 3. Approve MORPHO for repaidAssets; Morpho pulls repayment automatically
}
}
Target #2: Compound V3 (`Comet`) `absorb()` + `buyCollateral()`
In Compound V2, liquidators repaid a user's debt directly and received cTokens. Compound V3 (Comet) completely changed the mechanism into two functions that your liquidation contract must chain together inside one atomic transaction:
comet.absorb(address absorber, address[] calldata accounts): When a borrower's collateral value falls below their liquidation threshold (isLiquidatable(account) == true), callingabsorb()transfers the borrower's underwater debt and collateral directly onto Compound V3's own protocol balance sheet (and rewards the caller with COMP points/gas compensation).comet.buyCollateral(address asset, uint minAmount, uint baseAmount, address recipient): Immediately afterabsorb()executes in the same transaction, the protocol now holds discounted collateral available for sale! Your contract flash-borrows the base asset (USDCorWETH), callsbuyCollateral()to buy the seized collateral at the protocol'squoteCollateraldiscount (5%–8%off spot), swaps the collateral back to the base asset on a DEX, repays the flash loan, and pays the block builder a percentage of net profit.
Target #3: Oracle backrunning (`Chainlink`, `Chronicle`, and `Pyth`)
Regardless of whether you liquidate on Aave, Spark, Compound, or Morpho, a borrow position rarely becomes liquidatable "by accident" mid-block. 95% of liquidations become valid on the exact transaction that updates the on-chain price oracle!
A production liquidation bot development architecture therefore runs two synchronized off-chain modules in Rust (Alloy + revm—see Rust MEV Bot in 2026: The Alloy, Reth & Artemis Stack):
- In-Memory Borrower Health Indexer: Indexes every active borrower across Aave V3, Spark, Compound V3, and Morpho Blue, pre-computing the exact trigger price ($P_{\text{liq}}$) at which each account's Health Factor crosses
< 1.0. - Mempool + MEV-Share Oracle Backrunner: The microsecond a pending Chainlink
AccessControlledOffchainAggregator.transmit(), Chronicle update, or DEX TWAP-moving swap appears in the local Reth mempool, the bot looks up every borrower with $P_{\text{liq}} \ge P_{\text{new}}$ inO(1)time, simulates[tx_oracle_update, tx_liquidate]inrevm, and fans the atomic backrun bundle out to Titan, Beaverbuild, Flashbots, and Rsync.
Frequently asked questions
Why are Morpho Blue and Compound V3 easier for new liquidation bots to win than Aave V3?
Because almost every open-source liquidation bot github tutorial targets Aave V3's standard Chainlink pools, making Aave V3 hyper-competitive. Morpho Blue's hundreds of isolated markets (many using vault-rate or Pendle/Curve oracles) and Compound V3's absorb + buyCollateral flow require custom indexing math that filters out 90% of copy-paste searchers.
How much capital do I need in my wallet to run a DeFi liquidation bot?
You only need 0.1 to 0.5 ETH in your searcher EOA to cover gas/collateral buffers. The actual liquidation size—whether $10,000 or $5,000,000—is funded entirely via zero-capital atomic flash loans (Morpho's 0%-fee onMorphoLiquidate callback, Balancer's 0%-fee flashLoan, or Uniswap V3/V4 flash swaps) repaid inside the exact same transaction.
What is Oracle Extractable Value (OEV) and how does it affect liquidation bots in 2026?
Oracle Extractable Value (OEV) refers to lending markets (or oracle networks like API3 / RedStone / Chainlink SVR) auctioning off the right to backrun an oracle price update so the lending protocol captures part of the liquidation bonus. A modern multi-protocol liquidation bot integrates both standard mempool/builder backruns and OEV auction relays.
How do I test a liquidation bot without waiting for a real market crash?
Pin a Foundry Anvil mainnet fork to the exact block before a historical ETH price drop (anvil --fork-url $RPC --fork-block-number <N-1>), replay the historical oracle update transaction, and verify that your executor contract liquidates the underwater accounts and turns a net profit after gas (see How to Test an MEV Bot on a Mainnet Fork With Anvil).
Can I hire MEV DAO for custom liquidation bot development?
Yes. We build custom Rust + Solidity multi-protocol liquidation engines covering Aave V3, SparkLend, Morpho Blue, Compound V3, and L2s (Arbitrum, Base). Check our engineering tiers in MEV Bot Development Cost: Custom Pricing in 2026 and Custom MEV Bot Development: Hire an Ethereum MEV Bot Developer.
Related articles
- How Liquidation Bots Work on Aave (And Why They're Hard to Win)
- Custom MEV Bot Development: Hire an Ethereum MEV Bot Developer
- MEV Bot Development Cost: Custom Pricing in 2026
- Rust MEV Bot in 2026: The Alloy, Reth & Artemis Stack
- MEV Bot Ethereum GitHub: Best Open-Source Repos (2026)
Want to commission a custom multi-protocol liquidation bot (Morpho Blue, Compound V3, Spark, Aave) or try our live Ethereum bots first? Message me directly on Telegram (@merunas) to scope your build, or start a 3-day free trial at mevdao.org/subscribe.