{"id":18596382,"url":"https://github.com/macropower/twitch_predictions_recorder","last_synced_at":"2025-06-26T07:31:46.979Z","repository":{"id":62289098,"uuid":"415420821","full_name":"MacroPower/twitch_predictions_recorder","owner":"MacroPower","description":"Records twitch prediction data for analysis","archived":false,"fork":false,"pushed_at":"2023-05-29T22:21:12.000Z","size":965,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-05T19:04:12.291Z","etag":null,"topics":["twitch"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MacroPower.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"publiccode":null,"codemeta":null}},"created_at":"2021-10-09T21:00:05.000Z","updated_at":"2024-09-10T05:16:05.000Z","dependencies_parsed_at":"2024-06-20T03:00:26.072Z","dependency_job_id":"83559ebe-98ff-481c-9f5c-6b2067f7e84e","html_url":"https://github.com/MacroPower/twitch_predictions_recorder","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/MacroPower/twitch_predictions_recorder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MacroPower%2Ftwitch_predictions_recorder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MacroPower%2Ftwitch_predictions_recorder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MacroPower%2Ftwitch_predictions_recorder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MacroPower%2Ftwitch_predictions_recorder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MacroPower","download_url":"https://codeload.github.com/MacroPower/twitch_predictions_recorder/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MacroPower%2Ftwitch_predictions_recorder/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262022303,"owners_count":23246297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["twitch"],"created_at":"2024-11-07T01:24:06.775Z","updated_at":"2025-06-26T07:31:46.956Z","avatar_url":"https://github.com/MacroPower.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# twitch_predictions_recorder\n\nRecords twitch prediction data for analysis.\n\nYou could use your findings with [Twitch Channel Points Miner][tcpm].\n\n## Installation\n\nYou can download a [release][releases], pull the [docker image][docker-hub], or\nbuild it yourself:\n\n```bash\ngo install github.com/MacroPower/twitch_predictions_recorder/cmd/twitch_predictions_recorder@main\n```\n\n## Usage\n\n```\nUsage: twitch_predictions_recorder\n\nFlags:\n  -h, --help                               Show context-sensitive help.\n      --twitch-client-id=STRING            Twitch Client ID ($TWITCH_CLIENT_ID).\n      --twitch-secret=STRING               Twitch Secret ($TWITCH_SECRET).\n      --streamers-file=\"streamers.txt\"     List of streamers to monitor ($STREAMERS_FILE).\n      --db.type=\"postgres\"                 Database type. One of: [postgres, test] ($DB_TYPE)\n      --db.pg.host=\"info\"                  PG Host ($DB_PG_HOST).\n      --db.pg.port=5432                    PG Port ($DB_PG_PORT).\n      --db.pg.ssl-mode=\"prefer\"            PG SSL Mode ($DB_PG_SSL_MODE).\n      --db.pg.user=STRING                  PG User ($DB_PG_USER).\n      --db.pg.password=STRING              PG Password ($DB_PG_PASSWORD).\n      --db.pg.db-name=\"postgres\"           PG DB Name ($DB_PG_DB_NAME).\n      --db.time-zone=\"America/New_York\"    Time zone name ($DB_TIME_ZONE).\n      --metrics.disable                    Disable metrics ($METRICS_DISABLE).\n      --metrics.path=\"/metrics\"            Path to serve metrics on ($METRICS_PATH).\n      --metrics.address=\":8080\"            Address to serve metrics on ($METRICS_ADDRESS).\n      --metrics.timeout=60s                HTTP timeout ($METRICS_TIMEOUT).\n      --log.level=\"info\"                   Log level ($LOG_LEVEL).\n      --log.format=\"logfmt\"                Log format. One of: [logfmt, json] ($LOG_FORMAT)\n```\n\n### Getting a Client ID \u0026 Secret\n\nGo to [dev.twitch.tv/console][twitch-console] and register a new application.\n\nYou can use a localhost redirect URI.\n\nOnce created, you can see your Client ID and generate a secret.\n\n## Notes on betting\n\n### Automation is not always better\n\nConsider a prediction on the outcome of a competitive game. You notice that\nSurefour is on the enemy team. However, while you know Surefour is one of the\nbest gamers alive and is very likely to win, almost nobody else in chat knows\nwho he is. Thus the chat predicts that the probability of the steamer winning\nis 55%.\n\nIn this case, your strategy may also bet along with the highest probability\noutcome, if you have identified that the chat typically overestimates the\nprobability of the less likely outcome. However, if you were the one placing the\nbet, you know that the probability of winning is actually around 30%. In which\ncase, you would bet against the strategy, given your additional knowledge of the\nsituation.\n\n### Be careful with bet sizing\n\nMake sure to consider whether or not a certain return is possible after making\nyour bet. e.g. if the pool was 5,000 total points, placing a 10,000 point bet\nwould drastically impact the odds you saw when placing the bet.\n\n### Slippage\n\nThere is some slippage due to Twitch rounding all points down when rewarding\npoints. This means that you will need to bet large enough amounts that this is\nminimized. For example, if you only bet 10 points, you can lose a significant\npercentage of your reward to slippage. If you bet a few thousand points however,\nyou will only lose a fraction of a percent of your reward.\n\n### Bet timing\n\nAn additional area of concern is when you place a bet. You will likely place\nbets slightly before the timer has expired, leaving a short time for additional\nusers to place bets which influence the overall odds. If you bet earlier (e.g.\nif the streamer typically closes bets early), this can be troublesome. It is\npossible to account for this by recording how the odds change over time, however\nthis is not yet implemented.\n\n### Edge cases\n\nIf you always bet the same or very similar amounts regardless of outcome\nprobability, you can sometimes run into cases which seem strange.\n\nTwo opposing strategies can both win.\n\n| Bet       | Winner | Loser | Greatest Probability | Least Probability |\n| --------- | ------ | ----- | -------------------- | ----------------- |\n| 1000      | 10%    | 90%   | -1000                | +9000             |\n| 1000      | 55%    | 45%   | +550                 | -1000             |\n| 1000      | 55%    | 45%   | +550                 | -1000             |\n| **TOTAL** | -      | -     | +100                 | +7000             |\n\nThe money is slurped from the relatively large number of users on bet #1,\nbecause you didn't bet less when the risk was greater.\n\nTwo opposing strategies can both lose.\n\n| Bet       | Winner | Loser | Greatest Probability | Least Probability |\n| --------- | ------ | ----- | -------------------- | ----------------- |\n| 1000      | 90%    | 10%   | +100                 | -1000             |\n| 1000      | 90%    | 10%   | +100                 | -1000             |\n| 1000      | 45%    | 55%   | -1000                | +550              |\n| 1000      | 45%    | 55%   | -1000                | +550              |\n| **TOTAL** | -      | -     | -1800                | -900              |\n\n[releases]: https://github.com/MacroPower/twitch_predictions_recorder/releases\n[docker-hub]: https://hub.docker.com/r/macropower/twitch_predictions_recorder\n[twitch-console]: https://dev.twitch.tv/console/apps/create\n[tcpm]: https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacropower%2Ftwitch_predictions_recorder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmacropower%2Ftwitch_predictions_recorder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacropower%2Ftwitch_predictions_recorder/lists"}