/cow-amm

An automated market maker running on top of CoW Protocol

Primary LanguageSolidity

CoW AMM

CoW AMM is an automated market maker running on top of CoW Protocol.

Documentation

You can find detailed documentation on the building blocks of this repo in the following files:

  • amm.md: details on what a CoW AMM is and how to set it up.

Research

Details on the theory behind CoW AMM can be found on the paper Arbitrageurs' profits, LVR, and sandwich attacks: batch trading as an AMM design response.

Development

Dev set up

You can install git hooks to help you catch simple mistakes before running some git actions like committing. See the dedicated instructions for how to install the hooks.

Build

$ forge build

Test

$ forge test

Format

$ forge fmt

Deploy

All contracts in this repo can be deployed and verified on the block explorer as follows:

export ETHERSCAN_API_KEY='your API key here'
PK='the private key of the deployer'
ETH_RPC_URL='https://rpc.node.url.here.example.com'
forge script 'script/DeployAllContracts.s.sol:DeployAllContracts' -vvvv --rpc-url "$ETH_RPC_URL" --private-key "$PK" --verify --broadcast

Deployment addresses

The file networks.json lists all official deployments of the contracts in this repository by chain id.

The deployment address file is generated with:

bash dev/generate-networks-file.sh > networks.json