{"id":19044239,"url":"https://github.com/arturogonzalezm/hftcryptodashboard","last_synced_at":"2026-04-20T13:07:14.482Z","repository":{"id":251148550,"uuid":"836529965","full_name":"arturogonzalezm/HFTCryptoDashboard","owner":"arturogonzalezm","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-02T01:25:03.000Z","size":26,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-06T11:43:20.339Z","etag":null,"topics":["binance-api","docker","docker-compose","go","golang","hft","hft-data","hft-trading","time-series","timescaledb","websocket"],"latest_commit_sha":null,"homepage":"","language":"Go","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/arturogonzalezm.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,"publiccode":null,"codemeta":null}},"created_at":"2024-08-01T03:39:31.000Z","updated_at":"2024-11-13T15:22:03.000Z","dependencies_parsed_at":"2025-01-02T08:14:42.468Z","dependency_job_id":"6d7beb81-2c4a-48e8-b564-6caed35897cb","html_url":"https://github.com/arturogonzalezm/HFTCryptoDashboard","commit_stats":null,"previous_names":["arturogonzalezm/hftcryptodashboard"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/arturogonzalezm/HFTCryptoDashboard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arturogonzalezm%2FHFTCryptoDashboard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arturogonzalezm%2FHFTCryptoDashboard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arturogonzalezm%2FHFTCryptoDashboard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arturogonzalezm%2FHFTCryptoDashboard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arturogonzalezm","download_url":"https://codeload.github.com/arturogonzalezm/HFTCryptoDashboard/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arturogonzalezm%2FHFTCryptoDashboard/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32048474,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"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":["binance-api","docker","docker-compose","go","golang","hft","hft-data","hft-trading","time-series","timescaledb","websocket"],"created_at":"2024-11-08T22:45:16.500Z","updated_at":"2026-04-20T13:07:14.464Z","avatar_url":"https://github.com/arturogonzalezm.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HFTCryptoDashboard\n\nHFTCryptoDashboard is a Go-based application for real-time cryptocurrency data streaming and analysis, focusing on high-frequency trading (HFT) scenarios.\n\n## Project Structure\n\nThe project is organised into several key components:\n\n1. `main.go`: The entry point of the application.\n2. `config.yaml`: Configuration file for specifying cryptocurrency symbols.\n3. `config.go`: Handles loading and parsing of the configuration.\n4. `signal.go`: Manages graceful shutdown of the application.\n5. `client.go`: Implements the WebSocket client for connecting to the Binance API.\n6. `util.go`: Provides utility functions for logging, error handling, and other common tasks.\n\n## Application Flow\n\n### Flowchart\n\n```mermaid\ngraph TD\n    A[Start] --\u003e B[Load Config]\n    B --\u003e C{Config Loaded?}\n    C --\u003e|Yes| D[Initialise WebSocket Client]\n    C --\u003e|No| E[Exit with Error]\n    D --\u003e F{Client Initialised?}\n    F --\u003e|Yes| G[Start Message Reading]\n    F --\u003e|No| E\n    G --\u003e H[Wait for Interrupt]\n    H --\u003e I[Graceful Shutdown]\n    I --\u003e J[End]\n```\n\n### Sequence Diagram\n\n```mermaid\nsequenceDiagram\n    participant Main\n    participant Config\n    participant WebSocketClient\n    participant BinanceAPI\n    participant Util\n\n    Main-\u003e\u003eConfig: LoadConfig()\n    Config--\u003e\u003eMain: Return Config\n    Main-\u003e\u003eWebSocketClient: GetWebSocketClient(config)\n    WebSocketClient-\u003e\u003eBinanceAPI: Connect and Subscribe\n    BinanceAPI--\u003e\u003eWebSocketClient: Connection Established\n    WebSocketClient--\u003e\u003eMain: Return Client\n    Main-\u003e\u003eWebSocketClient: ReadMessages(done)\n    loop Message Reading\n        BinanceAPI-\u003e\u003eWebSocketClient: Send Message\n        WebSocketClient-\u003e\u003eWebSocketClient: Process Message\n        WebSocketClient-\u003e\u003eUtil: Log Message (LogInfo)\n    end\n    Main-\u003e\u003eWebSocketClient: CloseConnection()\n    WebSocketClient-\u003e\u003eBinanceAPI: Close WebSocket\n    Main-\u003e\u003eUtil: Log Shutdown (LogInfo)\n```\n\n## Key Components\n\n1. **Config**: Loads and parses the `config.yaml` file, which contains the list of cryptocurrency symbols to monitor.\n\n2. **WebSocketClient**: Manages the WebSocket connection to the Binance API. It's implemented as a singleton to ensure only one connection is maintained throughout the application's lifecycle.\n\n3. **Main**: Orchestrates the application flow, including config loading, client initialisation, and graceful shutdown handling.\n\n4. **Handlers**: Contains utility functions for managing application signals and interrupts.\n\n5. **Util**: Provides a set of utility functions for common tasks such as logging, error handling, HTTP requests, and more. These functions are used throughout the application to maintain consistency and reduce code duplication.\n\n## Utility Functions (util.go)\n\nThe `util.go` file contains a variety of helper functions that are used throughout the application:\n\n- **Logging**: `LogInfo`, `LogError`, and `LogAndExit` for different levels of logging.\n- **Error Handling**: `CheckError` for standardised error checking.\n- **Configuration**: `FileExists` and `ValidateConfig` for config-related operations.\n- **String Manipulation**: `ToUpperCase`, `ToLowerCase`, and `Contains` for string operations.\n- **HTTP Requests**: `MakeGetRequest` for making HTTP GET requests.\n- **Time Utilities**: `CurrentTimestamp` and `ParseTimestamp` for working with timestamps.\n- **Retry Mechanism**: `Retry` for implementing retry logic on operations that may fail.\n\nThese utilities enhance the robustness and maintainability of the application by providing consistent ways to handle common operations.\n\n## Getting Started\n\n1. Ensure you have Go installed on your system.\n2. Clone the repository.\n3. Modify `configs/config.yaml` to include the cryptocurrency symbols you want to monitor.\n4. Run the application:\n\n   ```\n   go run main.go\n   ```\n\n5. The application will connect to the Binance WebSocket API and start streaming real-time data for the specified symbols.\n\n## Note\n\nThis application is designed for educational purposes and should be thoroughly tested and potentially optimised before use in any production or real trading scenarios.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farturogonzalezm%2Fhftcryptodashboard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farturogonzalezm%2Fhftcryptodashboard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farturogonzalezm%2Fhftcryptodashboard/lists"}