Finance
Leveraging Blockchain Analytics for Quantitative Insights in Decentralized Finance (DeFi) Markets
2026-05-14
Background:
In 2025, I studied MSc Business Analytics at Trinity College Dublin. During the programme, I explored subjects including Business Data Mining, Big Data & AI in Business, Data Management & Visualization, Social Media Analysis, and Business Decision Optimisation.
For my final dissertation, I chose to pursue an individual research project in a field I have been deeply interested in: cryptocurrency and decentralized finance (DeFi). The research focused on Ethereum blockchain analytics, machine learning, and quantitative trading systems, aiming to investigate whether on-chain data could improve short-term market prediction and trading performance.
The project combined concepts and methodologies developed throughout the programme, including data engineering, feature engineering, machine learning modeling, predictive analytics, quantitative backtesting, and financial data visualization. Using data collected from Binance and Dune Analytics APIs, I built a full end-to-end pipeline integrating on-chain metrics, technical indicators, and ensemble learning models such as Random Forest and XGBoost to evaluate predictive and financial performance in DeFi markets.
Project Overview:
This dissertation explores the application of blockchain analytics and machine learning in decentralized finance (DeFi) markets, with a focus on short-term Ethereum (ETH) price forecasting and quantitative trading strategy development.
The project integrates multiple categories of data, including market price data, Ethereum on-chain activity, and technical indicators. Key blockchain features such as gas fees, whale transactions, active addresses, smart contract interactions, and Total Value Locked (TVL) were combined with traditional quantitative indicators including RSI, MACD, moving averages, and volatility metrics.
Several machine learning models were developed and evaluated, including Linear Regression, Random Forest, XGBoost, and stacking ensemble architectures. Model performance was assessed not only through statistical metrics such as RMSE and R², but also through trading-oriented backtesting using portfolio return, Sharpe ratio, volatility, and drawdown analysis.
One of the key findings of the research was that the statistically most accurate model did not necessarily produce the best trading performance. While Random Forest achieved the strongest predictive accuracy, XGBoost generated the highest portfolio returns during backtesting, highlighting the distinction between prediction quality and real-world financial profitability in quantitative trading systems.
The project ultimately demonstrates how blockchain-native data and machine learning techniques can be integrated into practical quantitative research workflows for DeFi market analysis and systematic trading.
Method:
The project followed a multi-stage quantitative research workflow combining data engineering, feature construction, machine learning modeling, and trading strategy evaluation.
Historical ETH/USDT market data was collected through the Binance API, including OHLCV price and trading volume information. Ethereum on-chain metrics were retrieved using Dune Analytics APIs, covering features such as gas fees, active addresses, whale transactions, smart contract activity, transaction volume, and Total Value Locked (TVL).
After preprocessing and cleaning the datasets, additional technical indicators were engineered using Python, including RSI, MACD, Bollinger Bands, Rate of Change (ROC), moving averages, and volatility-based signals. The final dataset combined market structure, blockchain activity, and momentum-based quantitative factors into a unified feature framework.
Several supervised machine learning models were then developed to predict next-day Ethereum closing prices, including:
- Linear Regression
- Random Forest
- XGBoost
- Stacking Ensemble Models
Hyperparameter optimization was performed using randomized cross-validation to improve model robustness and reduce overfitting.
Beyond statistical prediction, the project also implemented a quantitative backtesting framework simulating real trading conditions. Trading signals generated by the models were evaluated using portfolio performance metrics including cumulative return, Sharpe ratio, annualized volatility, maximum drawdown, and win rate.
The entire workflow was implemented in Python using libraries such as pandas, scikit-learn, xgboost, matplotlib, and various blockchain and exchange APIs.
Key Findings:
Several interesting patterns emerged during the research process.
Although Random Forest achieved the strongest statistical accuracy in terms of RMSE and R², it did not generate the best trading performance during backtesting. Instead, XGBoost produced the highest cumulative returns and strongest Sharpe ratio, despite slightly weaker prediction metrics.
This highlighted an important distinction in quantitative finance:
the most statistically accurate model is not always the most profitable trading model.
The research also showed that blockchain-native metrics such as gas fees, whale transaction activity, and smart contract interactions contained meaningful predictive information when combined with traditional technical indicators.
Interestingly, stacking ensemble models failed to outperform the standalone models in this project. In several cases, ensemble architectures introduced additional variance and overfitting, leading to weaker out-of-sample trading performance.
These findings reinforced the importance of evaluating machine learning systems not only through prediction accuracy, but also through practical financial performance under realistic market conditions.
Tools & Libraries:
The project was primarily developed in Python and combined multiple libraries, APIs, and quantitative research tools throughout the workflow.
Programming & Data Processing
- Python
- pandas
- NumPy
Machine Learning
- scikit-learn
- XGBoost
Data Visualization
- matplotlib
- seaborn
Blockchain & Market Data
- Binance API
- Dune Analytics API
Quantitative Research & Backtesting
- Custom backtesting framework
- Feature engineering pipelines
- Statistical evaluation metrics
- Portfolio performance analysis
Development Environment
- Jupyter Notebook
- VS Code
Review:
This dissertation became both a machine learning project and an introduction to quantitative research in DeFi markets.
One of the key lessons was that statistical accuracy does not always translate into trading profitability. While Random Forest achieved the strongest predictive performance, XGBoost generated better portfolio returns during backtesting, highlighting the importance of evaluating models under realistic trading conditions.
The project also demonstrated how blockchain-native data — including gas fees, whale activity, and smart contract interactions — can provide meaningful signals when combined with traditional quantitative indicators.
Beyond the technical workflow, the research strengthened my interest in financial machine learning, systematic trading, and blockchain analytics as long-term research directions.