Custom Links
CoW Swap supports URL query parameters to allow anyone to create a custom link for sharing a specific trade with a friend or on social media, or for creating a custom link to a specific trade for your own use.
Examples
- https://swap.cow.fi- CoW Swap main page (- swapis default page)
- https://swap.cow.fi/#/swap-- swappage
- https://swap.cow.fi/#/limit-- limitorders page
- https://swap.cow.fi/#/100/swap-- swappage on Gnosis chain network
- https://swap.cow.fi/#/100/limit/WXDAI/COW- Create a- limitorder to sell- WXDAIfor- COW
- https://swap.cow.fi/#/1/swap/WETH/COW?sellAmount=100- Swap- 100 WETHfor- COW
- https://swap.cow.fi/#/1/swap/WETH/COW?buyAmount=10000&recipient=vitalik.eth- Buy on- swapsending the outcome to a custom recipient (can be either address or ens)
- https://swap.cow.fi/#/100/limit/WETH/WXDAI?sellAmount=2&buyAmount=6000- Create a limit order to sell- 2 WETHfor- 6000 WXDAI
Query Parameters
Even though the main page is swap, each page has it's own specific URL parameters that can be set, in addition to global parameters that are used on all pages. Parameters not applicable to a page will have no effect on UI settings.
Fortunately, the swap and limit pages have the same URL query parameters!
URL links format
Swap
https://swap.cow.fi/#/<chainId>/swap/<sellTokenSymbolOrAddress>/<buyTokenSymbolOrAddress>?recipient=<recipient>&sellAmount=<sellAmount>&buyAmount=<buyAmount>
Limit
https://swap.cow.fi/#/<chainId>/limit/<sellTokenSymbolOrAddress>/<buyTokenSymbolOrAddress>?recipient=<recipient>&sellAmount=<sellAmount>&buyAmount=<buyAmount>
Global parameters
| Parameter | Type | Default | Description | 
|---|---|---|---|
| theme | String | (determined by browser) | Sets theme to darkorlightmode. | 
Swap / limit parameters
All parameters are optional. If a parameter is not set, the default value will be used.
| Parameter | Type | Default | Description | 
|---|---|---|---|
| chainId | Integer | 1- Ethereum Mainnet | Supported blockchains | 
| sellTokenSymbolOrAddress | Token symboloraddress | Wrapped native token symbol for the current network (for Mainnet: WETH) | Sell token symboloraddress | 
| buyTokenSymbolOrAddress | Token symboloraddress | Buy token symboloraddress | |
| recipient | address | undefined | Valid Ethereum account address | 
| sellAmount | Integer or Float | undefined | Amount of sell token to sell | 
| buyAmount | Integer or Float | undefined | Amount of buy token to buy | 
Only one of sellAmount or buyAmount can be set for the swap page. If both are set, only sellAmount will be used.