r/Python • • 22d ago

Showcase Showcase Thread

Post all of your code/projects/showcases/AI slop here.

Recycles once a month.

28 Upvotes

157 comments sorted by

View all comments

2

u/One_Rice_2918 16d ago

Deptho - Deptho is the tick-level reality check for crypto backtests: it replays orders from any backtester against months of real Binance trades, entirely on a local machine.

What My Project Does
deptho is an Apache-2.0 Python library that checks crypto perpetual backtests against what actually traded. Give it the orders your backtest produced (a DataFrame of time, side and quantity) and it replays each one against the Binance trades that came after it, filling at the volume-weighted price of same-side prints. It also writes an offline HTML tearsheet that charges funding to the position you actually held at each funding time, alongside fees. Data comes from Binance’s public archive; everything runs locally, with no telemetry.

pip install deptho && python -m deptho.demo

There’s also an adapter for Freqtrade backtest exports: python -m deptho.freqtrade user_data/backtest_results.

Target Audience
People backtesting crypto perpetual strategies in Python who want to know whether their fills and costs are realistic. It’s a checking tool for research, not a live trading system.

Comparison
Backtesting frameworks like backtesting.py or Freqtrade run your strategy; deptho doesn’t. It checks the orders any of them produce, so there’s nothing to rewrite. Tools built for high-frequency simulation (hftbacktest, for example) model queue position on full order book data, but you write your strategy inside their framework. deptho’s limits: fills come from trade prints, not the order book, and it’s Binance USD-M only for now.

Source: https://github.com/jjinaustin/deptho