CoW Protocol Custom Linking
Query Parameters
The CoW Protocol supports several different interfaces routing orders to it. CoW Swap, is the first interface developed on top of CoW Protocol, and the main protocol interface providing the best UI and UX. Here you will find two interfaces for trading: Swap and Limit orders, such front end supports URL query parameters to allow anyone to create a custom link to that particular front end.
Even though Swap is the main page of the front end, each page can have its own specific URL parameters that can be set, while global parameters are still used on all pages. Keep in mind that if a parameter is used on an incorrect page, this will have no effect on UI settings. Parameters not set with a URL parameter will be set to standard frontend defaults. Global# Parameter Type Description theme String Sets them to dark or light mode. Since you can use Swap or Limit orders, both of them use the same URL format, with which you can specify all the necessary parameters, such as: network id, assets for trading, recipient address, amount to sell or buy. Parameters not set with the URL parameter will be set by default.
URL links format
Swap
https://swap.cow.fi/#/networkId/swap/sellCurrencyId/buyCurrencyId?recipient=0x000...000&sellAmount=5000.205&buyAmount=325.65
Limit orders
https://swap.cow.fi/#/networkId/limit/sellCurrencyId/buyCurrencyId?recipient=0x000...000&sellAmount=5000.205&buyAmount=325.65
Parameters
All parameters are optional. https://swap.cow.fi - CoW Swap URL
Parameter | Type | Default | Description |
---|---|---|---|
| Number |
| Each network has a unique identifier, represented as an integer. Currently CoW Swap supports these networks: Ethereum Mainnet (networkId: |
| Currency address or symbol | Wrapped native currency symbol for the current network (for Mainnet: | Currency to sell. An address or a symbol can be specified. For example: |
| Currency address or symbol | Currency to buy. An address or a symbol can be specified. For example: | |
| Address | Valid Ethereum account address. | |
| Integer or Float | Amount of currency to be sold. For example: | |
| Integer or Float | Amount of currency to buy. For example: |
Wrapped native currency
Each network has a native currency and it's wrapped version. Native currency is needed to pay transaction fees. Native and wrapped currencies per network: - Ethereum Mainnet: WETH - wrapped ETH - Gnosis chain: WXDAI - wrapped XDAI - Görli: WETH - wrapped ETH
Example Usage
https://swap.cow.fi - CoW Swap main page (Swap is default)
https://swap.cow.fi/#/swap - Swap page
https://swap.cow.fi/#/limit - Limit orders page
https://swap.cow.fi/#/5/swap - Swap page on Görli network
https://swap.cow.fi/#/100/limit - Limit orders page on Gnosis chain network
https://swap.cow.fi/#/1/swap/COW/WETH - Swap
COW
toWETH
https://swap.cow.fi/#/100/limit/WXDAI/COW - Create a limit order to sell
WXDAI
forCOW
https://swap.cow.fi/#/1/swap/COW/WETH?sellAmount=100 - Swap
100 COW
forWETH
(by current market price)https://swap.cow.fi/#/100/limit/WETH/WXDAI?sellAmount=2&buyAmount=6000 - Create a limit order to sell
2 WETH
for6000 WXDAI
Last updated