Skip to main content
This guide creates an automation that converts USDC and USDT deposits into pathUSD on Tempo. The app first creates a reusable automation definition, then attaches it to a source wallet.
Run these examples from a trusted server. Never expose the Privy app secret in client-side code.

Prerequisites

The integration requires:

1. Create the automation

Create an app-scoped automation with POST /v1/wallet_automations. See configure triggers and actions for the complete set of trigger, filter and action semantics we support today. The source asset aliases below do not specify a chain. Privy expands each asset to its supported deployments. The destination includes a chain because every swap must have one destination.
Save the returned id. API responses contain the resolved asset_address and caip2 values instead of input aliases. See the create automation API reference for the complete schema.

2. Attach it to a wallet

An attachment enables the automation for one wallet. In the swap example, the params indicate that its destination_address receives the output of every generated swap.
The authorization signature must cover this exact request. Use Privy’s authorization-signature utilities to produce it. An ownerless wallet does not require a wallet-owner signature.
Attaching an automation does not make it a general-purpose wallet signer. Privy authorizes each execution against the attachment’s trigger, action, wallet, and destination.

3. Send a matching deposit

Send USDC or USDT to the source wallet on a supported chain. Privy detects the deposit and evaluates enabled attachments in creation order. The first matching automation creates a swap wallet action. Privy reads the current asset balance when the execution runs. Earlier funds held by the wallet can therefore be included in the swap.

4. Observe the execution

Subscribe to wallet_automation.submitted to receive both the automation execution ID and the generated wallet action ID. The app can also list executions for the source wallet:
Use the execution’s wallet_action_id to track the final swap through the wallet action lifecycle.