{"id":19287974,"url":"https://github.com/pedrosfaria2/websocket_binance_api","last_synced_at":"2026-03-17T23:30:59.820Z","repository":{"id":248153923,"uuid":"827913430","full_name":"pedrosfaria2/websocket_binance_api","owner":"pedrosfaria2","description":"A client for binance's websocket api","archived":false,"fork":false,"pushed_at":"2024-07-14T20:38:00.000Z","size":71,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-13T09:48:16.617Z","etag":null,"topics":["api","api-client","api-rest","api-websocket","cryptocurrency","market-data","rust","tokio-rs","trading","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/pedrosfaria2.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-07-12T16:46:57.000Z","updated_at":"2024-07-14T20:38:03.000Z","dependencies_parsed_at":"2025-01-05T19:32:25.289Z","dependency_job_id":null,"html_url":"https://github.com/pedrosfaria2/websocket_binance_api","commit_stats":null,"previous_names":["pedrosfaria2/websocket_binance_api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pedrosfaria2/websocket_binance_api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrosfaria2%2Fwebsocket_binance_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrosfaria2%2Fwebsocket_binance_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrosfaria2%2Fwebsocket_binance_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrosfaria2%2Fwebsocket_binance_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pedrosfaria2","download_url":"https://codeload.github.com/pedrosfaria2/websocket_binance_api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrosfaria2%2Fwebsocket_binance_api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30635168,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T22:38:22.569Z","status":"ssl_error","status_checked_at":"2026-03-17T22:38:11.804Z","response_time":56,"last_error":"SSL_read: 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":["api","api-client","api-rest","api-websocket","cryptocurrency","market-data","rust","tokio-rs","trading","unit-testing"],"created_at":"2024-11-09T22:07:43.419Z","updated_at":"2026-03-17T23:30:59.798Z","avatar_url":"https://github.com/pedrosfaria2.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Binance WebSocket Client\n\nThis project is a comprehensive WebSocket client designed to interact with the Binance API. It allows users to subscribe to various data streams such as `aggTrade`, `trade`, and `kline`. The client processes real-time data, provides a graphical user interface (GUI) to display the data, and includes features for custom stream subscriptions and graceful shutdown handling.\n\n## Table of Contents\n\n- [Features](#features)\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Menu Options](#menu-options)\n- [Project Structure](#project-structure)\n- [Running Tests](#running-tests)\n- [License](#license)\n\n## Features\n\n- **Real-time Data Processing**: Subscribe to and process real-time data streams from Binance.\n- **Graphical User Interface**: Utilizes `tui-rs` to display trade data and statistics in a user-friendly interface.\n- **Custom Stream Subscriptions**: Allows subscribing to multiple custom streams for flexibility.\n- **Graceful Shutdown Handling**: Captures shutdown signals to exit the application cleanly.\n- **Comprehensive Statistics**: Calculates and displays average price, median price, standard deviation, total volume, and volume-weighted average price (VWAP).\n- **Modular Design**: Organized into several modules to enhance modularity and maintainability.\n\n## Requirements\n\n- Rust (latest stable version)\n- Cargo (latest stable version)\n\n## Installation\n\n1. Clone the repository:\n\n    ```sh\n    git clone https://github.com/pedrosfaria2/websocket_binance_api.git\n    cd websocket_binance_api\n    ```\n\n2. Build the project:\n\n    ```sh\n    cargo build\n    ```\n\n3. Run the tests:\n\n    ```sh\n    cargo test\n    ```\n\n## Usage\n\n1. Run the WebSocket client:\n\n    ```sh\n    cargo run\n    ```\n\n2. Follow the on-screen menu to subscribe to various streams.\n3. *Only the AggTrade has been implemented so far!*\n\n### Menu Options\n\n- **Subscribe to aggTrade**: Subscribe to aggregated trade data for a specific symbol.\n- **Subscribe to trade**: Subscribe to trade data for a specific symbol.\n- **Subscribe to kline**: Subscribe to kline (candlestick) data for a specific symbol and interval.\n- **Custom Subscribe**: Subscribe to multiple custom streams.\n- **List Symbols**: List all available symbols.\n- **List Subscriptions**: List current subscriptions.\n- **Exit**: Exit the application.\n\n## Project Structure\n\nThe project is organized into several modules to enhance modularity and maintainability:\n\n- **client**: Contains the main WebSocket client logic, including running the client, handling subscriptions, and managing shutdown.\n- **handler**: Includes handlers for different types of messages (e.g., aggTrade) and input handling for graceful shutdown.\n- **input**: Manages user input for shutdown signals.\n- **message**: Parses incoming WebSocket messages.\n- **ping**: Manages periodic pings to keep the WebSocket connection alive.\n- **shutdown**: Handles graceful shutdown on receiving a shutdown signal.\n- **storage**: Manages storage and processing of trade data.\n- **subscriptions**: Manages subscription messages to the Binance WebSocket API.\n- **ui**: Renders the user interface using `tui-rs`.\n\n## Running Tests\n\nThe project includes unit tests for various components. To run the tests, use the following command:\n\n```sh\ncargo test\n```\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedrosfaria2%2Fwebsocket_binance_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpedrosfaria2%2Fwebsocket_binance_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedrosfaria2%2Fwebsocket_binance_api/lists"}