Data Engineering
Bug Report
Bot PnL disagrees with the exchange: fees, funding payments and mark price
Our perpetual futures bot reported a monthly PnL 6 percent higher than the exchange's account history. It ignored trading fees on some fills, never recorded funding payments, and valued open positions at last trade price instead of mark price. Building PnL from the income ledger fixed it.