Triggers

Trigger types

Triggers monitor for onchain changes and initiate notifications when particular conditions are met. Currently, The following trigger types are support

Trigger Type: Poll Function

The Poll Function trigger type will periodically poll a function of a contract. This trigger type has 2 modes, 1. Always trigger, or 2. Trigger based on simple conditional logic. Here are some examples of use cases for this trigger type:

  • Get a notification when the balance of address or keeper

  • Get a notification when your health ratio on AAVE is below a threshold

  • Get a notification when the onchain spot price of a token is above or below a value

Poll Functions have the following configuration options:

ConfigurationInfo

Network

Desired Network

Contract Address

Address of the contract from which the view function will be called.

Note: Currently, only one address is supported per trigger. Multiple addresses will be supported in the future.

Poll Period

Poll period in blocks which the function will be called and the condition tested.

ABI

The abi will be fetched from the explorer though if the contract is not verified users can manually enter the abi as a JSON string.

Function Name

The function the trigger will poll

Trigger On

Always or Conditional. If "Always" is selected, the trigger will fire every time. This is useful for periodic notification. If "Conditional" is selected, the user must configure the condition that needs to be tested.

Condition

Condition Options: - Greater than (>)

- Greater than or equal to (>=) - Less than (<) - Less than or equal to (<=) - Equal to The test structure: <Argument> <Condition> <Constant> If the test returns true, the trigger will fire and initiate a notification.

Argument

This is the argument of the function response that will be tested. The Argument is on the LHS of the test.

Argument Decimals

Decimal places of the argument for convenience.

Compare Value

This is a constant value the argument response will be tested against. This is the RHS of the test.

Trigger Type: Onchain Event

An Onchain Event trigger type will monitor the blockchain for a particular event. The trigger has 2 modes, 1. always trigger, or 2. trigger based on simple conditional logic. Here are some example use cases for this trigger type:

  • Get a notification when an account has been liquidated on AAVE or another lender

  • Get a notification when privileged functions, such as governance functions are called

  • Get a notification for every harvest of a vault and report the gains

An Onchain Event trigger type has the following configuration options:

ConfigurationInfo

Network

Desired Network

Contract Address

Address of the contract from which the event/log is emitted. For example, the "StrategyReported" event from a Yearn V2 vault contract.

ABI

The ABI will be fetched from the explorer though if the contract is not verified users can manually enter the ABI as a JSON string.

Event

The name of the event the trigger will monitor for.

Trigger On

Always or Conditional. If "Always" is selected, the trigger will fire every time the event is emitted. This is useful for periodic notification. If "Conditional" is selected, the user must configure the condition that needs to be tested.

Condition

Condition Options: - Greater than (>)

- Greater than or equal to (>=) - Less than (<) - Less than or equal to (<=) - Equal to The test structure: <Parameter> <Condition> <Constant> If the test returns true, the trigger will fire and initiate a notification.

Parameter

This is the parameter of the event that will be tested. The parameter is on the LHS of the test.

Paramter Decimals

Decimal places of the paramter for convenience.

Compare Value

This is a constant value the event parameter will be tested against. This is the RHS of the test.

Last updated