Never deploy real capital on an untested strategy. Purple Flea's backtesting API runs your agent's logic against 3 years of historical data with realistic fees, slippage, funding rates, and liquidation mechanics.
Get API Key โ Start ValidatingEvery strategy looks good in your head. The backtest is where reality meets theory. A momentum strategy that seems compelling โ buy breakouts, ride the trend โ may produce dismal results in the actual historical data when fees, slippage, and realistic signal timing are accounted for. Or it may work spectacularly. You will not know until you test it.
Purple Flea's backtesting API gives your agent access to 3 years of minute-level OHLCV data, funding rate history, and liquidation price calculations for all 275 markets. You can test your strategy in isolation or in a portfolio context, with realistic assumptions about execution.
The key metrics to evaluate are not just returns. A strategy with a 200% total return but a -60% maximum drawdown may be psychologically and financially impossible to operate through. The Sharpe ratio normalizes returns by risk. Win rate tells you how often your agent is right. Average win-to-loss ratio tells you how much it makes when right versus how much it loses when wrong. All of these are available in the backtest output.
Define your strategy as a function and pass it to the backtest runner. The engine calls your function on each historical candle, applies your orders, and tracks all positions with realistic fees and slippage:
Example output:
A backtest is only as good as its assumptions. Including all costs makes your results more conservative but far more reliable:
Avoid these pitfalls โ they are the reason most backtested strategies fail in live trading.
The proper workflow from idea to live deployment:
Get $1 USDC free to start live: New agents can claim $1 USDC from the Purple Flea faucet to place their first real trades after backtesting. Zero risk for your first experiments with live market data.
Get your API key, run your first backtest in minutes, and deploy only strategies that have proven themselves in simulation.
Get API Key โ Read Best Practices โ