Honest warning: cryptocurrency price prediction is a high-noise task. Academic works show 54–60% accuracy on movement direction for LSTM models on BTC – slightly better than random guessing. The value of the system is not in prediction precision but in processing more signals faster than a human manually. For example, our model analyzes 168 hourly OHLCV candles from Binance, 30+ on-chain metrics from Glassnode, and 15 technical indicators – totaling over 50 features. This allows identifying patterns that a human simply wouldn't notice. However, even with this volume of data, absolute accuracy is unattainable. Therefore, we focus on probabilistic forecasts with a confidence interval.
AI Crypto Price Prediction in Mobile Apps: Overview
We develop AI models for cryptocurrency market prediction, integrating them into mobile applications. Our team has over 5 years of experience in machine learning and mobile development, having completed 50+ projects for crypto exchanges and analytical platforms. The result is a system that helps make decisions based on analysis of hundreds of features. We'll assess your project for free – contact us.
Why Use Ensemble Models for AI Crypto Price Prediction?
Ensemble models combine strengths of multiple algorithms. Our AI crypto price prediction system for crypto mobile app leverages LSTM, TFT, and XGBoost to improve robustness.
What Data and Features Are Used?
OHLCV via CCXT
ccxt is a Python library with a unified API for 100+ exchanges. It's the standard for fetching historical data:
import ccxt
import pandas as pd
exchange = ccxt.binance()
ohlcv = exchange.fetch_ohlcv(
symbol="BTC/USDT",
timeframe="1h",
since=exchange.parse8601("2023-01-01T00:00:00Z"),
limit=1000
)
df = pd.DataFrame(ohlcv, columns=["timestamp", "open", "high", "low", "close", "volume"])
df["timestamp"] = pd.to_datetime(df["timestamp"], unit="ms")
Binance returns up to 1000 candles per request. For full history, use pagination with the since parameter.
On-chain data
For BTC and ETH, on-chain metrics add signals not present in OHLCV:
- Glassnode API: SOPR (Spent Output Profit Ratio), NVT, NUPL, Exchange Net Flow. Paid, but has a free tier with daily data.
- Etherscan API: transaction volume, gas fees, active addresses.
- CoinGecko / CoinMarketCap: market cap, dominance, total market volume.
import requests
class GlassnodeCollector:
BASE_URL = "https://api.glassnode.com/v1/metrics"
def get_sopr(self, api_key: str, since: int, until: int) -> pd.DataFrame:
response = requests.get(
f"{self.BASE_URL}/indicators/sopr",
params={
"a": "BTC",
"i": "24h",
"s": since,
"u": until,
"api_key": api_key
}
)
data = response.json()
return pd.DataFrame(data).rename(columns={"t": "timestamp", "v": "sopr"})
SOPR > 1 in a rising market = holders selling at a profit. SOPR < 1 in a decline = capitulation. This provides additional context for the ML model.
Example of collecting on-chain data
The example above shows SOPR fetching. Similarly, NVT, NUPL, and other metrics are collected.Technical Indicators
Raw OHLCV → technical indicators via pandas-ta or ta-lib:
import pandas_ta as ta
df.ta.rsi(length=14, append=True) # RSI_14
df.ta.macd(append=True) # MACD_12_26_9, MACDh, MACDs
df.ta.bbands(length=20, append=True) # BBL, BBM, BBU, BBB, BBP
df.ta.atr(length=14, append=True) # ATRr_14
df.ta.obv(append=True) # OBV
df.ta.vwap(append=True) # VWAP_D
All indicators are normalized. RSI is already in [0, 100]. MACD is normalized via Z-score or min-max over a rolling window. Raw prices are not fed to the model – we use returns (percentage change) and normalized features.
Temporal Fusion Transformer Improves Prediction
Temporal Fusion Transformer (TFT) from Google is state-of-the-art for financial time series. It supports multiple time horizons, static and dynamic covariates, and interpretability via attention. Implemented in pytorch-forecasting. Heavier than LSTM but more accurate with properly prepared data. According to Google's research, TFT yields 2–5% accuracy improvement over LSTM on the same data.
How Do Models Compare?
LSTM for time series
The standard choice. Takes a sequence of N candles, predicts the next:
import tensorflow as tf
def build_lstm_model(sequence_length: int, n_features: int) -> tf.keras.Model:
inputs = tf.keras.Input(shape=(sequence_length, n_features))
x = tf.keras.layers.LSTM(128, return_sequences=True, dropout=0.2)(inputs)
x = tf.keras.layers.LSTM(64, dropout=0.2)(x)
x = tf.keras.layers.Dense(32, activation="relu")(x)
outputs = tf.keras.layers.Dense(3, activation="softmax")(x) # up/down/sideways
return tf.keras.Model(inputs, outputs)
Direction classification (up/down/sideways) is more reliable than regression of exact price. Metrics are accuracy and F1 on out-of-sample data.
XGBoost as baseline
Don't underestimate gradient boosting on the right features. XGBoost without temporal context often competes with LSTM. Fast to train, easy to convert to TFLite. An excellent baseline for comparison.
Model Comparison Table
| Model | Advantages | Disadvantages | Accuracy Improvement |
|---|---|---|---|
| LSTM | Handles temporal context | Slow training, needs lots of data | Baseline |
| TFT | Interpretability, accuracy | Complex configuration | +2–5% over LSTM |
| XGBoost | Speed, simplicity | No temporal memory | Comparable to LSTM with features |
| Ensemble | Compensates weaknesses | Harder to deploy | +5–8% over single model |
Deployment in a Mobile App
Inference is on the server. The model takes 168 hourly candles (7 days), returns direction probabilities for 4/8/24 hours. REST endpoint with caching: prediction is recalculated once per hour.
On the mobile side – only displaying the result:
struct PricePrediction: Codable {
let symbol: String
let horizon4h: PredictionOutcome
let horizon8h: PredictionOutcome
let horizon24h: PredictionOutcome
let updatedAt: Date
}
struct PredictionOutcome: Codable {
let direction: String // "up", "down", "sideways"
let probability: Double // 0.0 - 1.0
let confidenceInterval: ClosedRange<Double> // price range
}
The confidence interval (quantile regression) shows a range instead of a point prediction: "BTC in 24h: 55,000–61,000 USDT with 70% probability" – more honest than "57,432 USDT".
Monitoring Model Degradation
We combat model degradation by monitoring rolling accuracy over the last 30 days, distribution shift of input features (KL divergence train vs recent data), and Sharpe ratio if used in trading. When accuracy drops more than 5% from baseline – automatic retraining on fresh data.
What's Included in the Work
- Data collection and cleaning (OHLCV + on-chain)
- Feature engineering and normalization
- Training and validation of multiple models (LSTM, TFT, XGBoost)
- Selecting the best, conversion and deployment of REST API
- Mobile UI: prediction chart, confidence interval
- Setting up monitoring and auto-retraining
- Documentation and team training
Timeline Estimates
LSTM model with basic feature set and mobile dashboard – from 2 to 4 weeks. Ensemble with on-chain data, multi-horizon prediction, and monitoring – from 5 to 10 weeks.
Cost is calculated individually after requirements analysis. Get a consultation on architecture selection – contact us for your project assessment. We help from idea to deployment on App Store and Google Play.
Disclaimer: The app must include: "Predictions are for informational purposes only. Past accuracy does not guarantee future results. Not investment advice."
Academic accuracy data from Wikipedia and industry reports.







