Skip to main content
Programmable Transactions let you express onchain actions and the conditions they must satisfy in a program. Use the Sauce SDK to write, simulate and run that program, either on its own or as part of a transfer’s destination execution. For example, you can check a balance before making a payment, choose between swap pools using their current prices, or swap tokens and supply the result to a lending market. The program makes those decisions when the transaction runs.

Choose the workflow you need

A program is not a scheduler. Your application or agent decides when to submit it; the program evaluates its conditions during execution. A successful transaction means that the actions and checks you encoded succeeded, so choose those checks to match your intended outcome.

Run a standalone program

A standalone program does not require a Routes quote or intent. You compile it for a chain, simulate it against chain state, and build a transaction for a wallet to sign. The program usually runs through a Pot, the account that holds its funds and makes its contract calls. Those calls and checks run within one transaction on one chain. If an unhandled failure occurs, that transaction’s changes roll back together. Approvals and funding sent in earlier transactions remain separate. Use the Sauce SDK overview to choose a development interface, then follow your first program.

Add execution to a route

For a transfer that should also invoke a destination contract, choose the amount of logic you need: You do not need a Sauce program for a fixed sequence of destination calls. Use one when execution needs conditions, branching or intermediate results from other calls.

How a route runs a program

  1. A solver, the participant fulfilling the route, supplies tokens on the destination chain.
  2. The destination Portal, the Routes contract, passes the tokens to its Executor.
  3. The Executor runs the route’s destination calls in order.
  4. A destination call can run a Sauce program through a Pot.
The integration guide explains how to construct these calls on EVM chains and choose who owns the Pot.

What rolls back together

Destination token delivery, destination calls and the Sauce program run inside one fulfillment transaction. An unhandled failure reverts that transaction’s changes. Source-chain funding, fulfillment proof and any refund follow separate steps. A failed destination transaction does not undo a source-chain deposit or immediately return its funds. See Intents for the transfer lifecycle.

Next steps