Closing deals not corresponding with Exchange

Hi,

I have a strange behaviour from one of my DCA Hedge Bots. Im on Futures 1x Leverage.

On Gainium all Bots did close with profits. When I check the Exchange there are several deals which do not close in Profit for example this one:

image

image

On Gainium I closed the deal with 0.298$ profit. On the Exchange (Bybit) I closed with -1.7$

The closing price is the same on Gainium and the exchange but the opening price is different.

any Idea what the issue can be?

Here is the Bot Link: Gainium app

Hello! We have received your bug report regarding the discrepancy between deal closures on Gainium and your Bybit exchange for your DCA Hedge Bot. Thank you for providing the bot link; this is very helpful for our investigation. We will update you shortly on our findings.

I think this is because the way we calculate order profits and the way the exchange does is different. For the exchange, they aggregate all orders into a single one, so the entry price is the first order for that pair and the pnl is on the average price of all positions. We only calculate pnl of a single trade, which is the way to do it to be able to get strategy statistics.

Agreed. If there are multiple trades open on Gainium for a single pair, this could indeed explain the differences. The exchange doesn’t know anything about the meta object “trade” and only sees all the orders. The average price of all those orders on the exchange will certainly be different from the average price of a few of those orders belonging to a Gainum trade. But at least once all orders are filled, the results of all trades should even out and show similar values on the exchange and on Gainium.

Okay understand, I will monitor the bot and see if the result is similar what is shown in gainium.

Thanks.