ana
fi
ANA.FI / TECHNOLOGY / DEVELOPERS

Build the screen.
Skip the engine. SDK, API and a rule language for stablecoin payments and automation.

Anafi is a non-custodial engine for stablecoin payments, payouts and bank off-ramps. Your app fills in a rule, your user signs once, Anafi runs it.

global:
  token_allowlist: [USDC]
  recipient_allowlist: ["$utility"]
rules:
  pay_bill:
    trigger:
      type: calendar
      day_of_month: [5]
      time_of_day: "09:00"
    actions:
      - { type: send_one, to: "$utility", value: "80 USDC" }
    expiry: "2027-12-31T23:59:59Z"

YOUR USER READSOn the 5th of each month, pay the utility bill: 80 USDC, until the end of 2027.

global:
  recipient_allowlist: ["$savings", "$bills"]
rules:
  split_income:
    trigger: { type: incoming_tx, from: "$employer" }
    actions:
      - type: send_batch
        recipients:
          - { to: "$savings", value: "trigger.value * 50%" }
          - { to: "$bills", value: "trigger.value * 20%" }

YOUR USER READSEach time pay arrives from the employer, half goes to savings and a fifth to the bills account. The rest stays.

global:
  token_allowlist: [USDC, WETH]
rules:
  weekly_buy:
    trigger:
      type: calendar
      day_of_week: ["mon"]
      time_of_day: "09:00"
    actions:
      - { type: exchange, in: "50 USDC", out: WETH }

YOUR USER READSEvery Monday, swap 50 USDC for WETH. The asset stays in the user’s wallet.

global:
  iban_allowlist: ["$utility_iban"]
rules:
  bill_to_bank:
    trigger:
      type: calendar
      day_of_month: [5]
      time_of_day: "09:00"
    actions:
      - type: off_ramp
        to: { iban: "$utility_iban", company_name: "Utility", country: DE }
        value: "80 USDC"
        memo: "Invoice 2041"

YOUR USER READSOn the 5th, a licensed partner converts 80 USDC and pays it into the biller’s bank account, with a reference.

HOW IT WORKS: Sign once.
It runs.

Where Anafi sits in your stack. Your app builds a rule, your user signs one transaction, and the engine pays each time the condition is met.

Your sideAnafiChain and bank1 rule file2 rule, encrypted3 approved hash4 sign step5 one transaction: the rule's hash6 signed payment7 transfer8 or a bank payout9 activityYour appA form, a sign step, an activity view.Holds no key and no funds.User's walletHolds the key and the funds.Signs once. Revokes with one transaction.SDK and APIBuilds and sends the rule.Returns the activity.Anafi engineRuns in an Intel TDX enclave.Checks each rule. Signs each payment.One key, sealed inside.PayeeReceives a transfer.Integrates nothing.On chainOnly the rule's hash.One nonce per payment.Pays only on a valid engine signature.Licensed partnerConverts and pays a bank account,with a reference.Once, at set-upEach time the condition is met
Your side
Your appA form, a sign step, an activity view.Holds no key and no funds.
User's walletHolds the key and the funds.Signs once. Revokes with one transaction.
Anafi
SDK and APIBuilds and sends the rule.Returns the activity.
Anafi engineRuns in an Intel TDX enclave.Checks each rule. Signs each payment.One key, sealed inside.
Chain and bank
PayeeReceives a transfer.Integrates nothing.
On chainOnly the rule's hash.One nonce per payment.Pays only on a valid engine signature.
Licensed partnerConverts and pays a bank account,with a reference.
  1. 01 · Your app → SDK and API

    rule file

  2. 02 · SDK and API → Anafi engine

    rule, encrypted

  3. 03 · Anafi engine → Your app

    approved hash

  4. 04 · Your app → User's wallet

    sign step

  5. 05 · User's wallet → On chain

    one transaction: the rule's hash

  6. 06 · Anafi engine → On chain

    signed payment

  7. 07 · On chain → Payee

    transfer

  8. 08 · On chain → Licensed partner

    or a bank payout

  9. 09 · SDK and API → Your app

    activity

Once, at set-upEach time the condition is met

BUILD WITH AI: Tell your agent what you want.

Pick what your users should do. Copy the prompt, or open it in your assistant. It designs the screens and writes the rules.

MY USERS CAN
YOUR PROMPT
I am adding stablecoin automations to my app with Anafi (https://ana.fi/developers/). Help me design the screens and write the rules.

What my users should be able to do:
- Send money to other users of my app
- Pay out to a bank account
- Save a share of each incoming payment into a pot
- Set aside a share of each incoming payment for tax

How Anafi works:
- My app builds a rule from a form. The user reads the rule as one sentence and signs one transaction in their own wallet.
- The Anafi engine then runs the rule. It pays each time the condition is met, only inside the limits the user signed.
- My app never holds keys or funds. The user can revoke with one transaction.

The rule language is YAML:
- trigger types: calendar (day_of_month or day_of_week as lists, with time_of_day and an optional timezone), periodic (interval_seconds), at_fixed_time (timestamps), incoming_tx and outgoing_tx (value as an amount or a range such as "100.. USDC", plus from, to or account), price_crossed (token, direction, price_usd, hold_seconds, cooldown_seconds)
- action types: send_one (to, value), send_batch (recipients, each with to and value), exchange (in, out), off_ramp (to with an iban, value, memo), notify (channel, message)
- limits: token_allowlist, recipient_allowlist and iban_allowlist under global, and start and expiry on a rule, as full timestamps
- A value is an amount and a token ("80 USDC") or a share of what arrived ("trigger.value * 10%"). A name that starts with $ is a value my app fills in.
- The full specification, with worked examples, is public: https://api.polygon.ana.fi/api/dsl/docs. Read it first if you can open links, and follow it.

Example rule:
rules:
  pay_bill:
    trigger: { type: calendar, day_of_month: [5], time_of_day: "09:00" }
    actions:
      - { type: send_one, to: "$utility", value: "80 USDC" }
    expiry: "2027-12-31T23:59:59Z"

For each feature, give me:
1. The screen: its form fields, the one-sentence summary the user reads before signing, and the empty, loading and error states.
2. The rule template in YAML, with $ placeholders for the values the form fills in.
3. The activity view, with a revoke button.

Then list where my code calls Anafi: build the rule, send it for approval, ask the user to sign, read the activity, revoke. Mark each call as a TODO. Do not invent SDK or API names: I will add them from Anafi's reference.

Before you start, ask me what you need to know about my app.
OPEN IN

The portal gives your agent a starter prompt and the rule language specification. Start in sandbox

WHAT YOUR AGENT BUILDS
1 / 10

Send to a friend

THE FORM
To
Another user
Amount
20 USDC
Repeat
Every Friday
YOUR USER READS

Every Friday at 09:00, send 20 USDC to another user.

THE RULE
rules:
  pay_friend:
    trigger:
      type: calendar
      day_of_week: ["fri"]
      time_of_day: "09:00"
    actions:
      - type: send_one
        to: "$friend"
        value: "20 USDC"
Use case

Bank payout

THE FORM
To
A bank account
Amount
80 USDC
On
The 5th
Reference
Invoice 2041
YOUR USER READS

On the 5th, pay 80 USDC into a bank account, with a reference.

THE RULE
rules:
  to_bank:
    trigger:
      type: calendar
      day_of_month: [5]
      time_of_day: "09:00"
    actions:
      - type: off_ramp
        to:
          iban: "$payee_iban"
        value: "80 USDC"
        memo: "Invoice 2041"
Use case

Rent

THE FORM
To
Landlord's bank account
Amount
1,850 USDC
On
The 1st
Reference
APT4B-RENT
YOUR USER READS

On the 1st of every month, pay 1,850 USDC to the landlord's bank account, reference APT4B-RENT.

THE RULE
rules:
  rent:
    trigger:
      type: calendar
      day_of_month: [1]
      time_of_day: "09:00"
    actions:
      - type: off_ramp
        to:
          iban: "$landlord_iban"
        value: "1850 USDC"
        memo: "APT4B-RENT"
Use case

Savings pot

THE FORM
When
Pay arrives
Share
10%
To
Savings pot
YOUR USER READS

Each time pay arrives, 10% goes to the savings pot.

THE RULE
rules:
  save:
    trigger:
      type: incoming_tx
      from: "$employer"
    actions:
      - type: send_one
        to: "$pot"
        value: "trigger.value * 10%"

Tax set-aside

THE FORM
When
100 USDC or more arrives
Share
25%
To
Tax wallet
YOUR USER READS

When 100 USDC or more arrives, 25% of it goes to the tax wallet.

THE RULE
rules:
  tax:
    trigger:
      type: incoming_tx
      value: "100.. USDC"
    actions:
      - type: send_one
        to: "$tax"
        value: "trigger.value * 25%"
Use case

Payment split

THE FORM
When
500 USDC or more arrives
Partner
40%
Tax wallet
25%
YOUR USER READS

When 500 USDC or more arrives, 40% goes to a partner and 25% to the tax wallet.

THE RULE
rules:
  split:
    trigger:
      type: incoming_tx
      value: "500.. USDC"
    actions:
      - type: send_batch
        recipients:
        - to: "$partner"
          value: "trigger.value * 40%"
        - to: "$tax"
          value: "trigger.value * 25%"
Use case

Auto-convert

THE FORM
When
WETH arrives
Sell
All of it
For
USDC
YOUR USER READS

When 0.01 to 2 WETH arrives, sell all of it for USDC at market.

THE RULE
rules:
  to_usdc:
    trigger:
      type: incoming_tx
      value: "0.01..2 WETH"
    actions:
      - type: exchange
        in: "trigger.value"
        out: USDC
Use case

Stop-loss

THE FORM
When
WETH below $2,000
For
15 minutes
Sell
2 WETH for USDC
YOUR USER READS

When WETH stays below $2,000 for 15 minutes, sell 2 WETH for USDC at market.

THE RULE
rules:
  stop_loss:
    trigger:
      type: price_crossed
      token: WETH
      direction: below
      price_usd: 2000
      hold_seconds: 900
      cooldown_seconds: 86400
    actions:
      - type: exchange
        in: "2 WETH"
        out: USDC
Use case

Reimbursement

THE FORM
Watch
A team member's wallet
Payments
1 to 500 USDC
Pay back
100%
YOUR USER READS

Each payment of 1 to 500 USDC that a team member sends is paid back in full.

THE RULE
rules:
  pay_back:
    trigger:
      type: outgoing_tx
      account: "$member"
      value: "1..500 USDC"
    actions:
      - type: send_one
        to: "$member"
        value: "trigger.value"
Use case

Follow a wallet

THE FORM
Watch
A wallet
Sends
1,000 WETH or more
Then
Swap 1 WETH for USDC
YOUR USER READS

When a followed wallet sends 1,000 WETH or more to an exchange, swap 1 WETH for USDC.

THE RULE
rules:
  follow:
    trigger:
      type: outgoing_tx
      account: "$watched"
      to: "$exchange"
      value: "1000.. WETH"
    actions:
      - type: exchange
        in: "1 WETH"
        out: USDC
Use case

Ten templates. Hover or tap a keyword to see what it does.

THE RULE LANGUAGE: A rule is a short file.

Three parts: what fires it, what it does, and its limits.

FIRES ONtrigger:
calendar
A day of the month or of the week.
at_fixed_time
One fixed time.
periodic
An interval.
incoming_tx
An incoming payment, by sender and amount.
outgoing_tx
A payment a watched account sends.
price_crossed
A price crossing a level.
DOESactions:
send_one
Send to one payee.
send_batch
Send to several, all or nothing.
exchange
Swap one token for another.
off_ramp
Pay out to a bank account.
notify
Email the owner.
BOUNDED BYlimits:
token_allowlist
The tokens it may move.
recipient_allowlist
The payees it may pay.
iban_allowlist
The bank accounts it may pay.
value
The amount written in the rule.
start, expiry
The dates it runs between.
API REFERENCE

Stablecoin payments API: endpoints, authentication and webhooks.

Your project, its API keys and the rule language specification are in the Anafi portal.

Open the portal

NON-CUSTODIAL INTEGRATION: What you build. What you skip.

YOUR SIDE

You build

  • A form that fills in a rule.
  • A sign step in the user's own wallet.
  • An activity view, with a revoke button.
ANAFI'S SIDE

The engine runs

  • The scheduler.
  • Retries.
  • Bank payouts, through licensed partners.
  • Proof that nothing was skipped.
BUILD WITH
The SDK, the API and the rule language.
RAILS
Your off-ramp and virtual accounts, or ours.
HOSTING
Our engine, co-hosted, or yours.

FROM TEST TO LIVE: Sandbox. Playground. Live.

  1. 01 SANDBOX

    A project in the portal, with test funds and sample data.

  2. 02 PLAYGROUND

    Walk the flow your user sees, and read the rule it makes.

  3. 03 LIVE

    Your users sign in their own wallets, and the engine runs.

FAILURE MODES: When something goes wrong.

Four parties, and only one of them can sign a payment. It signs what the rule allows, and nothing else.

IF

Anafi goes offline

Nothing fires, and the funds stay in the user’s wallet. Missed payments run once, late, when the engine is back.

IF

Your app is breached

Your app holds no key. A payment needs the engine’s signature, and the engine signs only what the user’s rule allows.

IF

Anafi is asked for data

We can only hand over what we hold: wallet addresses and execution logs. Rules are encrypted. KYC stays with the licensed partner.

IF

A rule is wrong

The engine checks each rule before the user signs it: syntax, amounts, payees. A rule it has not approved cannot be committed.

IF

The user wants out

One transaction from the user’s own wallet revokes the mandate. Nobody’s permission is needed, and it takes effect once confirmed.

IF

The balance is short

The payment is retried once, then it reverts. Nothing moves.

VERIFY: Don't trust it. Check it.

Four things you can verify yourself, without asking us, and who has reviewed the code.

  1. 01

    Attested engine

    proves which code holds the key

    The engine runs in an Intel TDX enclave. Its attestation is published on chain and bound to an exact, reproducible build, and our verifier checks it with only an RPC node. The Anafi team cannot read inside the enclave or use its key.

  2. 02

    Rule hash

    proves what the user signed

    A rule is encrypted on the user’s device. On chain there is only its hash, and every payment can be checked against it. The rule itself stays private.

  3. 03

    Signed heartbeat

    proves nothing was skipped

    Every 30 minutes the engine signs a heartbeat that records the block it has processed to. The attested code reads every block in order, so a valid heartbeat shows every rule was evaluated up to that block. If it stops, anyone can see it.

  4. 04

    One nonce per payment

    proves nothing ran twice

    Each payment carries a unique on-chain nonce and an expiry. The wallet refuses a second execution, even after a retry, a restart or a reorg, and a late signature is worth nothing.

WHAT IT RUNS ON: Technology agnostic.

CHAINS SUPPORTED
EVM chainsSolana
ACCOUNTS
SafeSwigMPC walletsERC-4337EIP-7702ERC-20 approvalPermit2
TOKENS

Any stablecoin, or any deployed whitelisted token.

PRIVACY

Rules are private and verifiable on chain.

FAQ: Before you write the first line.

How do I add recurring stablecoin payments to my app?
With Anafi you build three things: a form that fills in a rule, a sign step in the user's own wallet, and an activity view with a revoke button. The Anafi engine runs the scheduler, retries and bank payouts. See autopay.
What can developers use on Anafi today?
Sandbox projects and playgrounds are open today in the Anafi portal: create a project and build your first rule. Going live with your own users is in beta testing: talk to us to take part. The rule language specification and your project's API keys are in the portal too.
Is Anafi non-custodial?
Yes. An app built on Anafi holds no keys and no funds. Users sign in their own wallets, and funds stay there until a rule moves them. The engine acts only inside the limits a user signed. See Trust & Security.
What is an Anafi rule?
An Anafi rule is a short YAML file: what fires it, what it does, and its limits. Your app builds it from a form, through the SDK or the API, and the user reads it as one sentence before signing.
Which wallets and chains does Anafi support?
Anafi is technology agnostic: it supports Safe, Swig, MPC wallets, ERC-4337, EIP-7702, ERC-20 approval and Permit2 on EVM chains and Solana. It is live on Ethereum, Polygon and X Layer, with Solana on devnet.
Can we use our own off-ramp or banking partner?
Yes. A rule can pay out to a bank account through your own off-ramp and virtual accounts, or through Anafi's, with licensed partners. See on/off-ramp.
Can we self-host the Anafi engine?
Yes. The Anafi engine runs three ways: hosted by Anafi, co-hosted, or hosted by you.
Can a coding agent build the integration?
Yes. The Anafi portal gives you a prompt to paste into your coding agent, together with the rule language specification.
What does it cost to build on Anafi?
Anafi Mandates and Anafi Treasury are priced by quote. See what Anafi costs.
GET STARTED

Build your first rule
in the sandbox.

Bring your engineer. We walk through the rule language and the integration.

Message Us

We will be in touch with you within one business day.

By sending you agree to our Privacy Policy.