> ## Documentation Index
> Fetch the complete documentation index at: https://docs.eco.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CoW Swap (cowswap)

> DEX aggregator using batch auctions and Coincidence of Wants (CoW) to match overlapping orders.

DEX aggregator using batch auctions and Coincidence of Wants (CoW) to match overlapping orders.

| Fact | Value |
| - | - |
| Category | Aggregators |
| Family | none |
| Namespace | `Cowswap` on ethereum, arbitrum |
| Chains | ethereum, arbitrum |

## What it offers

* **preSignOrder**: Pre-sign an order on-chain for execution by solvers
* **invalidateOrder**: Cancel/invalidate a pending order

## Notes

* Batch auctions match Coincidence of Wants (overlapping orders) first
* Orders are typically signed off-chain and submitted to CoW Protocol API
* setPreSignature is for smart contracts/multisigs that cannot produce ECDSA signatures
* orderUid encodes: order hash + owner address + validTo timestamp
* Same settlement contract on both Ethereum and Arbitrum
* Approve tokens to the GPv2VaultRelayer (not settlement contract) before trading

## Its names in a program

On Ethereum, `Cowswap` is a namespace: its contracts need no import.

```ts theme={null}
function main() {
  // Ethereum's gpv2Settlement, `0x9008D19f58AAbD9eD0D60971565AA8510560ab41`.
  require(Cowswap.GPv2Settlement != 0);
}
```

## Deployments

| Chain | Contract | Address | In a program |
| - | - | - | - |
| [Ethereum](https://docs.eco.com/sauce-sdk/reference/chains/ethereum.md) | gpv2Settlement | `0x9008D19f58AAbD9eD0D60971565AA8510560ab41` | `Cowswap.GPv2Settlement` |
| [Arbitrum One](https://docs.eco.com/sauce-sdk/reference/chains/arbitrum.md) | gpv2Settlement | `0x9008D19f58AAbD9eD0D60971565AA8510560ab41` | `Cowswap.GPv2Settlement` |

## ABI

### `GPv2SettlementABI`

`import GPv2SettlementABI from "./protocols/cowswap/GPv2SettlementABI.json";` Speaks for: gpv2Settlement.

* `setPreSignature(bytes orderUid, bool signed)`
* `invalidateOrder(bytes orderUid)`

## Next steps

* [Protocols](https://docs.eco.com/sauce-sdk/reference/protocols.md): the other protocols, by what they do.
* [Protocols and tokens](https://docs.eco.com/sauce/names.md): calling a contract by its namespace, or through its ABI.
* [Glossary](https://docs.eco.com/sauce/glossary.md): the words these pages use, in plain terms.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.