Ideally ask Binance support for the formula. Some of their calculations are inaccurate. For instance the PnL for my margin account is never correct.