> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ana.fi/llms.txt
> Use this file to discover all available pages before exploring further.

# Rules

> The rule document — triggers, actions, limits — and how to write one.

A rule document is YAML. One document holds every rule of one account. Each new commit replaces the whole document.

```yaml theme={null}
global:
  fees_method: USDC
rules:
  savings:
    trigger: { type: incoming_tx, value: "100.. USDC" }
    actions:
      - { type: send_one, to: "0xSavings…", value: "trigger.value * 20%" }
      - { type: notify, channel: email, message: "Moved 20% to savings" }
```

## Triggers

| Trigger | Fires |
| - | - |
| `periodic` | Every N seconds |
| `calendar` | On a day of the month or week, at a local time |
| `at_fixed_time` | At one or more fixed times |
| `incoming_tx` | When the account receives a transfer |
| `outgoing_tx` | When the account sends a transfer |
| `price_crossed` | When a token price crosses a level |

## Actions

| Action | Does |
| - | - |
| `send_one` | One payment |
| `send_batch` | Several payments, all or none |
| `exchange` | A swap at a market price, with a slippage bound |
| `notify` | An email to an address that the owner verified |
| `off_ramp` | A payout to a bank account (selected networks) |

## The full grammar

Each network serves the complete grammar, with worked examples, as one Markdown page:

```
GET https://api.polygon.ana.fi/api/dsl/docs
```

Give this URL to a coding agent. It is written for one.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.