{"id":20030804,"url":"https://github.com/generationsoftware/pt-v5-cli","last_synced_at":"2026-06-10T17:31:07.980Z","repository":{"id":178765161,"uuid":"662336451","full_name":"GenerationSoftware/pt-v5-cli","owner":"GenerationSoftware","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-25T20:24:39.000Z","size":735,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-05T12:02:45.136Z","etag":null,"topics":["pooltogether"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GenerationSoftware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2023-07-04T23:04:53.000Z","updated_at":"2025-08-09T23:04:07.000Z","dependencies_parsed_at":"2024-03-13T00:31:47.472Z","dependency_job_id":"19657550-ede2-4634-b419-6cd83964b293","html_url":"https://github.com/GenerationSoftware/pt-v5-cli","commit_stats":null,"previous_names":["generationsoftware/pt-v5-cli"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/GenerationSoftware/pt-v5-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GenerationSoftware%2Fpt-v5-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GenerationSoftware%2Fpt-v5-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GenerationSoftware%2Fpt-v5-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GenerationSoftware%2Fpt-v5-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GenerationSoftware","download_url":"https://codeload.github.com/GenerationSoftware/pt-v5-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GenerationSoftware%2Fpt-v5-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34163253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["pooltogether"],"created_at":"2024-11-13T09:28:24.235Z","updated_at":"2026-06-10T17:31:07.955Z","avatar_url":"https://github.com/GenerationSoftware.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/GenerationSoftware/pt-v5-utils-js/main/img/pooltogether-logo--purple@2x.png?raw=true\" alt=\"PoolTogether Brand\" style=\"max-width:100%;\" width=\"300\"\u003e\n\u003c/p\u003e\n\n\u003cbr /\u003e\n\n# 🖥️ PoolTogether V5\n\n### CLI\n\nThe `@generationsoftware/pt-v5-cli` [node module package](https://www.npmjs.com/package/@generationsoftware/pt-v5-cli) is a Node command line interface (CLI) to interact with the **PoolTogether V5 protocol**. The CLI uses the `pt-v5-utils-js` package to fetch and run calculations/computations for essential PoolTogether V5 tasks.\n\nPrimary CLI Commands (help)\n\n```sh\nnpx @generationsoftware/pt-v5-cli help utils compileWinners\n```\n\n### Setup\n\nSet up your environment variables using `dotenv`:\n\n#### ENV\n\nCopy `.envrc.example` and input the env vars needed to run this project:\n\n```sh\ncp .envrc.example .envrc\n```\n\nOnce your env variables are setup, load them with:\n\n```sh\ndirenv allow\n```\n\n#### LIST OF ENVIRONMENT VARIABLES\n\n```sh\nJSON_RPC_URL: Your Infura/Alchemy/etc JSON RPC URI\n\n# OPTIONAL:\n\nDEBUG: if set to true will print more debug information when calculating winners\nPRIZE_TIERS_TO_COMPUTE: optional CSV list of prize tiers to compute - example: '0,2,3,5'\n```\n\n# ⌨️ CLI Installation\n\n\u003c!-- usage --\u003e\n\n```sh-session\n$ npm install -g @generationsoftware/pt-v5-cli\n$ ptv5 COMMAND\nrunning command...\n$ ptv5 (--version)\n@generationsoftware/pt-v5-cli/1.1.1 darwin-arm64 node-v18.17.0\n$ ptv5 --help [COMMAND]\nUSAGE\n  $ ptv5 COMMAND\n...\n```\n\n\u003c!-- usagestop --\u003e\n\n# Commands\n\n## Compile Winners\n\n```sh-session\nptv5 utils compileWinners\n```\n\nFinds draw's depositors with a non-zero balance for a PrizePool, then computes who won and outputs all this data to a target output directory.\n\nPass the `chainId`, `prizePool`, `outDir`, `contractJsonUrl` and `subgraphUrl` to compute and locally save the results.\n\n```\nUSAGE\n  $ ptv5 utils compileWinners --chainId 1 --outDir ./winners --prizePool '0xdd4d117723C257CEe402285D3aCF218E9A8236E1' --contractJsonUrl 'https://raw.githubusercontent.com/GenerationSoftware/pt-v5-testnet/.../contracts.json' --subgraphUrl 'https://api.studio.thegraph.com/query/...'\n\nDESCRIPTION\n  Finds draw's depositors with a non-zero balance for a PrizePool, then computes who won and outputs all this data to a target output directory.\n\nEXAMPLES\n  $ ptv5 utils compileWinners --chainId 1 --prizePool 0x0000000000000000000000000000000000000000 --outDir ./winners --contractJsonUrl 'https://raw.githubusercontent.com/GenerationSoftware/pt-v5-testnet/.../contracts.json' --subgraphUrl 'https://api.studio.thegraph.com/query/...'\n    Running utils:compileWinners on chainId: 1\n```\n\n## Vaults Files ([vaultAddress].json)\n\n```json\n{\n  \"chainId\": 10,\n  \"prizePoolAddress\": \"0xe32e5E1c5f0c80bD26Def2d0EA5008C107000d6A\",\n  \"vaultAddress\": \"0xf0B19f02c63d51B69563A2b675e0160e1C34397C\",\n  \"userAddresses\": [\n    \"0x07967251f6db5f9d095119379bd8fc4fce60b3e1\",\n    \"0x084039db4e3c6775eabfc59cbd3725d3d9a6d752\"\n    // ...\n  ],\n  \"winners\": [\n    {\n      \"user\": \"0xBBBBBBBBBBBB0af42Df6C28e5cd79458C102f6\",\n      \"prizes\": {\n        \"3\": [3, 7, 30],\n        \"4\": [11, 55]\n      }\n    }\n    // ...\n  ]\n}\n```\n\n## Status File (status.json)\n\n```json\n{\n  \"status\": \"LOADING\",\n  \"createdAt\": \"11\"\n}\n```\n\n### Success\n\n```json\n{\n  \"status\": \"SUCCESS\",\n  \"createdAt\": 1693423691768,\n  \"updatedAt\": 1693423805132,\n  \"runtime\": 114,\n  \"meta\": {\n    \"numVaults\": 7,\n    \"numTiers\": 3,\n    \"numPrizeIndices\": 21,\n    \"numAccounts\": 3830\n  }\n}\n```\n\n### Failure\n\n```json\n{\n  \"status\": \"FAILURE\",\n  \"createdAt\": \"11\",\n  \"updatedAt\": \"33\",\n  \"runtime\": \"22\",\n  \"error\": \"ErrorCode\"\n}\n```\n\n## Help\n\n```sh-session\nptv5 help [COMMAND]\n```\n\nDisplay help for ptv5.\n\n```\nUSAGE\n  $ ptv5 help [COMMAND] [-n]\n\nARGUMENTS\n  COMMAND  Command to show help for.\n\nFLAGS\n  -n, --nested-commands  Include all nested commands in the output.\n\nDESCRIPTION\n  Display help for ptv5.\n```\n\n## Development\n\n### Using the tool in dev\n\nYou can test the CLI while developing by using the following, with whichever chain \u0026 prizePool flags you want to test with:\n\n```\n./bin/dev.js utils compileWinners --chainId 1 --outDir ./winners --prizePool '0xdd4d117723C257CEe402285D3aCF218E9A8236E1' --contractJsonUrl 'https://raw.githubusercontent.com/GenerationSoftware/pt-v5-testnet/.../contracts.json' --subgraphUrl 'https://api.studio.thegraph.com/query/...'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgenerationsoftware%2Fpt-v5-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgenerationsoftware%2Fpt-v5-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgenerationsoftware%2Fpt-v5-cli/lists"}