> ## 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.

# Sauce SDK quickstarts

> Run your first Sauce program, then explore complete examples for payments, swaps, lending and portfolio checks.

Start with [your first Sauce program](https://docs.eco.com/quickstarts/sauce/first-program.md) to compile and simulate a USDC payment. Then choose an example below for the action you want to build.

These quickstarts use the Sauce SDK to run programs on one chain. Each example explains its inputs and checks, provides commands to compile and simulate it, and records the documented result. Examples that move funds also show how to send the transaction. For language, CLI and TypeScript references, use the **Sauce SDK** tab.

## Where to start

| Your goal | Start here |
| - | - |
| Understand what Sauce does | [Introduction to Sauce](https://docs.eco.com/sauce/introduction.md) |
| Set up the tools and run a first simulation | [Run your first Sauce program](https://docs.eco.com/quickstarts/sauce/first-program.md) |
| Learn the language step by step | [Sauce by example](https://docs.eco.com/sauce/by-example.md) |
| Adapt a small working program | [Pay USDC](https://docs.eco.com/quickstarts/sauce/pay.md), then [swap and pay](https://docs.eco.com/quickstarts/sauce/swap-then-pay.md) |
| Work on Solana | [Solana payments](https://docs.eco.com/quickstarts/sauce/solana-payment.md), then [Solana swaps](https://docs.eco.com/quickstarts/sauce/solana-swap.md) |

## Before you use an example

Install the [Sauce SDK tools](https://docs.eco.com/sauce-sdk/installation.md), then follow the selected example's prerequisites. You can also [connect a coding agent](https://docs.eco.com/sauce-sdk/ai-agents.md) to help adapt and simulate a program.

An example runs on one chain through your Pot. Token and protocol names resolve for that chain at compile time; the example lists its target chains. An unhandled failure reverts the cook's state changes. On EVM chains, a program can also catch a failed attempt and continue, as the [fallback swap](https://docs.eco.com/quickstarts/sauce/try-fallback-swap.md) shows.

When you adapt an example:

* Supply `main`'s parameters in the documented order. Token amounts use the token's smallest unit: `1000000` is 1 USDC.
* Distinguish simulated balances from real funds. `--assume-balance` affects only the simulation; on EVM chains, `--fund` pulls tokens from your wallet into the Pot during the cook, subject to the required approval.
* Set recipients, price limits and minimum outputs for your use case. Sample prices are not current quotes.
* Check the [chain](https://docs.eco.com/sauce-sdk/reference/chains.md) and [deployment](https://docs.eco.com/sauce-sdk/reference/deployments.md) references before sending. Compilation and a local simulation do not establish live deployment availability.

Each **Simulation result** names its block or slot, any assumed state, and where it ran: on the named chain through an endpoint, or in a local fork or a local LiteSVM copy with the documented release's contracts. These are recorded simulations, not transactions sent to the network. An example identifies branches that were not exercised, such as repaying an existing Aave debt.

## Payments

> **[Pay USDC](https://docs.eco.com/quickstarts/sauce/pay.md)**
>
> Pay one recipient and verify the USDC received. Base, Ethereum, Arc.

> **[Pay a list](https://docs.eco.com/quickstarts/sauce/pay-list.md)**
>
> Pay a list of recipients while keeping total payments within a cap. Base.

> **[Payroll by weight](https://docs.eco.com/quickstarts/sauce/payroll-by-weight.md)**
>
> Split a USDC budget by weight and send the rounding remainder to the last recipient. Base, Ethereum.

> **[Swap, then pay](https://docs.eco.com/quickstarts/sauce/swap-then-pay.md)**
>
> Sell WETH for USDC, pay an exact invoice, and return the change in both tokens. Base.

> **[Sweep the Pot](https://docs.eco.com/quickstarts/sauce/sweep-pot.md)**
>
> Transfer all of the Pot's USDC, WETH and native coin to one recipient. Base, Ethereum.

> **[Native USDC on Arc](https://docs.eco.com/quickstarts/sauce/arc-native-payment.md)**
>
> Pay USDC as native value on Arc and measure it at 18 and at 6 decimals. Arc.

## Swaps

> **[Quote, swap and supply](https://docs.eco.com/quickstarts/sauce/quote-swap-supply.md)**
>
> Compare two WETH-to-USDC quotes, swap on the higher quote and supply the output to Aave V3. Base.

> **[Distributed swap](https://docs.eco.com/quickstarts/sauce/distributed-swap.md)**
>
> Buy WETH with USDC across several pools, applying a price limit that accounts for each pool's fee. Base.

> **[Try a venue, fall back](https://docs.eco.com/quickstarts/sauce/try-fallback-swap.md)**
>
> Attempt a Uniswap V3 swap; if it fails the checks, undo the attempt and try Aerodrome Slipstream. Base.

> **[Multi-venue route](https://docs.eco.com/quickstarts/sauce/multi-venue-route.md)**
>
> Swap WETH to USDC, then USDC to USDT, with a minimum output for each swap. Ethereum.

> **[Oracle-guarded swap](https://docs.eco.com/quickstarts/sauce/oracle-guarded-swap.md)**
>
> Check a pool price against Chainlink before selling WETH. Ethereum.

> **[Buy tokenized stock](https://docs.eco.com/quickstarts/sauce/buy-tokenized-stock.md)**
>
> Compare pools for a tokenized-stock purchase, enforce a price cap and return unspent USDC. Ethereum.

> **[Price survey](https://docs.eco.com/quickstarts/sauce/price-survey.md)**
>
> Compare price readings from Chainlink and Uniswap with a simulation. Ethereum.

## Lending and yield

> **[Supply idle USDC](https://docs.eco.com/quickstarts/sauce/supply-idle.md)**
>
> Maintain a USDC reserve by supplying excess funds to Aave V3 or withdrawing a shortfall. Base, Ethereum.

> **[Borrow with a health-factor floor](https://docs.eco.com/quickstarts/sauce/aave-borrow-guard.md)**
>
> Supply WETH, borrow USDC, and revert unless the health factor stays above a floor. Base.

> **[Repay by health factor](https://docs.eco.com/quickstarts/sauce/aave-repay-by-health.md)**
>
> Repay USDC debt on Aave V3 when the health factor is below a target. Base, Ethereum.

> **[USDC to sDAI](https://docs.eco.com/quickstarts/sauce/usdc-to-sdai.md)**
>
> Swap USDC for DAI on Curve's 3pool and deposit the DAI into sDAI, with a minimum on the shares. Ethereum.

## Portfolio checks and automation

These programs evaluate conditions when you run them. To repeat them or react to market changes, you need an external scheduler or caller.

> **[Dollar-cost averaging](https://docs.eco.com/quickstarts/sauce/dca.md)**
>
> Run one step of a recurring purchase plan: buy WETH within a price limit or skip the purchase. Base, Ethereum.

> **[Stop-loss](https://docs.eco.com/quickstarts/sauce/stop-loss.md)**
>
> Check a stop-loss or take-profit threshold and sell WETH when it is reached. Ethereum.

> **[Rebalance](https://docs.eco.com/quickstarts/sauce/rebalance.md)**
>
> Trade toward a target WETH/USDC allocation when the balance leaves a chosen band. Base, Ethereum.

> **[Holdings per chain](https://docs.eco.com/quickstarts/sauce/holdings-per-chain.md)**
>
> Read token balances using the same program compiled separately for each chain. Base, Ethereum.

> **[Buy the dip](https://docs.eco.com/quickstarts/sauce/buy-the-dip.md)**
>
> Measure a price decline from a reference and buy WETH when it crosses a threshold. Ethereum.

## Solana

> **[Solana swap](https://docs.eco.com/quickstarts/sauce/solana-swap.md)**
>
> Swap USDC for wrapped SOL (WSOL) on Orca and send the output to a recipient. Solana.

> **[Solana payment](https://docs.eco.com/quickstarts/sauce/solana-payment.md)**
>
> Transfer USDC and a Token-2022 asset, then inspect the amounts received. Solana.

> **[Solana distributed swap](https://docs.eco.com/quickstarts/sauce/solana-distributed-swap.md)**
>
> Buy a token across several pools while enforcing price and output limits. Solana.

> **[Wrap SOL](https://docs.eco.com/quickstarts/sauce/solana-wrap-sol.md)**
>
> Wrap the owner's SOL in the Pot and check the resulting WSOL balance. Solana.

## Advanced integrations

> **[Actions: swap and supply](https://docs.eco.com/quickstarts/sauce/actions-swap-supply.md)**
>
> Describe a swap and Aave supply as JSON actions that compile to SauceScript. Base.

> **[Low-level calls](https://docs.eco.com/quickstarts/sauce/low-level-call.md)**
>
> Use raw calldata, a custom ABI, a gas limit and error handling. Base.

## Troubleshooting

| What you see | What to check |
| - | - |
| A token or protocol name fails to compile | Confirm the example's target chain and inspect its [registry](https://docs.eco.com/sauce-sdk/reference/chains.md). |
| The simulation reports insufficient funds | Check token decimals and `main` arguments. Use `--assume-balance` only for simulated funding. |
| A minimum-output or price-limit check fails | Read a fresh quote or pool price and review the bound; the recorded example's price may no longer apply. |
| A transaction cannot be built or sent | Check deployment availability, wallet authorization, required approvals and native coin for fees. See [funding](https://docs.eco.com/sauce-sdk/cli/funding.md) and [simulation](https://docs.eco.com/sauce-sdk/cli/simulate.md). |

## Next steps

* [Run your first Sauce program](https://docs.eco.com/quickstarts/sauce/first-program.md): install the CLI, compile and simulate a first program.
* [Introduction to Sauce](https://docs.eco.com/sauce/introduction.md): what a program, a Pot and a cook are.
* [Protocols reference](https://docs.eco.com/sauce-sdk/reference/protocols.md): every protocol namespace and the chains it is deployed on.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.