Interactions
Settlement interactions enable CoW Protocol settlements to execute arbitrary smart contract calls at specific execution stages.
Interaction Interface
InteractionLike
A flexible partial type with optional fields:
Execution Stages
PRE Stage
Executes before token transfers. Useful for:
- EIP-2612 permit calls
- Token wrapping (e.g., ETH to WETH)
- Setting up approvals
INTRA Stage
Executes during trading, after sell tokens arrive but before buy tokens are distributed. Default stage if none specified.
POST Stage
Executes after all trading concludes. Used for cleanup:
Helper Functions
normalizeInteraction
Converts an InteractionLike into a complete Interaction with default values:
normalizeInteractions
Handles arrays of interactions:
Integration with SettlementEncoder
The encodeInteraction() method adds interactions to settlements. If no stage is specified, InteractionStage.INTRA is the default.
Common Use Cases
- EIP-2612 permit calls for gasless approvals
- Uniswap/Curve swaps for liquidity sourcing
- WETH wrapping/unwrapping
- Post-settlement fee distributions
Best Practices
- Select appropriate stages based on token balance availability
- Minimize interactions for gas efficiency
- Ensure all calls will succeed (failures cause the entire settlement to revert)
- Be cautious with reentrancy risks
Last modified on March 4, 2026