Keeper
An off-chain bot, run by a protocol or a third party, that calls a contract's maintenance functions on a schedule or when conditions are met, such as harvests, rebalances or liquidations.
A keeper is a bot that does a protocol's routine work. Contracts can't wake themselves up, so someone has to send the transaction that harvests rewards, rebalances a position, updates a price or liquidates a loan. That someone is a keeper.
Keepers are usually ordinary accounts or bots. Some are run by the protocol team, some by outside operators who are paid a fee for each call.
Why keepers are a security question
The functions a keeper calls often move funds. That leaves two designs, and each needs its own checks:
- Restricted. Only listed keeper addresses may call the function. Then the contract must actually check the caller, on every path, including any helper or multicall contract that forwards calls on the keeper's behalf.
- Public. Anyone may call it, because the protocol wants it to run even if its own bot is down. Then every argument the caller controls is attacker input: which pool to swap through, how much to accept, where to send the result. A public harvest that lets the caller pick the pool, with no minimum amount out, can be pointed at a pool the attacker built.
What to check
List every function a keeper is meant to call. For each one, decide whether it is restricted or public, and test it from a random address. A restricted function must revert. A public one must give the same result whoever calls it.
Related Terms
Access Control
Security mechanisms that restrict which addresses can call specific functions in a smart contract, preventing unauthorized actions.
Multicall
A function or contract that takes a list of calls and executes them in one transaction, so a caller can batch several actions together.
Wallet Module
An extra contract that a smart wallet's owners enable so it can act for the wallet, such as moving its tokens or managing a position, without the owners signing each transaction.
MEV (Maximal Extractable Value)
Profit extracted by reordering, including, or excluding transactions within a block.
Need expert guidance on Keeper?
Our team at Zealynx has deep expertise in blockchain security and DeFi protocols. Whether you need an audit or consultation, we're here to help.
Get a Quote