Skip to content

kirsanium/cow-solver

 
 

Repository files navigation

Setup Project

Clone this repository

git clone git@github.com:cowprotocol/solver-template-py.git

Install Requirements

  1. Python 3.10 (or probably also 3.9)
  2. Rust v1.60.0 or Docker
python3.10 -m venv venv
source ./venv/bin/activate
pip install -r requirements.txt

Run Solver Server

python -m src._server

This can also be run via docker with

docker run -p 8000:8000 gchr.io/cowprotocol/solver-template-py

or build your own docker image with

docker build -t test-solver-image .

Feed an Auction Instance to the Solver

curl -X POST "http://127.0.0.1:8000/solve" \
  -H  "accept: application/json" \
  -H  "Content-Type: application/json" \
  --data "@data/example.json"

Connect to the orderbook:

Without Docker

Clone the services project with

git clone https://github.com/cowprotocol/services.git
cd services
NODE_URL=<NODE_URL>
cargo run --bin autopilot -- --skip-event-sync true --node-url $NODE_URL --shadow https://barn.api.cow.fi/mainnet --drivers "test|http://localhost:11088/test"
cargo run -p driver -- --config playground/driver.toml --ethrpc $NODE_URL

Place an order

Navigate to barn.cowswap.exchange/ and place a tiny (real) order. See your driver pick it up and include it in the next auction being sent to your solver

References

About

A hollow framework for a CoW Protocol solver

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.5%
  • Other 1.5%