|
| 1 | +<!-- toc --> |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | +<!-- tocstop --> |
| 6 | + |
| 7 | +- Author: Castelan, Emily |
| 8 | +- Date: April 21 2025 |
| 9 | + |
| 10 | +<Describe all the files in the projects> |
| 11 | + |
| 12 | +## This project contains the following template files |
| 13 | + |
| 14 | +- `Falcon`.API.ipynb: a notebook describing the native API of Flacon |
| 15 | +- `Falcon`.API.md: a description of the native API of Falcon |
| 16 | +- `Falcon`.API.py: code for using API of Falcon |
| 17 | +- `Falcon`.example.ipynb: a notebook implementing a project using <Package> |
| 18 | +- `Falcon`.example.md: a markdown description of the project |
| 19 | +- `Falcon`.example.py: code for implementing the project |
| 20 | + |
| 21 | +This project contains the following working files |
| 22 | +- `falcon_server`.API.md: a description of the native API of Falcon |
| 23 | +- `falcon_server`.API.py: code for using API of Falcon |
| 24 | + |
| 25 | + |
| 26 | +## Project Description |
| 27 | +This project is a real-time Bitcoin analytics platform built using [Falcon](https://falcon.readthedocs.io), a high-performance Python web framework designed for building fast APIs. The goal is to ingest, process, and analyze Bitcoin trading data at scale — supporting real-time insights and forecasting, with a strong focus on scalability and performance. |
| 28 | + |
| 29 | +This README serves as both documentation and a development roadmap. |
| 30 | + |
| 31 | +--- |
| 32 | + |
| 33 | +## Pipeline Overview |
| 34 | +### 1. **Real-Time Data Ingestion** |
| 35 | +- Connect to a WebSocket API (e.g., Binance or Coinbase Pro) to stream live Bitcoin trade data. |
| 36 | +- Example data: `price`, `timestamp`, `volume`, `trade_id`, `order_type` |
| 37 | + |
| 38 | +### 2. **Falcon API Endpoint (`/ingest`)** |
| 39 | +- Incoming data is POSTed to a high-performance Falcon endpoint. |
| 40 | +- This endpoint validates and quickly offloads the data for processing. |
| 41 | +- Designed for low latency and high throughput. |
| 42 | + |
| 43 | +### 3. **Distributed Processing Queue** |
| 44 | +- Validated data is forwarded to async workers using Celery (or Redis Queue). |
| 45 | +- Each task is handled independently in the background to avoid blocking the API. |
| 46 | + |
| 47 | +### 4. **Analytics Tasks** |
| 48 | +- **Anomaly Detection**: Identify sudden price changes or suspicious patterns. |
| 49 | +- **Sentiment Analysis** *(optional)*: Pull recent tweets about Bitcoin and score the sentiment using an NLP model. |
| 50 | + |
| 51 | +### 5. **Model Training & Forecasting** |
| 52 | +- Use historical and/or streamed price data to train a forecasting model: |
| 53 | + - Option A: [Facebook Prophet](https://facebook.github.io/prophet/) |
| 54 | + - Option B: LSTM (via Keras) |
| 55 | + |
| 56 | +### 6. **Prediction API Endpoint (`/predict`)** |
| 57 | +- Expose a Falcon endpoint that returns the predicted price (next 24h or specified window). |
| 58 | +- Optionally supports parameters for time range, model type, or confidence interval. |
| 59 | + |
| 60 | +### 7. **Caching and Optimization** |
| 61 | +- Store frequent API results (e.g., recent predictions) in Redis to reduce load. |
| 62 | +- Apply rate limiting to protect the system under heavy use. |
| 63 | + |
| 64 | +### 8. **Scalability & Monitoring** |
| 65 | +- The full system is containerized using Docker. |
| 66 | +- Use Locust to simulate high request volume and test limits. |
| 67 | +- Monitor system metrics using `prometheus-client`. |
0 commit comments