Archived documentation for
@eco-incorp/sauce@1.0.0. Install this release with npm install --save-exact @eco-incorp/sauce@1.0.0. Links to guides outside this tab open current documentation.DEX (29)
Choosing between them
Inside a Sauce program, swap with@sauce/router’s function for the venue (the @sauce/router reference), every
argument a run-time value, each returning what the recipient received and reverting below its
minOut. uniswapV2 (Uniswap V2 and its forks’ pairs), curve, balancerV2, dodoV2,
traderJoeLB and woofi pay the pool first and call it directly; uniswapV3 (Uniswap V3 and its
forks: PancakeSwap V3, Aerodrome Slipstream, Algebra pools, Synthra, UnitFlow), uniswapV4 and
maverickV2 go through the Pot’s Router, which answers the pool’s callback. Choose by pool type:
- Concentrated liquidity (V3-style pools through
uniswapV3, V4 pools throughuniswapV4): several fee tiers per pair, and a price limit, so a fill can stop part way and leave the rest unspent. - Constant-product pairs (Uniswap V2 and its forks through
uniswapV2, Solidly-style volatile pools): one pool per pair, no price limit; a swap consumes its whole input, bounded only by itsminOut. - Stable pools (Curve through
curve, Solidly-style stable pools): built for assets meant to trade near 1:1, with less price impact there than a constant-product pair. - One trade across several pools under one limit: the distributed swap.
Aggregators (6)
Choosing between them
An aggregator (1inch, ParaSwap, 0x, KyberSwap, OpenOcean) routes through many pools, but its calldata comes from an off-chain quote made for one sender, amount and moment. A program can take that calldata as amain input and pass it through, and must still check the output as a
balance delta against a minimum. CoW Swap settles signed orders in off-chain batch auctions, so
a program signs or cancels an order rather than swapping. When the program itself should choose
the route, use the pools directly (the @sauce/router reference).
Lending (16)
Choosing between them
- One pool, many reserves (Aave V2 and V3 and their forks Spark, Radiant, ZeroLend): supply and borrow any listed reserve against all your collateral in that market.
- One base asset per market (Compound V3, a Comet per base asset): you borrow only that asset, against the market’s listed collaterals.
- Isolated markets (Morpho Blue, Silo): each market pairs one collateral with one loan asset and its own oracle, so one market’s risk does not reach another.
- A token per asset (Compound V2 and its forks Moonwell, Benqi, Venus, LayerBank): supply mints a cToken, and the market’s comptroller decides borrowing power.
- Others: Aave V4 addresses reserves by id on a spoke; Euler V2 is ERC-4626 vaults under one controller; Fluid shares one liquidity layer.
CDPs and stablecoins (10)
Choosing between them
Mint a stablecoin against collateral (Maker and Sky’s DAI and USDS, Liquity’s LUSD and BOLD, crvUSD, GHO, RAI, MIM, Alchemix’s self-repaying alUSD and alETH), or hold a yield-bearing wrapper of one (sDAI, Ethena’s sUSDe). Each sets its own collateral ratio, rate and liquidation rules. The stablecoin itself is an ordinary ERC-20 to transfer.Bridges (18)
Choosing between them
Each bridge has its own trust model and delay. Canonical rollup bridges (Arbitrum, Optimism, Base, Scroll, Linea, zkSync, Polygon) trust only the rollup but take days to withdraw to Ethereum; bridges (Across, Stargate, Hop, Synapse, Celer, Connext, deBridge) settle in minutes and trust their relayers and pools; CCTP burns USDC and Circle mints it on the destination; LI.FI, Socket and Squid route across bridges from an off-chain quote.Cross-chain messaging (6)
Choosing between them
Messaging protocols (LayerZero, Wormhole, Axelar, Chainlink CCIP, Hyperlane) carry arbitrary messages, each with its own set of verifiers and a fee paid at send time in the native coin (anevm.call with value). Circle Gateway keeps one USDC balance spendable across chains.
Liquid staking (7)
Choosing between them
Staking ETH returns a liquid token of one of two kinds. A rebasing balance (stETH) changes on its own, so measure it as a delta at the moment you use it, and hold the wrapped form (wstETH) instead. An exchange-rate token (rETH, cbETH, sfrxETH, ETHx, swETH, mETH) keeps its balance and grows in value. Withdrawals to ETH go through each protocol’s queue.Restaking (5)
Choosing between them
Restaking (EigenLayer, and the liquid restaking tokens of ether.fi, Renzo, Kelp and Puffer) adds the risk of slashing to staking for extra rewards. A liquid restaking token can trade below its underlying, and withdraws through a queue.Staking (1)
Choosing between them
Olympus stakes OHM into its staked forms.Yield and vaults (9)
Choosing between them
- Vaults (Yearn V3, Beefy, Sommelier, Tokemak, Harvest; ERC-4626 where they follow it) take a deposit and return shares whose value grows: measure shares and assets as deltas.
- Yield split (Pendle): PT is the principal, redeemable at a fixed expiry, YT the yield until then.
- Managed liquidity (Gamma, Arrakis) runs concentrated-liquidity positions in vaults.
- Boosted LP (Convex) stakes Curve LP tokens for boosted rewards.
Perpetuals (7)
Choosing between them
Leveraged positions often execute in two steps: the program sends a request, and a keeper executes it later at a price it reads then (GMX’s orders are this way). A program cannot see that fill in its own transaction, so it bounds the request (acceptable price, deadline) instead.Synthetics (1)
Choosing between them
Synthetix V3 takes collateral into an account and mints against it; positions and rewards are per account.Options (5)
Choosing between them
Options protocols (Premia, Hegic, Opyn, Thales, Aevo) settle at expiry or exercise; a program buys, exercises or settles a position it holds.Oracles (2)
Choosing between them
Chainlink feeds are read on chain (latestRoundData): check updatedAt against a staleness
bound and scale by the feed’s decimals. Pyth is pulled: the price is updated in the same
transaction (updatePriceFeeds, paying its fee as value) before it is read.
Payments and streaming (2)
Choosing between them
Sablier locks tokens into a schedule a recipient withdraws from; Superfluid streams Super Tokens per second, so tokens are wrapped into Super Tokens first.NFT marketplaces (1)
Choosing between them
Seaport fills orders that makers signed off chain.Infrastructure and standards (8)
Choosing between them
Standards and services a program calls directly: ERC-20 (Sauce’s token writes are SafeERC20), ERC-4626 vaults, ERC-3156 flash loans, Permit2 (signed transfers and allowances), Safe accounts, ENS, Gelato automation and Instadapp flash-loan routing.Family aliases
A slug ending in-v<N> also joins the family named by the rest: Uniswap covers
UniswapV2, UniswapV3 and UniswapV4. A family names a contract on a chain when exactly one
of its members has one by that name there; any other name, such as one two members share, is
ambiguous, and a program names the versioned namespace instead.
Interfaces
An interface is an ABI with no fixed address, the same on every EVM chain: a program binds it to an address it holds and calls a method in the same expression,Namespace.Contract(address).method(...) (or .at(address)), such as a pool its factory
returned.
Next steps
- Swap by name: a first program that calls a protocol by name.
- Protocols and tokens: calling a contract by its namespace, or through its ABI.
- Names and registries: how a name in a program becomes an address on the chain it is compiled for.
- Glossary: the words these pages use, in plain terms.
