Keepers
Anyone can participate as a keeper. Keepers monitor on-chain state and oracle prices, then submit transactions to the protocol when specific conditions are met. In doing so, they keep the exchange functioning correctly and earn rewards for their service.
Why Keepers Matter
Without keepers, pending orders would never fill, underwater positions would accumulate bad debt, and stop-loss or take-profit triggers would go unexecuted. Keepers ensure that the protocol remains solvent and that traders receive timely execution of their orders and risk management settings.
Keeper Actions
Keepers can execute four types of actions:
- Fill limit orders: When a pending limit order's trigger price is reached according to the oracle, keepers fill the order on behalf of the trader.
- Liquidations: When a position's equity falls below its liquidation threshold, keepers liquidate the position to protect the vault from bad debt.
- Stop-loss execution: When the oracle price hits a position's stop-loss level, keepers trigger the position close to limit the trader's downside.
- Take-profit execution: When the oracle price reaches a position's take-profit level, keepers trigger the position close to lock in gains.
Rewards
Keepers are compensated through the caller rate, a percentage of the trading fees generated by each action they execute. This creates a direct economic incentive for keepers to monitor the protocol and submit transactions promptly.
Batching
For gas efficiency, keepers can bundle multiple positions into a single transaction by calling execute() with a batch of position IDs. The contract auto-detects the correct action for each position: unfilled positions are treated as limit fills, and filled positions are checked for liquidation, stop-loss, or take-profit in priority order. This means a keeper can process many positions in one call, reducing costs and improving throughput.
Running a Keeper
Running a keeper is fully permissionless. At a high level, a keeper bot:
- Monitors oracle price feeds and on-chain position states.
- Identifies actionable conditions (e.g., a limit order whose trigger price has been reached, or a position eligible for liquidation).
- Submits a batched
execute()transaction containing the relevant actions.
Because keeper rewards are competitive, faster and more reliable keepers capture more opportunities.