projects/cryptoprism-return-modelspass9 of 9 passed

Back to work

Python / LightGBM / PyTorch / PostgreSQL

CryptoPrism return‑ranking models

LightGBM models that rank coins daily by their expected 3-day move, gated by a market regime detector. Research only: clean backtests lost money.

3-dayranking horizon

Exhibit

From daily features to a gated coin ranking

  1. 01LabelMark each coin-day up, down or flat by its 3-day forward return.
  2. 02FeaturesTechnical tables, BTC residuals, cross-coin ranks and, in one variant, news.
  3. 03TrainLightGBM on a rolling split: 21 days validation, 14 days test.
  4. 04ScoreRank coins daily and z-score each score over 30 days.
  5. 05GateA 4-state regime detector decides direction and size.

What the evidence says

  • Ranks better than random on one 14-day test windowyes
  • News features clearly beat price onlynot shown
  • Embeddings run at live inferenceno
  • Makes money in clean rolling backtestsno

The model learned something on a short test window. It did not survive honest backtests.

Leadership lens

The callpass

One gradient-boosted tree model (LightGBM) as the core, with neural nets only as extra inputs. I chose this over a stack of competing models because trees train fast on tabular features and explain themselves through feature importance.

The betpass

That stripping out Bitcoin moves and ranking each coin against the rest of the market would expose signal that raw price features hide. On one 14-day test window it did: the price-only model reached a test IC of about 0.11.

The trade-offpass

The LSTM and TCN embeddings are used only when training. The live inference job leaves them empty, so the training and live inputs are not the same. I accepted that gap to ship daily signals sooner, and it is the first thing I would close.

The outcomepass

Daily inference and a weekly retrain still run on schedule. No live system uses the signals. The clean rolling backtests that used these models lost money, so the model stays a research tool.

Coordinated

Kept one stable output table for two sibling projects: the news pipeline feeds it, and the paper-trading bot and its backtests read from it and retrain it.

Where this goes next

Run price-only and news-augmented side by side on the same windows, with trading costs, before adding any more features. Then either run the embeddings at inference or drop them.

01 The question

Which coins will do better over the next three days

Most crypto coins move with Bitcoin. A model that only learns "buy when Bitcoin is up" is not useful. I wanted a daily ranking of coins: which ones are likely to beat the rest over the next three days, and which are likely to lag. The universe is every coin with an average market cap above $50M over the last 30 days. Smaller coins are too thin and noisy to rank well.

Prediction horizon

3 days

the training target

Universe floor

$50M

average market cap

Features, price only

50

per coin per day

Features, with news

62

adds 12 news features

02 The target

A simple 3-class label

Each coin-day gets a label from its own 3-day forward return. More than 5% up is "up". More than 5% down is "down". Anything in between is "flat". The same code also builds 1-day, 7-day and 14-day labels with 3%, 7% and 10% cut-offs, but the models train on the 3-day one. The label itself is not relative to the market. The relative part comes from the features and from how the output is used: coins are ranked against each other each day, and each score is compared with its own last 30 days.

03 The features

Take Bitcoin out, then compare coins with each other

FamilyWhat it measures
Technical tablesDaily returns and risk, momentum, oscillators, volume trends and risk ratios, from the existing FE tables
BTC residualsHourly prices for 250 coins are regressed on Bitcoin. What is left is the coin's own move. Eight features describe it: momentum, z-score, volatility regime, autocorrelation and a volume interaction
Cross-coin ranksEight features that place a coin against the rest of the market: return and volatility ranks, breadth, advance and decline, dispersion, volume concentration
Market moodThe Fear and Greed index
NewsTwelve daily sentiment, volume and event-flag features from the CryptoPrism news pipeline. Used only in the news-augmented variant

The news features come from my sibling project, the CryptoPrism news pipeline (opens in a new tab). It reads crypto news, scores it with FinBERT and writes one row per coin per day. This project only consumes those rows.

04 The models

One tree model in three shapes

ModelInputsTraining window
LightGBM price only50 price, residual and cross-coin featuresRolling 2 years
LightGBM news augmentedThe same 50 plus 12 news featuresFrom October 2025, when news data starts
LightGBM with embeddingsAbout 110 features, including LSTM and TCN embeddings, news events and moon phaseRetrained weekly

The neural nets are feature makers, not voters

Two small neural nets turn price history into short number vectors that LightGBM can use. An LSTM reads 30 days of daily data and outputs 12 numbers. A TCN, a convolutional net for sequences, reads 168 hours of hourly data and outputs 16 numbers. Both were trained on a local GPU and never retrained on a schedule. The live hourly inference job sets both embeddings to empty. So they shape the model during training but add nothing at prediction time. That mismatch is a known flaw, not a feature.

A rule-based regime detector

A composite score combines Bitcoin momentum, volatility, the Fear and Greed index and market breadth. If volatility is more than twice its normal level, the state is "high volatility". Otherwise a score above 0.15 is "bull trend", below minus 0.15 is "bear trend", and the rest is "range bound". The state gates trade direction and position size. I picked this detector by replaying the paper bot's real trades through 8 different regime methods. The older architecture report describes a hidden Markov model. The code that runs is the simple rule set.

05 Daily operation

What runs and when

Daily and weekly jobs

FE tablestechnical features
News featuresfrom the news pipeline
LightGBM01:00 UTC daily
ML_SIGNALSz-scored ranking
LabelsSunday 02:00 UTC
Retrainnews model and embedding model
Model registryactive model

Each day at 01:00 UTC a GitHub Actions job loads the active model, scores every coin in the universe and writes ML_SIGNALS. Each score is turned into a z-score against that coin's last 30 days. Above 1.5 is a buy signal and below minus 1.5 is a sell. Every Sunday at 02:00 UTC the job rebuilds labels and retrains the news-augmented LightGBM and the embedding model. A separate hourly job writes regime-gated scores to ML_SIGNALS_V2. The daily job was still succeeding in early December 2026. Nothing live reads its output.

06 Results

A good test window, then honest backtests that lost

IC, the information coefficient, measures how well the model's ranking matches what actually happened. Zero means random. The best documented result is from the price-only model on a single 14-day test window, with no trading costs.

Validation IC, 3-day

0.13

price only, 21-day window

Test IC, 3-day

0.11

price only, 14-day window

Test accuracy

61%

same 14-day window

Test max drawdown

-3%

no costs

Did news help?

Not clearly. The repo has no same-window comparison of the two variants. The first news-augmented model, trained in February 2026 on under four months of news, had a test IC of about 0.01. The strong number above came from the price-only model.

The clean backtests

The real test was a rolling backtest that retrains the news-augmented model every week and trades only the following unseen week. Over Q1 2026, with 13 retrains, it lost 12.7%. Bitcoin fell about 25% over the same period, so it lost less than holding Bitcoin, but it still lost. Weekly validation IC swung from about minus 0.07 to 0.12. In April 2026 the same setup ended roughly flat. Those backtests, and the bot that traded these signals, are written up on the Trishula paper-trading bot (opens in a new tab) page.

What I take from it

A short test window can look excellent and still not hold up week after week. The rolling backtest is the number I trust, and it says this model is not ready to trade.

07 Stack

Tools

PythonLightGBMPyTorchscikit-learnPostgreSQLGitHub Actions