Operations Reference
Detailed guides for encoding each multicall operation in Solidity.
For TypeScript/SDK implementation, see Multicalls.
Why This Section?
The main multicalls.md covers the fundamentals: MultiCall struct encoding, call order, and the diff pattern. This section goes deeper on each operation - when you need it, complete Solidity examples, and what can go wrong.
Quick Reference
Slippage Control
storeExpectedBalances / compareBalances
Protect swaps from sandwich attacks
Enable/Disable Token
enableToken / disableToken
Explicit collateral management
Page Structure
Each operation guide follows the same structure:
Why - When you need this operation
What - What it does and how it fits the system
How - Working Solidity code
Gotchas - Common mistakes and edge cases
See Also - Related operations and SDK reference
Core Encoding Pattern
All multicall operations use the same encoding pattern:
Call Order Requirements
Some operations have strict ordering rules:
Price updates (
onDemandPriceUpdate) - Must be first in the calls arrayCollateral check params (
setFullCheckParams) - Should be early, affects final checkExternal calls - Can be anywhere after price updates
Slippage checks -
storeExpectedBalancesbefore swaps,compareBalancesafter
Import Patterns
Standard imports for multicall operations:
Related
Multicalls Overview - Fundamentals and the diff pattern
Credit Manager - Underlying execution layer
SDK Multicalls - TypeScript implementation
Last updated
