Build on top of CoW Protocol
This document provides some quick start information for integrating to CoW Protocol. You will find an introduction to the protocol, its tools, resources, and documentation, along with some convenient
CoW Swap is a Decentralized Application (DApp) and Protocol allowing users to exchange digital assets directly (peer-to-peer) and via existing trading decentralized exchanges.
Its novel design maximizes trade efficiency and provides a competitive way to ensure best prices.
One of the core ideas is executing trades in batches, where users will trade directly using what is known as “Coincidence of Wants” (hence the name CoW). In the context of blockchains, batch auctions are a superior mechanism compared to continuous time trading, as they already execute transactions in discrete “blocks” every few seconds.
In consequence CoW Swap protects users from front-running and other value extraction (known as MEV). The mechanism also leverages the concept of “ring trades” to boost liquidity in highly fragmented and long-tail token markets.
Additionally, CoW Swap allows for an improved user experience by facilitating gasless trades, not paying for failed transactions and adaptive routing in case of volatility.
CoW Swap uses CoW protocol. One easy way to get familiar with the protocol is by doing one trade in CowSwap:
You can use it in the Görli test net if you want. Otherwise, it is available in Mainnet and Gnosis Chain.
Trading in CoW Swap is done by signing off-chain transactions using your web3 wallet and posting them to an API.
You will need to:
- 5.Get a price/fee quote from the API: Fees are only paid if the trade is executed (you don’t pay for failed transactions). So this fee covers the settlement of the transaction on-chain. Learn more here
Orders are identified by an unique identifier (UID).
This UID is a deterministic hash derived from the order information. It is returned by the API when you post a new order (it can also be calculated locally deriving it from the order data).
This UID would allow you to get information about the status of the order. You can do this in two different ways:
It’s worth mentioning that, if you build a tool or UI that creates trades, it’s very convenient to provide the user a way to see the details of the trade that was just created. One simple way to do this, is by creating a link to the explorer:
The explorer is a website that allows you to explore the protocol data.
It’s the “Etherscan” for CoW protocol, so you will be able to find, among other things:
- Order details, with trading status: You can get detailed information about executed, expired, or pending orders. This page is very convenient for directing users once they post an order (example order)
The protocol requires valid signed orders. There’s different ways in which someone could sign an order:
Start here your journey to learn about CoW Protocol
The API allows you to get direct access to the CoW protocol.
The documentation is exposed using Swagger docs:
The API is available in 3 different Networks: Mainnet, Gnosis Chain and Görli testnet.
CoW Protocol graph provides an alternative way to consume protocol information.
There’s currently open positions for CoW Protocol.