Prerequisites
- Complete Sauce setup, including access, a Pot and the current Kitchen fee.
- Use Base mainnet (chain ID
8453) and two Uniswap V3 pools for the same token pair. - The caller must hold the input tokens and approve the Pot to spend
amountIn. - Save these three ABI files beside the program: IERC20, IV3SwapRouter, IUniswapV3Pool.
- Supply a minimum acceptable output in the output token’s smallest unit. Review the compiler compatibility limitation before execution.
Program
order-split.sauce.ts
What to notice
throwaborts the program and reverts every leg. There is no partial fill.- The split ratio is computed from
liquidity()read in the same block, not from an off-chain estimate.
Run it
Same as the best-pool swap: compile forevm with the three ABI files beside the source, append seven arguments, execute through your Pot.
