Smart contracts cannot wake themselves up. Nothing happens on-chain unless someone sends a transaction. On-chain automation is the off-chain service, often called a keeper, that sends those transactions at the right moment: on a schedule, when a price crosses a level, when a position becomes risky or when an event occurs. Many DeFi protocols, treasuries and token projects depend on it, and when it fails, it usually fails at the worst possible time.
What Gets Automated
- Risk actions: repaying debt or adding collateral before liquidation, see DeFi position management.
- Portfolio actions: rebalancing, compounding rewards, moving liquidity ranges, dollar-cost averaging.
- Protocol maintenance: updating rates or prices, settling epochs, triggering auctions, processing queues.
- Scheduled payouts: vesting releases, payroll in stablecoins, recurring transfers.
- Reactions to events picked up by event listeners.
Own Keepers or an Automation Network?
Automation networks such as Chainlink Automation and Gelato run the triggering for you and are a good fit for straightforward, public conditions. A self-run keeper fits better when conditions depend on private data or off-chain systems, when timing is competitive, or when you want full control over costs. Often the answer is both: a network as a backup for a critical action.
Designing for Safety
- Limited permissions: the keeper can only perform its specific actions, through role-based access or session keys; it can never withdraw funds elsewhere.
- Simulation before sending, so a failing action does not waste gas or make things worse.
- Redundancy: multiple instances, multiple RPC providers, and handling of gas spikes and stuck transactions.
- Monitoring: alerts when an action is late, fails or the keeper wallet runs low on gas.
Frequently Asked Questions
Can anyone trigger the action instead of a keeper?
Sometimes that is the best design: a public function anyone may call, with a small reward. Your keeper then makes sure it happens even when nobody else does.
What does automation cost?
Mainly gas for each action plus hosting or network fees. On layer 2 networks, gas for frequent actions is low.
What if gas prices spike?
The keeper has rules per action: critical actions go through at higher prices, optional ones wait.
Who owns the code?
Ownership of the source code is set out in the contract, and the code can be fully yours, including documentation and tests.
Part of our blockchain development. See also on-chain trading bots.
Automate Your On-Chain Operations
Tell us which actions you now do by hand or worry about missing. We will automate them with clear limits and monitoring.