Skip to main content

Composable Conditional Orders

Build advanced trading strategies on CoW Protocol with programmable conditional orders. Execute TWAP, stop-loss, and custom order types across 10+ EVM networks.

Quick start

Create your first conditional order in minutes

1

Set up your Safe wallet

Configure your Safe wallet with the ExtensibleFallbackHandler to enable conditional orders.
// Set the fallback handler to ExtensibleFallbackHandler
safe.setFallbackHandler(0x2f55e8b20D0B9FEFA187AA7d00B6Cbe563605bF5);

// Set the domain verifier to ComposableCoW
safe.setDomainVerifier(
  GPv2Settlement.domainSeparator(),
  0xfdaFc9d1902f4e0b84f65F49f244b32b31013b74
);
2

Create a conditional order

Define your order parameters and create the conditional order through ComposableCoW.
IConditionalOrder.ConditionalOrderParams memory params = 
  IConditionalOrder.ConditionalOrderParams({
    handler: TWAPAddress,
    salt: keccak256("my-unique-salt"),
    staticInput: abi.encode(twapData)
  });

composableCow.create(params, true);
3

Monitor and manage

Your order is now live. Watch towers will monitor the conditions and submit orders to CoW Protocol when valid.
Orders can be cancelled at any time by calling composableCow.remove(H(params)) from your Safe.

Explore order types

Choose from pre-built order types or create your own

TWAP

Execute time-weighted average price orders over custom intervals

Stop Loss

Protect positions with oracle-based stop-loss orders

Good After Time

Schedule orders to activate at specific times

Perpetual Stable Swap

Maintain stablecoin positions automatically

Trade Above Threshold

Execute trades when token balances exceed thresholds

Custom Orders

Build your own conditional order logic

Developer resources

Everything you need to build with ComposableCoW

API Reference

Complete contract interface documentation

GitHub Repository

View source code and examples

Architecture Guide

Understand the system design

Testing & Deployment

Test and deploy your own instance

Ready to get started?

Create your first conditional order in minutes with our quickstart guide

Get Started