← All posts

Investing · 2026.09.15 · 5 min · Updated 2026.10.26

Can Predicting Bitfinex Lending Rate Spikes Pay? Out of Sample It Kept About 10bp, So I Passed

Using perfect foresight as an upper-bound gate and then out-of-sample backtests, I tested holding capital for predicted lending-rate spikes: the ceiling was large, but a model using only current data kept about 10bp.

Reading
Theme
Size
Width

Predict Bitfinex lending rate spikes, hold capital back, and lend it out at the high. After backtesting the idea, I decided not to build it.

The perfect-foresight ceiling isn't small: knowing just 3 hours ahead is worth +54 to +129bp. But with only the data visible at the moment, the best out-of-sample model kept around 10bp, and during the live period it was actually negative.

When it guesses wrong, the capital sits idle, and the cost of idling eats the gains from the right guesses.

Predicting spikes and holding capital is an idea that comes up a lot in lending strategy. I wanted to know whether it could cut down on capital getting stuck in low-rate loans.

Stuck capital is real, but small

I looked at the roughly seventeen thousand USD credits the bot had actually lent out. For 2-day loans, 55.6% of capital-days (amount times days lent) saw a batch top price of 1.5x or more while the loan was out. The feeling of being stuck isn't imaginary.

But these loans were repaid after an average of only 0.63 days, and loans below 6% annualized were even shorter, averaging 0.46 days. Borrowers weren't sitting on cheap loans.

In June, 85% of capital-days were below 6%, but that was the whole market stuck under the same rate wall, and no strategy would have changed it.

What really stays stuck for a long time is long tenors: loans of 31 days or more averaged 16.5 days. That's a job for the long-tenor lane trial.

Bar chart of average days lent: the roughly seventeen thousand USD credits the bot made averaged 0.63 days, loans below 6% annualized averaged 0.46 days, and loans of 31 days or more averaged 16.5 days.

Upper bound first, then out of sample

It's easy to build a prediction model that looks useful, so I set the bar first.

Before building a prediction model, compute the perfect-foresight upper bound. The ceiling decides whether it's worth the time. If it's too small, stop.

Only if it's large enough, run out-of-sample validation: train on two years and test on the third. All three years have to be positive, and the effect has to be large enough to measure in live trading.

The backtest reused the batch top yardstick code from my research into Bitfinex's 20-minute batch auction. Gains accrue minute by minute. The duration of 2-day loans at spike prices is discounted, because borrowers repay faster when rates are high.

The control is the current batch_top, the yardstick that looks at the top prices of the last few batches.

I built two kinds of perfect foresight. The first always waits for the peak within the next H hours before posting, which leaves capital idle until the deployment rate (the share of capital actually lent out) collapses.

The second only waits when it pays: the extra interest times the expected duration of a spike-priced loan has to exceed the interest lost while waiting. The second is the fair upper bound, because it accounts for the cost of waiting.

The real model is a logistic regression, and every feature is a market condition visible at the moment. Examples are the ratio of the 24-hour high to the quote, the quote level, a few VWAP ratios, and time of day.

When the score crosses a threshold, one chunk is posted at L times the quote and waits up to H hours, falling back to the normal quote on timeout.

Parameters like H, L, and the threshold were picked only in the training years, and the third year only reports results. That's the only way out-of-sample numbers mean anything.

A big ceiling, a 10bp model

Annualized difference against batch_top in bp, across four windows:

Strategy Year from 2023-10 Year from 2024-10 Most recent year Live period
Perfect foresight 72h, waiting only when it pays +84 +245 +157 +60
Perfect foresight 3h +77 +129 +83 +54
Always waiting for the 24h high −111 +127 −10 −151
Best real-model combination (out-of-sample) +9 +12 +10 −1

The 3-hour foresight version still gets +32 to +70bp with its two biggest months removed, so the ceiling isn't propped up by a single event.

The ceiling has to include the cost of waiting. Always waiting for the peak sounds like the strongest kind of foresight, but once you count the idle cost, it loses.

The real model's out-of-sample AUC was 0.64 to 0.87, which looks decent on its own. But AUC measures ranking ability; it doesn't care how much each wrong guess costs.

The best combination predicted whether a 1.5x spike would show up within 3 hours. Predicting 12 hours out was mostly negative.

Spikes were also more likely after certain UTC hours, with a correlation as high as 0.94 between the two year ranges. But time of day alone only predicted with an AUC of 0.54 to 0.57.

Idle capital eats the wins

Perfect foresight knows when the spike comes and how high it goes. The model only knows "there might be one within 3 hours," and it's right about 38% of the time.

When it's wrong, the capital idles and the lost interest is real. When it's right, spike-priced loans are repaid after an average of 0.21 days, so the extra earnings end quickly.

The model's predictive power comes mainly from mean-reversion signals like "24-hour high ÷ quote," and batch_top's yardstick already captures that.

All the model can add is what the yardstick doesn't see, and that's small.

Before testing a new signal, ask whether your existing strategy already captures the same thing.

Chart: the model only knows there might be a spike within 3 hours and is right about 38% of the time, and wrong guesses leave capital idle; when it is right, spike-priced loans are repaid after 0.21 days on average, against 0.63 days for the bot's loans.

This conclusion has preconditions. The backtest period had no high-rate regime lasting several weeks, and if the market structure changes (say, the batch auction goes away), it needs another look.

#Backtesting#Crypto Lending#Bitfinex#Machine Learning

Letters

Loading comments…

Next

Investing

How Long Should You Lend on Bitfinex? Backtesting 2-, 30-, and 120-Day Lending and the Lock-Up Risk

Long-tenor Bitfinex funding quotes far higher rates, but most 30-day loans repay within an hour. After fixing two inflating backtest bugs, only one 30-day lane survived, its gains are concentrated, and 120 days means lock-up risk.