Overview

Actions on Mero require externally owned accounts to trigger or execute them. For instance, a collateral top up can only occur if it is called externally. Mero incentivizes keepers to execute actions by paying them a share of the fees.

Collateral Top Ups

The first supported action on Mero is collateral top ups.

Keepers of this action can execute collateral top ups for accounts that have registered a top up position on Mero. All interaction regarding collateral top ups occur through the TopUpAction contract.

To execute a topup anyone can all the execute function below.

TopUpAction.function execute(address payer, address account, address beneficiary, bytes32 protocol) external override returns (bool)

Top up a registered position on an external protocol (e.g. AAVE or Compound) if the position’s conditions are met. Pool and vault funds are rebalanced after withdrawal for top up

  • payer: Account that pays for the top up.

  • account: Account owning the position for top up.

  • beneficiary: Address of the keeper’s wallet for fee accrual.

  • protocol: Protocol of the top up position. Note: this is the name of the protocol represented as bytes32.

There is also an execute function that accepts an additional value maxWeiForGas:

TopUpAction.function execute(address payer, address account, address beneficiary, bytes32 protocol) external override returns (bool)

Top up a registered position on an external protocol (e.g. AAVE or Compound) if the position’s conditions are met. Pool and vault funds are rebalanced after withdrawal for top up

  • payer: Account that pays for the top up.

  • account: Account owning the position for top up.

  • beneficiary: Address of the keeper’s wallet for fee accrual.

  • protocol: Protocol of the top up position. Note: this is the name of the protocol represented as bytes32.

  • maxWeiForGas: The maximum extra amount of wei that the keeper is willing to pay for the gas.

For a keeper to execute an action, they have to first meet the requirement for the minimum amount of MERO staked. This is a measure in place to protect keepers against general purpose frontrunning bots.

To see how much MERO is required to execute a top up, you can call the Controller.getKeeperRequiredStakedMERO() view. And to see if an address meets that requirement, you can call the canKeeperExecuteAction(address keeper) view.

To assist with building keeper bots, a helper contract has been deployed KeeperHelper. More details on this in the dedicated section below.