{"id":25015267,"url":"https://github.com/cowprotocol/dune-alerts","last_synced_at":"2025-04-12T23:13:58.508Z","repository":{"id":49758179,"uuid":"513420578","full_name":"cowprotocol/dune-alerts","owner":"cowprotocol","description":"A general purpose tool for generating Slack Alerts via query results from Dune Analytics","archived":false,"fork":false,"pushed_at":"2024-09-20T09:15:14.000Z","size":81,"stargazers_count":18,"open_issues_count":4,"forks_count":5,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-12T23:13:53.944Z","etag":null,"topics":["alerting","dune-analytics","hacktoberfest","monitoring-tool","slack-api","slack-bot"],"latest_commit_sha":null,"homepage":"","language":"Python","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/cowprotocol.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}},"created_at":"2022-07-13T07:20:56.000Z","updated_at":"2024-11-28T04:17:17.000Z","dependencies_parsed_at":"2023-02-17T06:01:08.429Z","dependency_job_id":null,"html_url":"https://github.com/cowprotocol/dune-alerts","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cowprotocol%2Fdune-alerts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cowprotocol%2Fdune-alerts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cowprotocol%2Fdune-alerts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cowprotocol%2Fdune-alerts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cowprotocol","download_url":"https://codeload.github.com/cowprotocol/dune-alerts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248643006,"owners_count":21138355,"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":["alerting","dune-analytics","hacktoberfest","monitoring-tool","slack-api","slack-bot"],"created_at":"2025-02-05T08:18:35.968Z","updated_at":"2025-04-12T23:13:58.490Z","avatar_url":"https://github.com/cowprotocol.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Query Monitor / Dune Alerts\n\nThis package combines both [DuneAPI](https://pypi.org/project/duneapi/)\nand [SlackClient](https://pypi.org/project/slackclient/) in a way that can send alerts\nin slack based on dune query\nresults.\n\nTo run this monitoring system will require the following steps:\n\n1. An account on [Dune Analytics](https://dune.com) and\n   a [query](https://dune.com/queries/857522) you would like to\n   monitor.\n2. An existing slack bot ([Create a Slack App](https://api.slack.com/apps))\n\nTo run the query monitor (for a single query) you will need to provide Dune credentials\nand Slack app details.\nNamely, the environment variables supplied in the [sample env file](.env.sample).\n\n## Query Monitor from Configuration\n\nQuery Monitor objects are loaded from a yaml configuration file taking the following\nform:\n\n```yaml\nname: Name of your Query\nid: DUNE_QUERY_ID\nwindow: (This is Optional)\n  offset: how far in hours back in time from datetime.now()\n  length: time interval length\nparameters:\n  - key: param1\n    type: number\n    value: 100\n  - key: param2\n    type: text\n    value: example\n```\n\nwhere `DUNE_QUERY_ID` is found in the url of your existing query.\nConcretely, it is the integer at the end of this url https://dune.com/queries/857522.\n\nFor more examples on query parameter configuration, checkout our test\nexamples [./tests/data](./tests/data/)\n\nWith all the configuration in place, then you can run the alerter with\n\n```shell\npython -m src.slackbot --query-config QUERY_CONFIG_PATH\n```\n\nwhere `QUERY_CONFIG_PATH` is a filepath to the yaml file containing your query\nconfiguration.\n\nThis will load the query details, refresh the query with given parameters, fetch the\nresults and send an alert to the\nconfigured Slack channel if warranted.\n\n## Run with Docker\n\nFrom the root of this project, assuming you have a .env file with dune and slack\ncredentials and a query\nconfiguration `config.yaml`\n\n```shell\n# build\ndocker build -t slackbot .\ndocker run -v ${PWD}/config.yaml:/app/config.yaml --env-file .env slackbot --query-config config.yaml\n```\n\n\n```shell\ndocker run \\\n    -v ${PWD}/\u003cCONFIG_FILE\u003e:/app/cfg \\\n     --env-file .env \\\n     ghcr.io/cowprotocol/dune-alerts \\\n     --query-config cfg\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcowprotocol%2Fdune-alerts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcowprotocol%2Fdune-alerts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcowprotocol%2Fdune-alerts/lists"}