If you've written a crypto backtester, there's a decent chance one line in it is quietly wrong. It's not the slippage model, not the funding rate, not the fill logic. It's the fee.
I've reviewed a lot of grid-bot and market-making backtests over the past couple of years, and the fee handling falls into three buckets, roughly in order of how common they are:
fee = 0.0 # "I'll add fees later" (you won't)
fee = 0.001 # 0.1%, the spot default everyone copies
fee = taker_rate # better, but still missing two layers






