{"id":20002091,"url":"https://github.com/pooltogether/v4-draw-results","last_synced_at":"2026-03-19T13:02:29.220Z","repository":{"id":37366962,"uuid":"427533007","full_name":"pooltogether/v4-draw-results","owner":"pooltogether","description":"Periodically runs the draw-calculator-cli and stores the results. Also the data source of the Netlify hosted Prizes API.","archived":false,"fork":false,"pushed_at":"2024-06-03T20:05:53.000Z","size":46266,"stargazers_count":6,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-25T04:03:30.943Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pooltogether.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2021-11-13T00:37:02.000Z","updated_at":"2024-06-03T20:05:57.000Z","dependencies_parsed_at":"2023-12-29T22:25:02.195Z","dependency_job_id":"3416afb6-3940-4a2f-b53d-7d9d40bd0225","html_url":"https://github.com/pooltogether/v4-draw-results","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pooltogether/v4-draw-results","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fv4-draw-results","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fv4-draw-results/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fv4-draw-results/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fv4-draw-results/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pooltogether","download_url":"https://codeload.github.com/pooltogether/v4-draw-results/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fv4-draw-results/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30171869,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T07:56:45.623Z","status":"ssl_error","status_checked_at":"2026-03-06T07:55:55.621Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":"2024-11-13T05:19:43.827Z","updated_at":"2026-03-06T10:31:46.868Z","avatar_url":"https://github.com/pooltogether.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/pooltogether/pooltogether--brand-assets\"\u003e\n    \u003cimg src=\"https://github.com/pooltogether/pooltogether--brand-assets/blob/977e03604c49c63314450b5d432fe57d34747c66/logo/pooltogether-logo--purple-gradient.png?raw=true\" alt=\"PoolTogether Brand\" style=\"max-width:100%;\" width=\"400\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cbr /\u003e\n\n# V4 Draw Results\n\n![Draw Calculator CLI](https://github.com/pooltogether/v4-draw-results/actions/workflows/cron.yml/badge.svg)\n![Unit Tests](https://github.com/pooltogether/v4-draw-results/actions/workflows/unit_test.yaml/badge.svg)\n\n[![Netlify Status](https://api.netlify.com/api/v1/badges/27b08c1f-abf1-4e39-ba86-60bd8584302d/deploy-status)](https://app.netlify.com/sites/eager-fermat-3a8c47/deploys)\n\n## Description\n\nThis repository serves as a layer above the [v4-cli](https://github.com/pooltogether/v4-cli) and stores the result of drawPrize compute command execution.\n\nThe CLI is instantiated periodically from the [cron workflow](./.github/workflows/cron.yml). This workflow checks if the most recent `drawId` for a network is greater than the last committed `drawId`, and if so, runs the [v4-cli](https://github.com/pooltogether/v4-cli).\n\nThis data serves as the data source for the hosted [Netlify API](https://api.pooltogether.com/prizes/137/0x8141bcfbcee654c5de17c4e2b2af26b67f9b9056/draw/12/prizes.json). More information on how to use this API can be found [here](https://dev.pooltogether.com/protocol/api/prize-api).\n\n## Adding a new Prize Pool\n\n1. Add a workflow step to commit prize files if they were created. For example:\n\n```yaml\n- name: Commit files for [newPrizePool]\n  if: steps.runDrawCalcCLI.outputs.[newPrizePool]CliToolRan == 'true'\n  run: |\n    git config --local user.email \"41898282+github-actions[bot]@users.noreply.github.com\"\n    git config --local user.name \"github-actions[bot]\"\n    git pull\n    git add ./api/prizes/[newPrizePoolChainId]/\n    git commit -m \"Add draw for [newPrizePool] draw ${{steps.runDrawCalcCLI.outputs.[newPrizePool]DrawId}}\"\n```\n\n## Data Structure\n\nThe generated file structure is:\n\n```\nv4-draw-results\n│   README.md\n│   package.json\n│   ...\n└───api\n    └───prizes\n        └───1 (chainId for mainnet)\n            │    └─── 0xb9a179dca5a7bf5f8b9e088437b3a85ebb495efe (Prize Distributor address)\n            │           └─── draw\n            │                └─── 1\n            │                     │   0xa123..json\n            │                     │   0xa124..json\n            │                     │   ...\n            │                     │   prizes.json\n            │                     │   status.json\n            |\n            │                └─── 2\n            │               ...\n        └───137 (chainId for polygon)\n            └─── 0x8141bcfbcee654c5de17c4e2b2af26b67f9b9056 (Prize Distributor address)\n            │           └─── draw\n            │                └─── 1\n            │                     │    0xa123..json\n            │                     │    0xa124..json\n            │                     │    ...\n            │                     │    prizes.json\n            │                     │    status.json\n            |\n            │                └─── 2\n            │           ...\n        └───43114 (chainId for avalanche)\n            └─── 0x83332f908f403ce795d90f677ce3f382fe73f3d1 (Prize Distributor address)\n            │           └─── draw\n            │                └─── 67\n            │                     │    0xa123..json\n            │                     │    0xa124..json\n            │                     │    ...\n            │                     │    prizes.json\n            │                     │    status.json\n            |\n            │                └─── 68\n            │           ...\n\n\n```\n\n| File         | Description                                          |\n| ------------ | ---------------------------------------------------- |\n| 0xa123..json | Data for a winning address for a draw                |\n| prizes.json  | Index file including all winners for draw            |\n| status.json  | Metadata about the CLI run (status and time elapsed) |\n\nWhere `prizes.json` is an index of all the individual address files and `status.json` includes .\n\nThe file structure is according to Prize Distributor address (not by Ticket) is because a Ticket can mave multiple associated Prize Distributors.\n**NOTE** : The use of lower case strings for addresses.\n\n### Examples\n\nFor example:\n\n1. `./api/prizes/1/0xb9a179dca5a7bf5f8b9e088437b3a85ebb495efe/draw/1/prizes.json`\n   will display all prizes for chainId = 1 (Ethereum Mainnet) for Prize Distributor (address: `0xb9a179dca5a7bf5f8b9e088437b3a85ebb495efe`) for draw 1.\n\n   This is also viewable at the [Netlify API](https://api.pooltogether.com/prizes/1/0xb9a179dca5a7bf5f8b9e088437b3a85ebb495efe/draw/1/prizes.json).\n\n1. `./api/prizes/137/0x8141bcfbcee654c5de17c4e2b2af26b67f9b9056/draw/12/prizes.json`\n   will display all prizes for chainId = 137 (Polygon/Matic) for Prize Distributor (address: `0x8141bcfbcee654c5de17c4e2b2af26b67f9b9056`) for draw 12.\n\n   This is also viewable at the [Netlify API](https://api.pooltogether.com/prizes/137/0x8141bcfbcee654c5de17c4e2b2af26b67f9b9056/draw/12/prizes.json).\n\n1. `./api/prizes/43114/0x83332f908f403ce795d90f677ce3f382fe73f3d1/draw/70/prizes.json`\n   will display all prizes for chainId = 43114 (Avalanche) for Prize Distributor (address: `0x83332f908f403ce795d90f677ce3f382fe73f3d1`) for draw 70.\n\n   This is also viewable at the [Netlify API](https://api.pooltogether.com/prizes/43114/0x83332f908f403ce795d90f677ce3f382fe73f3d1/draw/70/prizes.json).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpooltogether%2Fv4-draw-results","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpooltogether%2Fv4-draw-results","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpooltogether%2Fv4-draw-results/lists"}