- Create a smart agent that autonomously executes transactions
- Use the
IScheduler
helper interface to manage agent actions - Configure scheduling parameters to control when and how your agent operates
1
Import IScheduler for your agent
The
IScheduler
interface is Ritual’s convenience library that enables
your agent to schedule and execute autonomous actions.Your agent can use simple configuration parameters through functions like <IScheduler>.schedule()
to set up its automated behaviors:2
Program your agent's recurring actions
The following code shows how to program your agent to execute actions at predetermined intervals.Your agent can schedule any function call with the appropriate selector and arguments, making it versatile for both simple and complex automated tasks.
Your agent’s behavior can be customized through the
<IScheduler>.schedule()
parameters:
Parameter | Description |
---|---|
fn | Function to invoke + optional calldata |
maxGasLimit | Max gas limit, in wei , per call |
maxGasPrice | Max gas price, in wei , to pay per call |
maxBlockNumber | Max block number after which subsequent calls are invalidated |
frequency | Number of blocks between each subsequent call |