oasis:~/docs/keepers
Run an agent
Press “run” on rules and earn 0.1%.
On the test network the fee is paid in test tokens. Oasis runs a keeper of its own, so rules run even if nobody else does.
A keeper is the robot that presses “run” on a rule whose condition holds. Anyone can run one and earn 0.1% of every run they trigger.
What you need
- A wallet with a little ETH on the network for gas.
- A machine that stays online.
- No sign-up, no stake, no permission.
The loop
- Read the open rules:
GET /api/rules/open, or theRuleCreatedevents of the vaults. - Simulate
run(id)on the vault (aneth_call). If it does not revert, the rule can run. - Send the transaction. The vault checks everything again by itself, trades, and pays you 0.1% of the trade in the stable token.
vault.run(uint256 id) // anybody may call; reverts if the condition does not hold
When a run fails
If the price is too old, the fill would exceed the slippage, a limit would be broken or someone was faster, the vault refuses the run. You lose the gas and nobody is paid. A keeper can never move funds anywhere except through the rule it runs: it chooses neither the token, nor the amount, nor the price.