Hi, I inspect my USDT Futures trade history and try to calculate the USDT wallet balance before order execution.
Imagine my order BTCUSDT was executed at 2020-12-30 12:13:45
I take USDT snapshot balance from the previous day: get snapshot 2020-12-30 + 1 day
sum all income from incomes where income time >= 2020-12-30 00:00:00 and < 2020-12-30 12:13:45
order.executedqty * order.price
Then I sum up all three numbers and expect to get wallet balance.
I see that order.executedqty * order.price is greater than “total balance” at some cases.
This I don’t understand. Example:
USDT snapshot balance 2020-12-30 + 1 day = 0.53742687
income during day 2020-12-30 before 12:13:45 (order creation time) -5.69070634
order.executedqty * order.price = 8.196
total_balance = 3.04272053 = 0.53742687 -5.69070634 + 8.196
How can I figure it out using API? I work with filled orders only, with historical data
I have no idea. That’s the question. My goal is to “recreate” balance amount at order creation. I want to know what was the proportion of oder and balance? Did trader decided to go all in user 100% of balance or did he put only 55% of it?