Tutor task122 spring2025 scalable real time bitcoin analytics with falcon 4#529
Merged
tkpratardan merged 6 commits intoJun 12, 2025
Conversation
tkpratardan
approved these changes
Jun 12, 2025
…_Bitcoin_Analytics_with_Falcon_4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title: Falcon API: Bitcoin Streaming and LSTM Predictions
Author: Emily Castelan Moreno
DATA605 Spring 2025
This is my final project submission.
Project Description:
The Jupyter notebook
Falcon.ipynbdemonstrates a real-time and near real-time Bitcoin trade data ingestion pipeline. The notebook utilizes the Falcon API system designed in the app. The app integrates a persistent WebSocket connection, a Falcon API server, Redis and Redis TimeSeries-backed Celery workers, and container orchestration. This setup required extensive debugging across async message flows, Redis compatibility, and Docker networking, and LSTM model training and predicting.High Level System Overview
This setup enables scalable, asynchronous prediction calls that can be triggered from a notebook, dashboard, or API client, while keeping the model execution offloaded to background workers.
Bottom Line Up Front:
The model results were not very promising under the mean squared error loss function and Adam optimizer.
Another iteration could be done with different loss functions like mean absolute error or huber, which are robust to outliers and less sensitive to extreme deviations and that heavily penalize models .
Two optimizers which could better pick up on noise and nonlinear patterns are
rmspropsandnadambecause the current optimizer Adam may struggle to adaptively with tuning nonstationary price shocks or chaotic volatility.To change these parameters and tune the model, the defaults would have to be changed in the python functions.
Another factor to keep in mind is the two cases graphed above are extremely volatile bitcoin trends that are known as historical lows and highs around COVID-19 and a Bitcoin hype rally in 2024, therefore they would be tricky even for a well tuned model.
This app additionally launches a websocket that listens for trade data from both Binance and Coinbase to do a sliding window anomoly detection. It runs automatically as soon as the docker compose is ran. The user can monitor the logs in the terminal or using the Flower UI that is connected at localhost:5555. This live steam could be used to implement batch handling LSTM predictions which would be closer to a live analysis. I will continue to tune the models and incorporate the live stream.
If this is your first RNN, congratulations, this was also my first RNN and pipeline too.