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

# Configure triggers and actions

> Configure the triggers that activate wallet automations and the wallet actions they create.

An automation's `config` pairs one trigger with one action. Triggers define when an automation runs; actions define what it does. New actions can reuse existing triggers whenever the combination is compatible.

The config is reusable across wallets. Values that differ by wallet belong to the attachment instead.

## Triggers

### Deposit

The `deposit` trigger activates when Privy detects a deposit to a wallet with an enabled attachment and the deposited asset matches the configured filter.

A deposit that does not match an enabled attachment does not create an execution. If multiple attachments match, Privy selects the [oldest matching attachment](/wallets/automations/manage#matching-precedence).

Privy evaluates recipient-side asset transfers. Outgoing activity does not activate a deposit trigger. Deposit matching has no minimum amount, and the transferred amount does not determine the action amount.

Attaching an automation to a funded wallet does not process its existing balance. A new matching deposit or a [reindex request](/wallets/automations/lifecycle#recover-a-missed-or-failed-deposit) must start the execution.

#### Supported chains

Wallet automations can detect deposits on the following mainnet chains:

| Chain | CAIP-2 identifier |
| - | - |
| Tempo | `eip155:4217` |
| Ethereum | `eip155:1` |
| Base | `eip155:8453` |
| Polygon | `eip155:137` |
| Arbitrum | `eip155:42161` |
| Optimism | `eip155:10` |
| BNB Smart Chain | `eip155:56` |
| Monad | `eip155:143` |
| Solana | `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp` |
| Robinhood Chain | `eip155:4663` |
| Plasma | `eip155:9745` |
| MegaETH | `eip155:4326` |

Tron deposit automations are available to apps with Tron support enabled.

Detection support does not guarantee that every action route is available.

Use the [swap quote endpoint](/api-reference/wallets/swap/quote) to confirm the source and destination before creating an automation.

### Filter assets

The `assets.mode` field controls which deposits match:

| Mode | Values | Behavior |
| - | - | - |
| `all` | None | Match every detected asset. |
| `include` | 1–20 | Match only the listed assets. |
| `exclude` | 1–20 | Match every asset except the listed assets. |

Each `include` or `exclude` value identifies an asset using a human-readable alias or canonical identifiers:

| Input | Scope |
| - | - |
| `{"asset": "usdc"}` | USDC on every supported deployment. |
| `{"asset": "usdc", "chain": "base"}` | USDC on Base. |
| `{"asset": "*", "chain": "base"}` | Every detected asset on Base. |
| `{"asset_address": "0x...", "caip2": "eip155:8453"}` | A contract address on a specific chain. |

Provide exactly one of `asset` or `asset_address` per `value`. A raw `asset_address` must include either `chain` or `caip2`.

The `all` and `exclude` modes can match arbitrary deposited tokens. A matching action can still fail when the asset or route is unsupported.

<Warning>
  A matching deposit acts on the triggering asset's full current wallet balance, not only the amount
  from the latest deposit. Any earlier balance of that asset can be included.
</Warning>

If the balance is zero when the execution runs, Privy marks the execution as `skipped` and does not create a wallet action.

## Actions

### Swap

The `swap` action converts the triggering asset into one configured destination asset and chain. `destination_chain_asset` accepts aliases or canonical identifiers, but it must identify exactly one asset on exactly one chain.

```json theme={"system"}
{
  "type": "swap",
  "destination_chain_asset": {
    "asset": "usdc",
    "chain": "base"
  }
}
```

Generated actions follow the [Swap API's behavior and considerations](/wallets/actions/swap/overview), including route, fee, and slippage behavior. The source wallet's [policies](/controls/policies/overview) continue to apply. The app must also have [swaps enabled](/wallets/actions/swap/setup).

Create-time validation does not quote the route or guarantee liquidity. Route, provider, balance, and policy errors can occur when an execution runs. Review the [supported chains](/wallets/actions/swap/overview#supported-chains) and [cross-chain routes](/wallets/actions/swap/overview#cross-chain-swaps) before configuring the action.

### Earn deposit

The `earn_deposit` action deposits the triggering asset's full current wallet balance into one configured Earn vault.

```json theme={"system"}
{
  "type": "earn_deposit",
  "vault_id": "vault-id"
}
```

The deposit trigger must use `include` mode with exactly one asset. That asset and chain must match the vault's underlying asset. Privy rejects broader filters, multiple assets, and mismatched assets when the automation is created or updated.

The vault must belong to the same Privy app as the automation. The app can create a separate automation for each vault and attach the appropriate automation to each wallet.

Earn deposit attachments do not accept per-wallet `params`. The action gets its vault from `vault_id` and its amount from the wallet's current balance.

When assets return to the wallet through an Earn withdrawal, Privy recognizes the vault's withdrawal source and skips the deposit trigger. This prevents an automated redeposit loop.

Generated actions follow the [Earn deposit lifecycle](/wallets/actions/earn/deposit). The source wallet's [policies](/controls/policies/overview) continue to apply.

## Per-wallet parameters

Only swap automations use per-wallet parameters. Swap output addresses belong to attachments rather than the reusable action config. This allows one automation to send each wallet's output to a different destination.

```json theme={"system"}
{
  "automation_ids": ["automation-id"],
  "params": {
    "destination_address": "0x..."
  }
}
```

Privy verifies that an automated swap uses the destination asset from the automation and the `destination_address` from the matched attachment.

Omit `params` when attaching an Earn deposit automation.

## Example configuration

This config swaps USDC deposits on any chain into pathUSD on Tempo:

```json theme={"system"}
{
  "trigger": {
    "type": "deposit",
    "assets": {
      "mode": "include",
      "values": [{"asset": "usdc"}]
    }
  },
  "action": {
    "type": "swap",
    "destination_chain_asset": {
      "asset": "pathusd",
      "chain": "tempo"
    }
  }
}
```

Continue to [create and attach a swap automation](/wallets/automations/create-and-attach), or follow the [Earn deposit automation guide](/wallets/automations/earn-deposits).
