Keepers
Keepers are automated bots that maintain protocol health by monitoring positions and executing liquidations. They are a critical part of MegaTAO's infrastructure.
What keepers do
When a trader's margin ratio falls below the maintenance threshold, the position becomes eligible for liquidation. Keepers detect these unhealthy positions and submit liquidation transactions to close them before they become insolvent.
Without keepers, undercollateralized positions could accumulate bad debt, meaning losses that exceed the trader's deposited margin. This would put vault depositors at risk. Keepers prevent this by ensuring liquidations happen promptly.
How it works
Keepers continuously monitor all open positions across all markets
For each position, they calculate the current margin ratio using the latest oracle price
When a position's margin ratio drops below the maintenance margin (currently 10%), the keeper submits a liquidation transaction
The protocol verifies the position is indeed liquidatable and executes the liquidation on-chain
The keeper receives a portion of the liquidation fee as incentive
Incentives
Keepers are incentivized through the liquidation fee. When a position is liquidated, a 5% fee is charged on the remaining margin. A portion of this fee goes to the keeper that executed the liquidation, compensating them for monitoring costs and gas.
This incentive structure ensures liquidations happen quickly even during volatile markets when gas costs may be elevated.
Keeper roles
Keepers also perform other protocol maintenance tasks:
Funding rate updates: Keepers trigger funding rate recalculations to keep rates current with market conditions
Interest fee updates: Keepers update interest accruals based on vault utilization
Decentralization
The keeper role is permissioned at the contract level. The protocol team currently operates the primary keeper infrastructure to ensure reliable liquidation execution. As the protocol matures, the keeper system may be opened to additional participants.
Last updated