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

# Programmable Transactions

> A single transaction with embedded decision logic, read state from multiple contracts, pick the optimal path, execute atomically. No contract deployment. Powered by the Sauce protocol. Beta.

<Note>
  Programmable Transactions is in **beta**, available for **early access to select Eco partners and customers**. The protocol (Sauce) is functional and audited; the developer-facing integration surfaces, SDK, MCP, and template APIs for common transaction and trading flows, are still landing. [Contact us](mailto:contact@eco.com) to integrate.
</Note>

A **Programmable Transaction** is a single onchain transaction with embedded decision logic. It can read state from multiple contracts, pick between paths based on the result, and execute the optimal one, atomically, without deploying a contract.

This turns "best execution" from a marketing claim into a runtime property: the transaction itself picks the best path at execution time, not at signing time.

Sauce is Eco's protocol for automating stablecoin flows and liquidity strategies. It gives developers full transaction control, encoding intelligent transactions that adapt to market conditions at runtime and execute atomically, for superior price execution and faster time to market.

## What it enables

| Pattern                    | Today (without programmable tx)                            | With programmable tx                                   |
| -------------------------- | ---------------------------------------------------------- | ------------------------------------------------------ |
| Multi-DEX best price       | Three quote calls and one swap, prices drift between calls | Quote three DEXes, decide, swap on the winner, one tx  |
| Conditional execution      | Off-chain logic and manual triggering                      | "Only swap if price \< X" inline in the tx             |
| Cross-protocol composition | Custom contract per integration                            | Compose any two contracts at tx-time                   |
| MEV-resistant routing      | Difficult; multi-tx leaks intent                           | Single atomic tx, no inter-tx window for front-running |
| AI agent execution         | Agent must deploy contracts or send many txs               | Agent emits one programmable tx                        |

## How Sauce works

```text theme={null}
Standard transaction:  user → contract A → contract B → done   (no decision-making)

Programmable tx:       user → orchestration layer (Sauce)
                              ├── reads contract A
                              ├── reads contract B
                              ├── reads contract C
                              ├── compares results
                              └── executes optimal path (A, B, or C)
```

The "orchestration layer" lives in the calldata itself. A magic header (`0x5A00CE`) signals that the transaction contains embedded **operation bytecode**, a Turing-complete sequence of opcodes that handles decision-making between calls. External contracts see normal calldata; they don't know they're part of an orchestrated transaction.

Sauce ships **50+ opcodes** covering data extraction, cross-call memory, control flow (if/else, loops), boolean logic, arithmetic, and crypto operations.

## Use cases

| Who                      | What they build                                            |
| ------------------------ | ---------------------------------------------------------- |
| **DEX aggregators**      | Real best-price routing without separate quoter calls      |
| **Liquidation services** | Atomic check-and-repay across positions                    |
| **Yield optimizers**     | Read N vault APYs, switch position into the winner         |
| **AI agents**            | Single-tx multi-step strategies, no contracts to deploy    |
| **MEV-resistant apps**   | One atomic tx eliminates the inter-tx front-running window |

## Status

| Capability                   | Status                        |
| ---------------------------- | ----------------------------- |
| EVM support                  | Fully featured, audit planned |
| Dev tools and recipe library | In development                |
| SVM support                  | In development                |
| MCP server and AI skills     | Future                        |
