What are CoW Hooks?
Technical specification
Hook Store — Browse and use pre-built hooks
Hooks: Getting Started — Create your first hook step-by-step
Hook dApp - is an application that allows you to conveniently program an order to perform any action before or after a swap.
In the CoW Swap interface you can find several hooks for different tasks. For example, you can claim GNO from Gnosis validators before your swap. You can also specify an arbitrary call to a smart contract before or after your swap using the “Build your own hooks” dApp.
But that’s not all. You can also develop your own application that will install a hook in CoW Swap! For this purpose, there is a custom application based on iframe.
In order to add a custom hook, you need to:
- Click “add Pre/Post-Hook Action”
- Go to “My Custom Hooks” tab
- Paste a URL of the hook dApp

CoW Hooks are still under development! But you can test it by switching “Enable hooks” toggle ON in the Swap settings.
How to develop CoW Hook dApps
CoW Hook dApp is a web application that communicates with CoW Swap using post-messages. For your convenience there is a npm library@cowprotocol/hook-dapp-lib which provides everything necessary to get started with your hook dApp development.
Install
EIP-1193provider to interact with a user walletHookDappContextwhich contains environment parameters (chainId, account, etc.) and current order parameters (sell token, validTo, etc.)
addHookwhen a hook data is ready and can be added to an ordereditHookwhen hook parameters were changed (edit mode)setSellToken / setBuyTokenif you want to change the trade assets
Quick start
Let’s create a simple hook dApp that checks the COW token balance of the order creator.Types specification
HookDappContext
CoWHookDappActions
Manifest
As stated at the beginning of this document, in the CoW Swap interface you can add your application as a custom application. To do this, the application must containmanifest.json file with following structure:
Advanced Hook Dapps
For more complex scenarios — such as post-hooks that need to act on received tokens (staking, bridging, depositing into DeFi protocols) — you need CoW Shed. CoW Shed is a deterministic smart account that holds tokens on behalf of the user and executes pre-signed operations during settlement.- Account Abstraction Guide — How to use CoW Shed for pre-authorized hook calls
- CoW Shed SDK Reference — Complete API reference (
@cowprotocol/sdk-cow-shed) - CoW Shed Source Code — Smart contract source
- Hooks SDK Guide — Using hooks with the Trading SDK, including CoW Shed integration examples

