{"id":25015213,"url":"https://github.com/cowprotocol/solver-rewards","last_synced_at":"2026-03-10T10:07:59.291Z","repository":{"id":36953750,"uuid":"476656775","full_name":"cowprotocol/solver-rewards","owner":"cowprotocol","description":"Data Aggregation for Solver Reimbursement \u0026 Rewards Distributor ","archived":false,"fork":false,"pushed_at":"2026-01-20T09:04:25.000Z","size":5487,"stargazers_count":10,"open_issues_count":58,"forks_count":7,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-01-20T18:24:34.531Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cowprotocol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":"COPYRIGHT.md","agents":null,"dco":null,"cla":null}},"created_at":"2022-04-01T09:28:49.000Z","updated_at":"2026-01-20T08:57:22.000Z","dependencies_parsed_at":"2023-01-17T08:16:50.312Z","dependency_job_id":"b8b44a16-6ae9-48e3-bd34-7d5a703dcc2e","html_url":"https://github.com/cowprotocol/solver-rewards","commit_stats":null,"previous_names":[],"tags_count":126,"template":false,"template_full_name":null,"purl":"pkg:github/cowprotocol/solver-rewards","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cowprotocol%2Fsolver-rewards","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cowprotocol%2Fsolver-rewards/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cowprotocol%2Fsolver-rewards/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cowprotocol%2Fsolver-rewards/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cowprotocol","download_url":"https://codeload.github.com/cowprotocol/solver-rewards/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cowprotocol%2Fsolver-rewards/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30329698,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T05:25:20.737Z","status":"ssl_error","status_checked_at":"2026-03-10T05:25:17.430Z","response_time":106,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-05T08:18:21.296Z","updated_at":"2026-03-10T10:07:59.264Z","avatar_url":"https://github.com/cowprotocol.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CoW Protocol: Solver Accounting\n\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n## Installation \u0026 Usage (Quickstart)\n\n```shell\nmake install\ncp .env.sample .env    \u003c----- Copy your Dune and orderbook credentials here!\n```\n\nFill out your Dune credentials in the `.env` file.\n\nGenerate the solver-payouts with for the accounting period 7 days (with today as end date).\n\n```shell\npython -m src.fetch.transfer_file\n```\n\nTo generate order data for the current month to upload to Dune run the following command.\n\n```shell\npython -m src.data_sync.sync_data --sync-table order_data\n```\n\nFor more advanced usage of these scripts see below.\n\n# Summary of Accounting Procedure\n\nIn what follows **Accounting Periods** are defined in intervals of 1 week and accounting\nis performed on the time interval\n\n```\nStartTime \u003c= block_time \u003c EndTime\n```\n\n# Testing \u0026 Contributing\n\n## Testing\n\nTo run the unit tests\n\n```shell\nmake test-unit\n```\n\nTo run the query tests, you must first have a local instance of the database running\n\n```shell\ndocker build -t test_db -f Dockerfile.db .\ndocker run -d --name testDB -p 5432:5432 test_db\npython -m pytest tests/queries/\n```\n\nor just\n\n```shell\nmake test-db\n```\n\nIf you have the local database running you can run the entire suite of tests with\n\n```shell\npython -m pytest tests/\n```\n\nThis project conforms to [Black](https://github.com/psf/black) code style.\nYou can auto format the project with the following command:\n\n```shell\nblack ./\n```\n\nHowever, many IDEs can be configured to auto format on save.\n\n## Advanced Payout Generation\n\nlooking at the script help menu can help provide a list of options!\n\n```shell\n$  python -m src.fetch.transfer_file --help \n\nusage: Fetch Complete Reimbursement [-h] [--start START] [--post-tx] [--dry-run]\n\noptions:\n  -h, --help            show this help message and exit\n  --start START         Accounting Period Start. Defaults to previous Tuesday\n  --post-tx     Flag indicating whether multisend should be posted to safe (requires valid env var `PROPOSER_PK`)\n  --dry-run     Flag indicating whether script should not post alerts or transactions.\n  --ignore-slippage\n                        Ignore slippage computations\n```\n\nThe solver reimbursements are executed each Tuesday with the accounting period of the last 7 days.\nThe default accounting period is 7 days with end date equal to the current date.\nIf the payout script can not be run on Tuesday, one will have to specify the start date to specify the correct\naccounting period.\n\nTo generate the CSV Transfer file manually run the \"quickstart\" variant of the script.\nA more fine-tuned variant of the script execution could look like this:\n\n```shell\npython -m src.fetch.transfer_file --start 2023-03-14 --post-tx True\n```\n\nwhich would run for the accounting period March 14 - 21, 2023, using the Post CIP-20 reward scheme and post the payout\ntransaction directly to the safe (i.e. without generating a CSV file).\n\n## Validating the Payout Transaction\n\nPlease visit this [Notion document](https://www.notion.so/cownation/Solver-Payouts-3dfee64eb3d449ed8157a652cc817a8c).\nIn particular\nsee [Validation by Example](https://www.notion.so/cownation/Solver-Payouts-3dfee64eb3d449ed8157a652cc817a8c?pvs=4#5a99004c03714f939cd80ef41a3d9590)\nsection.\n\n### Additional Notes\n\nAlso, it might happen that the slippage of a solver is bigger than the ETH payout. In this case, please do not proceed\nwith the payout, until the root cause is known. Feel free to reach out the project maintainers to do the investigation.\n\nNote that we must wait some time after the period has ended for some data to finalize (\ne.g. `prices.usd`, `ethereum.transactions` our event data, etc...). Hence, the scripts should not be executed\nimmediately after the accounting period has ended.\n\nAfter generating the transfer file and double-checking the results, please create the multi-send transaction with the\nlink provided in the console.\n\nInform the team of this proposed transaction in the #dev-multisig Slack channel and follow through to ensure execution.\nIt is preferred that the transaction be executed by the proposer account(eth:\n0xd8Ca5FE380b68171155C7069B8df166db28befdd).\n\n## Docker\n\nThis project has a strict requirement of python \u003e= 3.10 which may not be common version for most operating systems.\nIn order to make the reimbursement effort seamless, we have prepared the following docker container.\n\n```shell\n# Prepare environment variables\ncp .env.sample .env  # Fill in your Dune Credentials\n# Run (always ensuring latest version is being used).\ndocker run --pull=always -it --rm \\\n  --env-file .env \\\n  -v $PWD:/app/out \\\n  ghcr.io/cowprotocol/solver-rewards:main \\\n  src.fetch.transfer_file \\\n  --start 'YYYY-MM-DD'\n```\n\nand (usually after about 30 seconds) find the transfer file written to your current working directory.\n\n# Managing Dependencies\nPython libraries can be added to the `requirements.in` file. After this `pip-compile` or `python -m pip-compile` will update the `requirements.txt` for you (you may have to install the libry manually first). \nWarning: this might take a long time for large changes or when you run pip-compile for the first time. Running the command with the `-v` flag can help keep track of what's happening.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcowprotocol%2Fsolver-rewards","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcowprotocol%2Fsolver-rewards","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcowprotocol%2Fsolver-rewards/lists"}