Skip to main content
After you read this page, you can write the actions of a rule and know on which network and for which account kind each action runs. An action is one item of the actions list of a rule. Its type field selects one of five types: Each type accepts only its own fields. Another field is refused with unknown field '<key>' in <type> action, for example unknown field 'slippage' in exchange action. An unknown type is refused with unknown action type '<value>'.

Where each action runs

A “no” in this table is a refusal at staging. The texts are on Validation.

How actions run

  • The actions of one rule run in list order.
  • Each action runs on its own. A failed action does not stop the next action of the same rule.
  • One send_batch is all or nothing. If one of its transfers fails, none of them happens.
  • Rules fire independently. The engine does not join two rules into one transaction.
  • Rules with the same trigger fire in document order.
  • An action of one rule does not fire another rule of the same account. The engine skips the transactions that it made for the account. See what does not count as a transfer.
Each payment goes through the adapter of the account. The checks of each adapter are on Contracts overview and Redeem. The status of each fire is on Activity.

send_one

Pays one address. Rules:
  • value must be an amount of a token, or trigger.value in a transfer rule. A bare percent or number is refused, for example send_one value must be a token amount; got percentage.
  • to must be on global.recipient_allowlist, if the list is present.
  • Every token in value must be on global.token_allowlist, if the list is present.
  • The stage refuses a to that is the account itself: rule '<rule>': This is your own Anafi account. Choose another destination.
  • The stage refuses the zero address: rule '<rule>': This is the zero address. Funds sent there are lost. Choose another destination.
  • The value can be the native coin, such as "1 POL", for a safe_module account. An erc20_allow account can send only ERC-20 tokens.

send_batch

Pays a list of addresses in one transaction, all or nothing. Each item of recipients: Rules:
  • Each item has its own value. There is no shared value and no share field. To split an amount, write a percent of trigger.value in each item.
  • The language does not check that the percents add up to 100%. The rest stays in the account.
  • The batch settles in one on-chain transaction. If the account does not hold enough for every item, or one transfer reverts, no item is paid.
  • An empty list is refused with send_batch recipients must not be empty.
  • The stage refuses more than 24 items: rule '<rule>': send_batch has <count> recipients, but this chain's limit is 24.
  • Each to and each value follows the rules of send_one.

exchange

Swaps one token for another. The bought tokens stay in the account. Rules:
  • in and out must be different tokens. A swap of a token to itself is refused, for example exchange `in` and `out` are both USDC; a swap must name two different tokens.
  • in must be an amount of a token, or trigger.value in a transfer rule.
  • Both tokens must be on global.token_allowlist, if the list is present.
  • Both tokens must have a contract on the network, or be the native coin. The token tables list them.
  • in must not be zero. "0 USDC" validates, and every fire refuses it.
  • There is no slippage field, no price field and no route field. The engine gets a price for each fire and sets the minimum output of the swap. The on-chain checks are on Swap executor.
  • The swap runs as one on-chain transaction. Either the full swap happens, or nothing happens.
Where it runs:
  • polygon and xlayer have a swap venue. polygon-amoy has none. The stage refuses every exchange there: rule '<rule>': network polygon-amoy has no swap aggregator, so an `exchange` could never execute here.
  • A safe_module account can sell or buy the native coin.
  • An erc20_allow account cannot sell or buy the native coin. It can sell only a token that the document names: a literal amount, or trigger.value under a range. Its adapter must also run swaps. See account kind refusals.

notify

Sends an email to the inbox of the document. Rules:
  • Email is the only delivery. The engine accepts push and telegram, ignores the value, and sends an email. Write channel: email.
  • Another channel, such as sms, is refused with unknown notify channel 'sms'.
  • The email goes to global.notification_email. There is no per-action address. See notification_email.
  • Without global.notification_email, the action fires and delivers nothing. The engine gives a warning for each such rule.
  • The engine sends message as written. It does not replace ${...} or any other placeholder.
  • notify moves no funds. It is valid in each rule, on each network, for each account kind.

off_ramp

Pays euros to a bank account. The engine burns EURe from the account through Monerium, and Monerium pays the same amount in euros by SEPA transfer. No token goes to an on-chain address. The to mapping: Write a person as first_name and last_name, or a company as company_name. Never write both. No name may be blank. The IBAN rules:
  • Write it in canonical form: uppercase letters and digits, no spaces, for example "DE89370400440532013000".
  • It has 15 to 34 characters: two letters, two check digits, then letters and digits.
  • The check digits must be correct (ISO 13616, remainder 1 under modulo 97).
  • The language does not check that the account exists.
The amount rules:
  • value must be an amount of EURe. Another token is refused with off_ramp value must be an amount of EURe, the token its provider redeems; got amount of USDC.
  • A literal amount must name whole cents. "1.005 EURe" is refused with off_ramp value '1.005 EURe' names a fraction of a cent, which no bank transfer can carry.
  • An amount computed at the fire is rounded down to whole cents. An amount under one cent is not paid.
  • trigger.value must have the token EURe. Use a transfer trigger with an EURe range, such as value: "100.. EURe". Without a range, trigger.value is refused with off_ramp value must be an amount of EURe, the token its provider redeems; got polymorphic.
  • The IBAN must be on global.iban_allowlist, if the list is present.
Where it runs:
  • Only on polygon-amoy. Another network refuses it at staging: rule '<rule>': network <network> carries no fiat rail, so an off_ramp through monerium could never execute here.
  • Only for a safe_module account. An erc20_allow account refuses it: rule '<rule>' has an off_ramp, which the ERC20Allow leg does not serve.
  • The Safe must be linked to a Monerium account first.
  • The Safe can keep a list of IBANs on chain, in the off-ramp policy of its fallback handler. global.iban_allowlist is a different list, part of the rule document. The engine checks it at staging and again at the commit. Nothing keeps the two lists equal. See Off-ramp handler and Bank payouts.