This page covers the smart contract implementation details. See Glossary.
How keepers work
The keeper system has three components:- Job Listing contracts — on-chain registries that define what needs to be automated and when
- Keeper contract — processes batches of job executions submitted by authorized forwarders
- Keeper bot — off-chain service that polls job status and submits execution reports
Register a Multi-Vehicle for automation
To enable automation, register your Multi-Vehicle with theMultiVehicleJobListing contract. This creates two persistent jobs: one for feeding the redemption queue and one for retrieving assets.
Configure thresholds
Thresholds prevent the keeper from executing transactions for trivial amounts, optimizing gas costs.Redemption threshold — the job triggers when both:
- Withdrawable assets in the Multi-Vehicle exceed the threshold
- Pending demand in the
QueryRedeemQueueexceeds the threshold
- Retrievable assets in the
QueryRedeemQueueexceed the threshold
registerMultiVehicle again with new values.Job types
Redemption Queue Feed
Redemption Queue Feed
Automates providing liquidity to the redemption queue when there is pending demand and available withdrawable assets.
- Status check:
redemptionStatus(multiVehicle) - Execution:
feedQueryRedeemQueue(multiVehicle) - Condition:
withdrawableAssets >= thresholdANDpendingDemand >= threshold
Asset Retrieval
Asset Retrieval
Automates retrieving assets from the redemption queue back to the Multi-Vehicle accounting engine.
- Status check:
retrievalStatus(multiVehicle) - Execution:
retrieveQueryRedeemQueueAssets(multiVehicle) - Condition:
retrievableAssets >= threshold
Fee Share Redemption
Fee Share Redemption
Sub-Query Progression
Sub-Query Progression
Automates progressing individual sub-queries sent to sub-vehicles (e.g., async protocols like Ethena).
- Status check:
subqueryStatus(subQuery, query) - Execution:
progressQuery(subQuery, query) - Condition: Sub-vehicle query has moved past
PROCESSINGorWAITING
Job status values
| Status | Meaning |
|---|---|
POLL | Not ready — check again later |
EXEC | Ready — submit the execution report |
STOP | Finished or unregistered — stop monitoring |
Integrate with the Keeper contract
The Keeper processes batches of executions via reports — arrays ofReportDataItem structs.
Run the keeper bot
The keeper bot is a Python service that polls the indexer forJobStarted events and executes jobs when ready.
Environment variables
| Variable | Description |
|---|---|
RPC_URL | Ethereum node RPC URL |
KEEPER_ADDRESS | Address of the Keeper contract |
FORWARDER_PRIVATE_KEY | Private key of the forwarder account |
GRAPHQL_ENGINE_URL | URL of the GraphQL indexer |
Deploy with Docker
Required roles
| Role | Required for |
|---|---|
JOB_LISTING_REGISTER | Registering new jobs |
JOB_LISTING_UNREGISTER | Removing jobs |
JOB_LISTING_EXECUTE | Executing registered jobs |
KEEPER_ON_REPORT | Submitting reports to the Keeper |