Skip to main content
After you read this page, you can check a rule document by hand against the full language that the engine accepts today. The other pages of this section explain each part with examples. This page states the parts without prose.

Notation

Document schema

Expression grammar

ValueExpr is the text of send_one.value, of each send_batch item value, of exchange.in and of off_ramp.value. The grammar has no ambiguity. Space characters between symbols are ignored.
A symbol in an expression must be one of these:
  • min or max before (,
  • trigger.value,
  • a token symbol directly after a number.
Each other symbol is refused: a bare token name, a $name, and trigger.<field> for a field other than value. The language has no division, no unary minus, no negative literal, no comparison and no condition. The maximum length of one expression is 256 bytes.

Unit rules

Each expression has one unit: an amount of token T, a percentage, a bare number, or open. Open is the unit of trigger.value under a transfer trigger without a range. A percentage and a bare number are two different units. The value of every action must have the unit “amount” or “open”. The value of off_ramp must have the unit “amount of EURe”. An open product of two amounts, such as trigger.value * trigger.value, passes these rules, and every fire refuses it.

Evaluation rules

Lexical forms

Token universe

The parser accepts these 26 symbols, case-sensitive:
The stage then accepts only the tokens of the network:

Availability by network and account kind

“Named by the document” means a literal amount, or trigger.value under a transfer trigger with a range.

Numeric limits

Check a document by hand

Apply these checks in this order. The engine applies them in the same order, and it reports the first failure.
1

Size

The text is at most 65536 bytes, nests at most 32 levels, and has no &anchor or *alias.
2

YAML

The text is valid YAML. The top level is a mapping. No key occurs twice in one mapping.
3

Shape

Every mapping has only its known keys and every required key. Every scalar has its form. Every list that needs an item has one. rules or agent_envelope is present.
4

Units

Every expression follows the unit rules. Each exchange has two different tokens when the input token is known.
5

References and allowlists

Every $name exists and holds the right form. trigger.value occurs only under a transfer trigger. Transfer filters avoid the zero address and self-matches. Each literal off_ramp amount has whole cents. Each token, recipient and IBAN is on its allowlist.
6

Network and account

Every token is a token of the network. No payment goes to the account itself or to the zero address. Each action and trigger is available on the network and for the account kind. Each literal amount is above the fee floor. The fee token is allowed and is on token_allowlist.
The refusal text of each check is on Validation.