{"id":23396454,"url":"https://github.com/mneedham/pinot-cryptowatch","last_synced_at":"2025-10-10T14:05:59.359Z","repository":{"id":66523832,"uuid":"478569354","full_name":"mneedham/pinot-cryptowatch","owner":"mneedham","description":null,"archived":false,"fork":false,"pushed_at":"2022-04-13T14:25:56.000Z","size":3849,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-11T14:57:01.387Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/mneedham.png","metadata":{"files":{"readme":"README.adoc","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,"zenodo":null}},"created_at":"2022-04-06T13:20:31.000Z","updated_at":"2022-07-27T03:22:42.000Z","dependencies_parsed_at":"2023-03-11T00:01:10.683Z","dependency_job_id":null,"html_url":"https://github.com/mneedham/pinot-cryptowatch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mneedham/pinot-cryptowatch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mneedham%2Fpinot-cryptowatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mneedham%2Fpinot-cryptowatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mneedham%2Fpinot-cryptowatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mneedham%2Fpinot-cryptowatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mneedham","download_url":"https://codeload.github.com/mneedham/pinot-cryptowatch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mneedham%2Fpinot-cryptowatch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279004187,"owners_count":26083688,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"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":[],"created_at":"2024-12-22T07:35:46.857Z","updated_at":"2025-10-10T14:05:59.353Z","avatar_url":"https://github.com/mneedham.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cryptowatch on Pinot\n\nhttps://docs.cryptowat.ch/websocket-api/data-subscriptions/trades\n\n## trades table\n\n[source,bash]\n----\ndocker exec -it pinot-controller-crypto bin/pinot-admin.sh AddTable   \\\n  -tableConfigFile /config/trades_table.json   \\\n  -schemaFile /config/trades_schema.json \\\n  -exec\n----\n\n[source,bash]\n----\ndocker exec -it pinot-controller-crypto bin/pinot-admin.sh AddTable   \\\n  -tableConfigFile /config/trades_offline_table.json   \\\n  -exec\n----\n\n[source,bash]\n----\ndocker exec -it pinot-controller-crypto bin/pinot-admin.sh LaunchDataIngestionJob   \\\n  -jobSpecFile /config/trades-job-spec.yml\n----\n\n## markets table\n\n[source,bash]\n----\ndocker exec -it pinot-controller-crypto bin/pinot-admin.sh AddTable   \\\n  -tableConfigFile /config/markets_table.json   \\\n  -schemaFile /config/markets_schema.json \\\n  -exec\n----\n\n[source, bash]\n----\nexport tableName=\"markets\"\ncurl -X DELETE \"http://localhost:9000/segments/${tableName}?type=OFFLINE\" -H \"accept: application/json\" \u0026\u0026\ndocker exec -it pinot-controller-crypto bin/pinot-admin.sh LaunchDataIngestionJob   \\\n  -jobSpecFile /config/${tableName}-refresh-job-spec.yml\n----\n\n[source,bash]\n----\ndocker exec -it pinot-controller-crypto bin/pinot-admin.sh LaunchDataIngestionJob   \\\n  -jobSpecFile /config/markets-job-spec.yml\n----\n\n## exchanges table\n\n[source,bash]\n----\ndocker exec -it pinot-controller-crypto bin/pinot-admin.sh AddTable   \\\n  -tableConfigFile /config/exchanges_table.json   \\\n  -schemaFile /config/exchanges_schema.json \\\n  -exec\n----\n\n[source,bash]\n----\ndocker exec -it pinot-controller-crypto bin/pinot-admin.sh LaunchDataIngestionJob   \\\n  -jobSpecFile /config/exchanges-job-spec.yml\n----\n\n[source, bash]\n----\nexport tableName=\"exchanges\"\ncurl -X DELETE \"http://localhost:9000/segments/${tableName}?type=OFFLINE\" -H \"accept: application/json\" \u0026\u0026\ndocker exec -it pinot-controller-crypto bin/pinot-admin.sh LaunchDataIngestionJob   \\\n  -jobSpecFile /config/${tableName}-refresh-job-spec.yml\n----\n\n\n## pairs table\n\n[source,bash]\n----\ndocker exec -it pinot-controller-crypto bin/pinot-admin.sh AddTable   \\\n  -tableConfigFile /config/pairs_table.json   \\\n  -schemaFile /config/pairs_schema.json \\\n  -exec\n----\n\n[source,bash]\n----\ndocker exec -it pinot-controller-crypto bin/pinot-admin.sh LaunchDataIngestionJob   \\\n  -jobSpecFile /config/pairs-job-spec.yml\n----\n\n\n[source, bash]\n----\nexport tableName=\"pairs\"\ncurl -X DELETE \"http://localhost:9000/segments/${tableName}?type=OFFLINE\" -H \"accept: application/json\" \u0026\u0026\ndocker exec -it pinot-controller-crypto bin/pinot-admin.sh LaunchDataIngestionJob   \\\n  -jobSpecFile /config/${tableName}-refresh-job-spec.yml\n----\n\n\n[source, bash]\n----\ndocker exec -i kafka-crypto /opt/kafka/bin/kafka-topics.sh \\\n  --bootstrap-server localhost:9092 \\\n  --topic trades \\\n  --create \\\n  --partitions 10\n----\n\n[source, bash]\n----\ndocker exec -i kafka-crypto /opt/kafka/bin/kafka-console-consumer.sh \\\n  --bootstrap-server localhost:9092 \\\n  --topic trades \\\n  --from-beginning \\\n  --max-messages 5\n----\n\n## Ideas\n\n* Calculate the total market capitalisation\n* Candle light chart showing the moving average of prices for a specific currency pair\n* Number of trades per \u003ctime-slot\u003e for each pair\n* Drill down to see what's happening in e.g. Bitcoin\n* What's happening right now vs historical analysis\n* Biggest gainers (in terms of coins/prices)\n\n## Generate schema outline\n\n[source,bash]\n----\ndocker run \\\n  -v ${PWD}/trades.json:/tmp/trades.json \\\n  -v ${PWD}/output:/output \\\n  apachepinot/pinot:0.9.3 JsonToPinotSchema \\\n  -jsonFile /tmp/trades.json \\\n  -pinotSchemaName=\"trades\" \\\n  -outputDir=\"/output\" \\\n  -metrics \"marketUpdate.tradesUpdate.trades.priceStr,marketUpdate.tradesUpdate.trades.amountStr\" \\\n  -timeColumnName marketUpdate.tradesUpdate.trades.timestampNano \\\n  -fieldsToUnnest=marketUpdate.tradesUpdate.trades,marketUpdate.market\n----\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmneedham%2Fpinot-cryptowatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmneedham%2Fpinot-cryptowatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmneedham%2Fpinot-cryptowatch/lists"}