Skip to content
DeFiCoWIntentsHooksCoW SwapTrading

CoW Protocol Upgrades the Language of Intent: The Dawn of CoW Hooks

Decentralized exchange CoW enhances its trading experience with CoW Hooks. Users are now empowered to add tailor-made DeFi actions that are carried out immediately before or after their trades.

In recent times, the crypto field has been deeply engaged in debates over Ethereum’s “intent” messages and the new prospects this breakthrough offers.

💡
Paradigm's post explains the conceptual difference between a transaction and an intent: If a transaction explicitly refers to “how” an action should be performed, an intent refers to “what” the desired outcome of that action should be. If a transaction says “Do A then B, pay exactly C to get X back”, an intent says “I want X and I’m willing to pay up to C”.

Up until now, the only production-ready intent-based system that has been operational on Ethereum is reportedly CoW Swap.

💡
Coincidence of Wants (CoW) is an innovative three-sided trading protocol. Instead of using a central operator or an automated market maker (AMM) to determine trade settlements, CoW Protocol introduced solvers, parties that compete to provide the best settlement solution to the traders on the platform. CoW Swap is a decentralized exchange working on CoW Protocol.

CoW Swap has effectively developed a working intent-based trading model. Because of its three-sided design, CoW Swap requires traders to validate the trade target (intent) instead of performing it directly on-chain. Users then delegate their trade execution to the 'third side', the solver network, which finishes the transaction for them by combining it with other orders in the batch and adjusting the trading path at the moment of execution.

CoW Hooks

This week CoW Swap announced the unveiling of a revamped intent system that facilitates the composability of a vast array of actions before and after a swap. They're called CoW Hooks. CoW Hooks’ standout feature is that it executes your entire plan as a single operation. And, as per the CoW Protocol's tradition, you are charged gas fees in your sell token only when your transaction is successful.

CoW Hooks are discretionary Ethereum “calls” that connect to a trading order and execute before and/or after the order. Developers and proficient traders can utilize code to express an intent that carries out some action before a swap (pre-hooks) and after a swap (post-hooks).

Pre-hooks can "set up" conditions for an order. For instance, when executing the code required for validating an on-chain signature or establishing the necessary approvals.

Post-hooks operate after a swap has occurred and the recipient address has received the funds. Post-hooks offer a chance to immediately utilize the funds, such as through staking, liquidity providing, bridging tokens to L2s, and much more.

With the introduction of CoW Hooks, users can now establish a sequence of actions in a coherent manner. This sequence begins with setting up pre-hooks, moves on to defining the swap intent, and then culminates in setting up a series of post-hooks.

The whole process of creating CoW Hooks opens up a universe of opportunities.

An excellent example of the application of CoW Hooks would be when receiving, swapping, and bridging tokens on a different chain address. Or you could use CoW Hooks to repay a debt, close your position, swap assets for a yield-generating token and even stake your tokens — all in one go.

Besides trading, CoW Hooks can be used to automate staking. If you're an Ethereum validator looking to claim your rewards, you'd normally have to unstake your 32 ETH to carry out any action. CoW Hooks could be set up to automate the unstaking and restaking processes, making it far more convenient for validators to manage their rewards.

Hooks seem to mark the next trend in enhancing DeFi's composability and UX. Last month Uniswap announced adding hooks in its Uniswap v4 release. We are hooked on Observing the latest developments too.

Comments

Latest