Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
LABS
Glossary

Keeper Bot (Liquidator Bot)

An automated agent that monitors blockchain state for profitable opportunities, such as undercollateralized loans, and executes transactions like liquidations or arbitrage.
Chainscore © 2026
definition
DEFINITION

What is a Keeper Bot (Liquidator Bot)?

A keeper bot, often called a liquidator bot, is an automated software agent that monitors blockchain state to execute predefined, profitable transactions when specific on-chain conditions are met.

A keeper bot is an automated, off-chain agent that scans a blockchain for specific conditions and submits transactions to capitalize on them. In decentralized finance (DeFi), the most common type is the liquidator bot, which monitors lending protocols for undercollateralized positions. When a loan's collateral value falls below the required loan-to-value (LTV) ratio, the bot swiftly repays part or all of the loan in exchange for the collateral at a discounted price, profiting from the difference and helping to maintain the protocol's solvency.

These bots are essential infrastructure for DeFi's health, acting as a decentralized enforcement mechanism. Without them, bad debt could accumulate, threatening system stability. They operate in a highly competitive environment, where profit margins are slim and transaction speed is paramount. Successful bots employ sophisticated strategies for gas optimization and mempool monitoring to ensure their liquidation transactions are included in the next block before competitors. This creates a keeper network—a decentralized marketplace for blockchain arbitrage and maintenance.

Beyond liquidations, keeper bots perform other critical DeFi primitives. They trigger limit orders in decentralized exchanges (DEXs), harvest and compound yield in vault strategies, rebase elastic supply tokens, and settle options contracts. Projects like Chainlink Keepers and Gelato Network provide generalized keeper services, allowing developers to outsource this automation by specifying conditions and execution logic in smart contracts, which the network's bots then fulfill for a fee.

Running a keeper bot requires significant technical expertise and capital. Operators must manage private keys for funding gas fees, develop robust monitoring and transaction bundling logic, and often stake tokens to participate in permissioned networks. The economic model is based on gas arbitrage: the cost of the transaction (gas fee) must be less than the profit from the executed action. This makes keeper activity highly sensitive to network congestion and gas price volatility.

The ecosystem exemplifies a core blockchain principle: incentivized, permissionless participation. By offering financial rewards, protocols outsource critical maintenance functions to a decentralized set of actors. This creates a more resilient system than a centralized alternative, though it also leads to MEV (Maximal Extractable Value) competition, where bots race to capture value, sometimes leading to network congestion and complex economic games between searchers, builders, and validators.

etymology
KEEPER BOT (LIQUIDATOR BOT)

Etymology and Origin

The term 'Keeper Bot' or 'Liquidator Bot' originates from the automated systems that 'keep' decentralized finance (DeFi) protocols solvent by executing critical maintenance functions, primarily liquidation.

The etymology of keeper bot is rooted in the concept of a network 'keeper'—an automated agent that performs essential, often thankless, maintenance tasks to ensure a system's health. In traditional finance, a 'keeper of the books' maintains ledger integrity. In blockchain, this evolved into bots that monitor on-chain conditions and 'keep' protocols functioning correctly by triggering predefined actions. The synonymous term liquidator bot is more functionally descriptive, directly referencing its primary role in seizing and selling undercollateralized assets from loans in lending protocols like Aave and Compound to 'keep' the system solvent.

The origin of these bots is inextricably linked to the rise of overcollateralized lending in DeFi. Early protocols like MakerDAO required a mechanism to handle loans falling below their collateralization ratio. Initially, this was a manual process, but the 24/7 nature of crypto markets and the speed required for efficient liquidations created a perfect niche for automation. The first keeper bots emerged as simple scripts run by individuals, but quickly evolved into sophisticated, competitive systems run by professional firms, forming a crucial part of the DeFi keeper network ecosystem.

The terminology reflects a blend of mechanism design and game theory. Protocols do not directly execute liquidations; instead, they publicly post profitable opportunities (a liquidation bonus). Keepers 'race' to be the first to submit the liquidation transaction, akin to miners competing to solve a block. This design ensures decentralized enforcement of protocol rules. The 'bot' suffix emphasizes their automated, algorithmic nature, distinguishing them from manual actors, though they are often simply referred to as keepers or liquidators in technical documentation.

key-features
KEEPER BOT (LIQUIDATOR BOT)

Key Features and Characteristics

Keeper bots are automated agents that monitor blockchain state and execute predefined actions for profit, primarily focused on maintaining protocol health and capital efficiency.

01

Core Function: Liquidation

A keeper bot's primary role is to monitor collateralized debt positions (CDPs) on lending protocols like Aave or Compound. When a position's health factor or collateralization ratio falls below a safe threshold, the bot automatically executes a liquidation. This involves repaying the undercollateralized debt in exchange for the collateral at a discount, securing the protocol's solvency and earning a liquidation bonus for the keeper.

02

Arbitrage Execution

Keeper bots identify and exploit price discrepancies across decentralized exchanges (DEXs) and oracles. For example, if ETH trades for $1,900 on Uniswap but the Chainlink oracle reports $1,905, a bot can buy low on Uniswap and sell high in a protocol using the oracle price. This activity enforces price convergence and market efficiency, with profits derived from the arbitrage spread.

03

Automated Market Making (AMM) Maintenance

In automated market maker pools, keeper bots perform critical maintenance functions:

  • Rebalancing: Adding/removing liquidity to maintain target weightings in index pools or Balancer V2.
  • Limit Order Execution: Monitoring prices to fill user-placed limit orders on DEXs like Uniswap V3, acting as an off-chain order book executor.
  • Fee Collection: Automatically harvesting and compounding accrued fees from liquidity positions.
04

Oracle & Data Updates

Certain protocols rely on keepers to push external data on-chain. For instance, Chainlink Keepers or Gelato Network bots are triggered by time-based or event-based conditions to:

  • Update TWAP (Time-Weighted Average Price) oracles.
  • Execute periodic yield harvesting and reinvestment in vault strategies.
  • Settle expiring options or futures contracts based on final price data.
05

Economic Design & Incentives

Keeper ecosystems are driven by cryptoeconomic incentives. Key mechanisms include:

  • Gas Price Optimization: Bots compete to submit transactions with optimal gas fees to be included in the next block.
  • Priority Gas Auctions (PGAs): During high-demand events like liquidations, bots may engage in bidding wars, driving up transaction fees.
  • Profit Maximization: A keeper's revenue is the execution reward (e.g., liquidation bonus) minus the transaction cost (gas).
06

Technical Architecture & Risks

A typical keeper bot runs off-chain and consists of:

  • Event Listeners: Monitoring the mempool and on-chain events via RPC nodes.
  • Strategy Logic: Code that calculates profitability and constructs transactions.
  • Transaction Management: Handling nonce management and gas estimation. Key risks include frontrunning by other bots, sandwich attacks, failed transactions due to slippage, and smart contract bugs in the target protocol.
how-it-works
MECHANISM

How a Keeper Bot Works: The Liquidation Cycle

A keeper bot, or liquidator bot, is an automated agent that monitors on-chain lending protocols for undercollateralized positions and executes liquidations for profit.

A keeper bot is a specialized automated program that continuously monitors the health of collateralized debt positions (CDPs) on lending protocols like Aave, Compound, and MakerDAO. Its core function is to scan for positions where the collateralization ratio has fallen below the protocol's required liquidation threshold. When this occurs, the position is deemed undercollateralized and becomes eligible for liquidation, a process where the keeper seizes and sells a portion of the borrower's collateral to repay their debt, ensuring the protocol remains solvent.

The operational cycle begins with the bot subscribing to on-chain events and price feeds. It calculates the health factor or collateral factor for open positions in real-time. Upon detecting a violator, the bot races to be the first to submit a liquidation transaction. This transaction includes a liquidation penalty or liquidation bonus, a fee paid to the keeper from the seized collateral as an incentive. The speed of execution is critical, as it is a competitive, profit-driven activity; other keeper bots are simultaneously scanning the same opportunities.

Successful execution involves several precise steps: calling the protocol's specific liquidation function (e.g., liquidate()), specifying the target account and debt to cover, and paying the required gas fees. The bot then receives the liquidated collateral, often at a discount, which it can immediately sell on a decentralized exchange (DEX) to realize a profit. This entire process, from detection to settlement, typically occurs within a single blockchain block, often in a matter of seconds, highlighting the high-frequency, automated nature of this activity.

The economic design of this system creates a symbiotic relationship. Borrowers are incentivized to maintain overcollateralization to avoid penalties, while keepers are incentivized by profit to police the system, thereby protecting lenders from bad debt. This automated enforcement is a foundational DeFi primitive that enables trustless, capital-efficient lending without a central arbiter. The efficiency of keeper networks is a direct contributor to the overall stability and resilience of the decentralized finance ecosystem.

primary-use-cases
KEEPER BOT (LIQUIDATOR BOT)

Primary Use Cases and Functions

Keeper bots are automated agents that perform critical, time-sensitive tasks to maintain the health and efficiency of DeFi protocols. Their primary function is to monitor on-chain conditions and execute predefined actions for profit.

01

Liquidation

The core function of a liquidator bot is to monitor collateralized debt positions (CDPs) for undercollateralization. When a position's health factor or collateral ratio falls below a protocol's threshold, the bot automatically repays the borrower's debt in exchange for the collateral at a discount, profiting from the spread. This process is essential for maintaining protocol solvency.

  • Example: A user's ETH-backed loan on Aave becomes undercollateralized after a price drop. A keeper bot repays the user's USDC debt and seizes the ETH at a 5-10% discount.
02

Arbitrage

Keeper bots identify and exploit price discrepancies of the same asset across different decentralized exchanges (DEXs) or between DEXs and centralized exchanges (CEXs). They execute a series of trades to buy low on one venue and sell high on another, capturing risk-free profit and helping to align market prices.

  • Mechanism: The bot monitors price feeds, calculates potential profit after gas fees, and executes the trades atomically in a single transaction to avoid slippage and front-running.
03

Limit Order Execution

On DEXs that lack native limit order functionality (like Uniswap v3), keeper bots fulfill this role. They monitor the market price and execute a user's trade only when it reaches their specified limit price. The bot submits the transaction on the user's behalf, often for a fee.

  • Protocol Example: Gelato Network and Keep3r are networks that provide infrastructure for bots to execute these conditional orders reliably and in a decentralized manner.
04

Rebalancing & Yield Optimization

In automated market maker (AMM) pools and yield farming strategies, keeper bots maintain optimal capital efficiency. They automatically adjust liquidity provider (LP) positions or harvest and compound yields to maximize returns.

  • AMM Rebalancing: For Uniswap v3 LP positions, bots move liquidity ranges as the price moves to stay in the active tick.
  • Yield Harvesting: Bots claim accrued reward tokens from staking or farming contracts and automatically reinvest them, compounding the user's yield.
05

Oracle Updates & Dispute Resolution

Keeper bots ensure the accuracy and liveness of oracle price feeds, which are critical for loan valuations and derivative settlements. They can be incentivized to push new price data to on-chain oracles when certain conditions are met (e.g., a significant deviation from a reference feed).

In systems like UMA's Optimistic Oracle, bots also play a role in disputing proposed price updates during a challenge period, helping to secure the data feed.

06

Protocol Maintenance & Parameter Updates

Decentralized protocols often require regular, permissionless upkeep that keeper bots can automate. This includes triggering the conclusion of auctions, settling expired options or perpetual contracts, and executing governance-approved parameter changes (like adjusting interest rate models).

  • Example: In MakerDAO's surplus auction (flap) or collateral auction (flip), keeper bots bid on excess system surplus or collateral to help stabilize the Dai stablecoin.
ecosystem-usage
KEEPER BOT (LIQUIDATOR BOT)

Ecosystem Usage and Protocols

Keeper bots are automated agents that monitor blockchain state and execute predefined transactions to maintain protocol health, primarily by performing liquidation, arbitrage, and other critical functions for a profit.

01

Core Function: Liquidation

A keeper bot's primary role is to liquidate undercollateralized positions in lending protocols like Aave or Compound. It monitors user collateralization ratios and, when a position falls below the required liquidation threshold, the bot submits a transaction to repay the debt and seize the collateral, earning a liquidation bonus as its reward. This action protects the protocol from bad debt and maintains system solvency.

02

Arbitrage & MEV

Keeper bots are key players in Maximal Extractable Value (MEV) strategies. They scan for price discrepancies across decentralized exchanges (DEXs) like Uniswap and centralized exchanges to execute profitable arbitrage trades. They also engage in sandwich attacks, front-running user transactions. These activities are often bundled into blocks by searchers and relayed to validators via services like Flashbots.

03

Protocol Maintenance

Beyond liquidations, keeper bots perform essential upkeep tasks for DeFi protocols. This includes triggering auctions in systems like MakerDAO's surplus and debt auctions, calling rebalance functions for algorithmic stablecoins, and executing limit orders on DEXs. These actions ensure protocols operate as designed, often requiring bots to be gas-optimized to outbid competitors for the same opportunity.

04

Economic Model & Risks

Keeper bots operate on a profit-driven economic model, where revenue from bonuses or arbitrage must exceed costs like gas fees and development. Key risks include:

  • Gas price volatility making transactions unprofitable.
  • Smart contract risk from bugs in the protocols they interact with.
  • Competition from other, faster bots in a highly adversarial environment.
05

Infrastructure & Tooling

Running a keeper bot requires specialized infrastructure:

  • RPC Nodes: Low-latency access to blockchain data (e.g., Alchemy, Infura).
  • Event Listeners: To monitor on-chain events in real-time.
  • Transaction Simulation: Tools like Tenderly to test trades before broadcasting.
  • Private Mempools: Services like Flashbots Protect to avoid front-running.
  • Gas Management: Strategies for optimal bid pricing.
security-considerations
KEEPER BOT (LIQUIDATOR BOT)

Security and Economic Considerations

Keeper bots are automated agents that monitor blockchain state to execute profitable on-chain transactions, playing a critical role in protocol health and market efficiency.

01

Core Function: Risk Mitigation

A keeper bot (or liquidator bot) is an automated program that monitors on-chain positions for predefined conditions, such as a loan's collateral value falling below its required health factor. When triggered, it executes a liquidation transaction to close the undercollateralized position, protecting the lending protocol from bad debt. This automated enforcement is fundamental to the security of overcollateralized lending platforms like Aave and Compound.

02

Economic Incentive: MEV & Profits

Keepers are economically motivated by Maximal Extractable Value (MEV) opportunities. They compete to be the first to submit a profitable liquidation transaction, earning a liquidation bonus or fee. This creates a keeper economy where sophisticated bots with low-latency infrastructure and optimized gas bidding strategies capture value. The profit is typically a percentage of the collateral seized or a fixed reward paid by the protocol.

03

Critical Infrastructure & Centralization Risks

While essential, keeper activity introduces systemic considerations:

  • Reliance on Profitability: If gas costs exceed liquidation rewards, keepers may not act, allowing bad debt to accumulate.
  • Infrastructure Centralization: The need for speed and capital favors large, professional operations, potentially centralizing a critical security function.
  • Frontrunning & Congestion: Keeper competition can lead to gas auctions and network congestion during market volatility.
04

Arbitrage and Market Efficiency

Beyond liquidations, keeper bots perform arbitrage, closing price differences between decentralized exchanges (DEXs) like Uniswap and centralized markets. They also trigger limit orders, vault harvesting (claiming and compounding rewards in DeFi yield strategies), and rebalancing for automated portfolio managers. These actions collectively enhance market efficiency and ensure smart contracts operate as intended.

05

Technical Implementation

A typical keeper bot stack includes:

  • Blockchain Node: For real-time event listening (e.g., new block headers, specific event logs).
  • MemPool Monitor: To scan pending transactions for opportunities and avoid frontrunning.
  • Execution Engine: Signs and broadcasts transactions, often with dynamic gas price strategies.
  • Risk Management: Calculates profitability including gas costs, slippage, and reward size.
06

Protocol Design Considerations

Protocols must carefully design their liquidation engine to ensure keeper reliability:

  • Incentive Alignment: Setting liquidation rewards that are attractive under normal network conditions.
  • Grace Periods: Some protocols implement a liquidation grace period to give position owners a chance to remediate.
  • Partial vs. Full Liquidation: Defining the size of the position that can be liquidated in one transaction to manage market impact.
AUTOMATED AGENT COMPARISON

Keeper Bot vs. Similar Concepts

A technical breakdown of automated blockchain agents, highlighting their distinct operational triggers, incentives, and roles within DeFi and network security.

Feature / MetricKeeper Bot (Liquidator)Validator / SequencerArbitrage BotTrading Bot

Primary Function

Execute condition-based protocol functions (e.g., liquidations)

Produce and validate new blocks, order transactions

Exploit price discrepancies across markets

Execute predefined trading strategies

Core Trigger

On-chain state (e.g., loan health, auction expiry)

Consensus protocol rules (slot/time)

Cross-market price delta

Technical indicators or market signals

Primary Incentive

Liquidation bonus / fixed fee

Block rewards & transaction fees

Risk-free profit from price differences

Profit/Loss from market moves

Key Risk

Gas auction competition, failed execution

Slashing for misbehavior, downtime

Slippage, front-running, execution cost

Market risk, strategy failure

Typical Latency Sensitivity

Extreme (< 1 sec)

High (block time, e.g., 12 sec)

Extreme (< 1 sec)

Variable (seconds to hours)

Capital Requirement

High (to post bids/collateral)

Very High (staking collateral)

High (for simultaneous trades)

Variable (trading capital)

Protocol Dependency

Direct (executes specific smart contract logic)

Core (part of network consensus)

Indirect (interacts with DEXs/CEXs)

None to Indirect (uses available venues)

Example Action

Repay undercollateralized loan, claim collateral

Propose Block #1234567

Buy ETH on DEX A, sell on DEX B

Place a limit order based on moving average

KEEPER BOTS

Frequently Asked Questions (FAQ)

Keeper bots, also known as liquidator bots, are automated agents that perform critical maintenance tasks on decentralized protocols. This FAQ addresses common questions about their role, operation, and economic incentives.

A keeper bot (or liquidator bot) is an automated, permissionless software agent that monitors blockchain state and executes specific transactions to maintain the health and solvency of a decentralized protocol. It works by continuously scanning the mempool and on-chain data for predefined conditions, such as an undercollateralized loan on a lending platform. When a profitable opportunity is identified, the bot submits a transaction—like a liquidation—to claim a reward, paying the necessary gas fees to prioritize its transaction in the block.

Core Mechanics:

  1. Monitoring: Scans for specific protocol events (e.g., health factor < 1 on Aave).
  2. Simulation: Locally simulates the transaction to verify profitability after gas costs.
  3. Execution: Broadcasts the transaction, often using techniques like gas auctioning to outbid competing bots.
  4. Settlement: The protocol's smart contracts pay the bot a liquidation bonus or fee for performing the service.
ENQUIRY

Get In Touch
today.

Our experts will offer a free quote and a 30min call to discuss your project.

NDA Protected
24h Response
Directly to Engineering Team
10+
Protocols Shipped
$20M+
TVL Overall
NDA Protected Directly to Engineering Team
Keeper Bot (Liquidator Bot) - Definition & Role in DeFi | ChainScore Glossary