In a Sauce program, swap withProactive Market Maker (PMM) DEX with capital-efficient liquidity provision. Unlike constant product AMMs, DODO uses oracle-guided pricing to concentrate liquidity near market price. Features single-token LP, customizable price curves, and smart routing across DODO pools.@sauce/router’s function for the venue (uniswapV2,uniswapV3,uniswapV4,curve,balancerV2, …; Slipstream, PancakeSwap V3 and Algebra pools throughuniswapV3), with a minimum output and, where the pool takes one, a price limit (the@sauce/routerreference; several pools under one limit, the distributed swap).
What it offers
- swap: Swap tokens via DODO V2 Proxy with pair-based routing
Notes
- PMM (Proactive Market Maker) provides better capital efficiency than constant product by concentrating liquidity near oracle price
dodoPairsis an array of DODO pool addresses defining the swap route (each pool has a base token and a quote token)directionsis a bitmask: for each pool in the path, a bit value of0means “sell base token” and1means “sell quote token”. The least significant bit corresponds to the first pool- For a single-pool swap: if you’re selling the base token of that pool,
directions = 0; if selling the quote token,directions = 1 isIncentive: Flag for DODO mining incentives, typically set tofalse- Pool discovery requires off-chain lookup via DODO’s API or subgraph to find the right pool addresses
- Input token must be ERC20-approved to the V2 Proxy contract
- DODO also supports single-token LP (provide only one side of liquidity)
- From a Pot program,
@sauce/routerswaps at a DODO V2 pool (DVM, DPP or DSP) directly, with no proxy and no approval:dodoV2(pool, tokenIn, tokenOut, amountIn, baseToken, quoteToken, minOut, recipient)transfers the input to the pool and callssellBase(to)whentokenInis the base,sellQuote(to)when it is the quote, returning the amount out. The side cannot come from address order, and the wrong one reverts nothing and donates the input, so the function takes the pool’s_BASE_TOKEN_()and_QUOTE_TOKEN_()and reverts unlesstokenInandtokenOutare those two. The pool books its whole balance as its reserve, so the swap consumes its input or reverts; name aminOut, since a thin pool pays out at most its quote reserve for any input.tryDodoV2, with the same arguments, first reads the pool’s ownquerySellBaseorquerySellQuoteand returns 0, having moved nothing, when the quote is belowminOut(or below 1) or the view reverts; the pool prices that view for the Pot’s fee but charges the transaction’s origin, so where its fee model tells the two apart the swap can deliver less than the quote and revert at the floor. ThedodoV2Swapaction is the same call; legacy V1 pairs are thedodoV1Swapaction’s, through the proxy
Its names in a program
On Ethereum,Dodo is a namespace: its contracts need no import.
Deployments
ABI
DODOV2ProxyABI
import DODOV2ProxyABI from "./protocols/dodo/DODOV2ProxyABI.json"; Speaks for: dodoV2Proxy.
dodoSwapV2TokenToToken(address fromToken, address toToken, uint256 fromTokenAmount, uint256 minReturnAmount, address[] dodoPairs, uint256 directions, bool isIncentive, uint256 deadLine) returns (uint256 returnAmount)
Next steps
- Protocols: the other protocols, by what they do.
- Protocols and tokens: calling a contract by its namespace, or through its ABI.
- Glossary: the words these pages use, in plain terms.
