@eco-incorp/sauce
v1.0.0
Published
Sauce protocol tooling: the SDK, action primitives, the sauce command and the Sauce MCP server.
Keywords
Readme
Sauce
Sauce lets you write a short program in SauceScript, a subset of TypeScript, that reads live onchain state, chooses a path and composes contract calls in one transaction. Swap, then pay. Borrow, then repay. Check a price, then trade. Your program enforces the conditions you write, an unhandled failure reverts every step, and it runs through your own Pot, so you deploy no contract for each program.
This README is for developers who know TypeScript and the basic ideas of a blockchain (a wallet, a transaction, a token) and have never used Sauce. You need nothing else to start.
What Sauce is, and is not
You write the program in a small, safe slice of TypeScript called SauceScript. Sauce turns it into one transaction on Ethereum, Base, Arc or Solana (or the testnets Arc Testnet, Base Sepolia, Ethereum Sepolia, Solana Devnet and Solana Testnet), and an engine already on chain runs every step of it inside that transaction. Here is a whole program, the one the quick start runs:
// Pays `amount` of USDC from your Pot to `to`, and stops if the Pot holds less.
// The same file runs on Base and on Solana.
//
// Try it on a copy of the chain first: no password, no money, nothing sent.
//
// sauce simulate pay.sauce.ts --chain base --wallet me --assume-balance USDC:5 --args <recipient> 1000000
//
// Then run it for real: your wallet signs and pays the fee, and your Pot pays the USDC.
//
// sauce run pay.sauce.ts --chain base --wallet me --args <recipient> 1000000
//
// On Solana, the same way, with a Solana wallet:
//
// sauce simulate pay.sauce.ts --chain solana --wallet me-solana --assume-balance USDC:5 --args <recipient> 1000000
// sauce run pay.sauce.ts --chain solana --wallet me-solana --args <recipient> 1000000
//
// to: Address who gets the USDC, an address on the chain it runs on
// amount: Uint256 how much, in USDC's smallest unit: USDC has 6 decimals, so 1000000 is 1 USDC
function main(to: Address, amount: Uint256) {
require(pot.USDC >= amount, "not enough USDC");
USDC.transfer(to, amount);
}main is where the program starts, and its parameters are the inputs you give each time you run
it. require stops the whole transaction when its check fails, so nothing moves. USDC needs no
address and no import: Sauce knows it on each chain.
What Sauce is not:
- Not a contract you write. You never write, audit or deploy a smart contract of your own. Your program runs on your Pot, a small account on chain that belongs to your wallet.
- Not one protocol. Sauce is not a wrapper around a single exchange or lender. A program calls any of the protocols Sauce knows, by name, and mixes them in one transaction.
- Not a custodian. Your keys stay with you. Sauce builds the transaction, and your wallet signs it.
What you can do with it
- Do many steps as one. A swap and a payment in a single transaction. If the swap gives too little, nothing moves at all.
- Use protocols by name.
UniswapV3.Factory,AaveV3.Pool,USDC: Sauce knows 133 protocols across 41 chains, and the main tokens of 14 of those chains, with no address to copy. On a chain with no named token, a program writes the token's address once. - Try before you pay.
sauce simulateruns your program on a copy of the chain as it is right now. It needs no key and no money, and shows you what would move. - Hand it to a coding agent. The agent in your editor can write, simulate and run programs for you, with Sauce's own tools.
Start
npm install -g @eco-incorp/sauce
sauce --versionYou need Node.js 24 or newer. Then do the quick start: write the program above, try it for free, and run it on Base, in about ten minutes. Only the last step spends money: a little ETH for the fee and 1 USDC, on Base.
The learning path
The documentation is written to be followed in order. Read What Sauce is for the picture, then do the seven tutorials:
- Quick start: install, try a program for free, run it on Base.
- Write your first program: inputs, checks and transfers of your own.
- Swap by name: trade through protocols you name, and set the least you will accept.
- Solana quick start: the same program on Solana.
- Sauce from TypeScript: compile programs and build their transactions in your own code.
- Test your first program: run a program in your tests, on a local copy of a chain.
- Your first agent session: let a coding agent write and simulate a program.
Each tutorial ends with a link to the next one. After the path, the manual's how-to guides each get one task done, its concepts explain how Sauce works, and its reference lists every chain, protocol, token, command and import. The glossary puts each Sauce word next to one you already know.
When something fails, Troubleshooting says what an error means and what to do. The changelog records what each SDK release changed in SauceScript, the compiler and the engines.
Upgrading an existing project? Move from compiler 2.5 to 2.6
covers signed Int256 values, ABI-only inputs, EVM atomic try/catch, and the engine/Kitchen
pairing. The language reference is the source for exact semantics.
Three words you will see
Sauce borrows its words from a kitchen. Your program is a recipe.
- Pot: your own smart account on chain. It belongs to your wallet, holds the tokens your programs spend, and makes every call they make. Every program needs your authorization.
- Cook: the transaction that runs one program on your Pot. Every step happens, or none does.
- Kitchen: the contract that makes Pots and charges a small flat fee for each cook.
Your Pot's address is known before it exists, but fund it once it is deployed: a Kitchen release
with new Pot code derives another address. sauce run creates it the first time it needs it, and
sauce run --fund creates it, then moves your tokens in, in one go.
Supported chains
Sauce sends transactions on Ethereum, Base, Arc and Solana. Every other chain it
knows is a preview chain: programs compile there and simulate wherever the release is deployed on
the chain, but the sauce command builds and sends no transaction. Chains lists them all, and how to ask for one.
From your application
Install it in a project instead, and the same compiler and registries are a TypeScript library. It runs in Node.js and in a browser.
npm install @eco-incorp/sauceThis compiles a program for Base offline: it approves Aave V3's pool for amount of USDC and
supplies it. Nothing is sent.
import { routes } from "@eco-incorp/sauce";
const program = routes.compileSauceProgram(
"base",
`function main(amount: Uint256) {
USDC.approve(AaveV3.Pool, amount);
AaveV3.Pool.supply(USDC, amount, pot, 0);
}`,
);
// What a Pot cooks: the bytecode, with main's argument appended.
const args = routes.encodeEntryArguments(program, [1_000_000n]);
console.log(`${program.bytecode.length} bytes, plus ${args.length} of arguments`);
console.log(program.entryParams.map((p) => `${p.name}: ${p.type}`).join(", "));USDC and AaveV3 are not imports: the compiler finds them on Base. entryParams is what main
takes, and the bytecode with its encoded arguments is what your Pot runs.
Sauce from TypeScript walks through it, the
API reference lists every import, and the examples
run on every release.
With a coding agent
A coding agent uses Sauce through its MCP server, sauce mcp, a plugin the agent starts on your
machine that gives it Sauce's commands as tools. Add it to your project once:
sauce mcp setupThat writes the server into the configuration file of each coding agent the command knows. The
server installs the few packages it needs the first time it starts; sauce runtime install does
that ahead of time, and is optional.
Your first agent session walks through a session, and
the MCP server covers each agent and the wallets it can keep for one.
sauce skills install copies the package's agent skills, instructions
written for an agent, into your project.
License
Sauce is licensed under the Eco, Inc. Proprietary License 1.1, which is not an open source license. The third-party material in the package, and its licenses, are listed in THIRD_PARTY_NOTICES.md.
