Closed busyuqboy closed 2 years ago
Okay, I figured out how to get the REAL price on your order.
GET /spot/my_trades
The price from the /spot/orders api is the original limit order price. However, everything under this price is bought.
In order to compute the "real" price you could do something like final_price = order['fill_price'] / order['amount']
I think there's nothing wrong on gate.io side. Maybe the bot takes into account the limit order price instead of the actual fill price.
The price from the /spot/orders api is the original limit order price. However, everything under this price is bought. In order to compute the "real" price you could do something like
final_price = order['fill_price'] / order['amount']
I see what you're saying....that the /spot/orders api tells you what you submitted for the price. It doesn't mean that is the price you actually filled your buy order with. But it seems like you can fetch (to confirm) your price/trades with /spot/my_trades
and get the price that was actually used with the fill order.
If there is still a problem that needs to be addressed, feel free to open the issue again.
The bot is using incorrect price values (possibly) from the response of Gate.io spot orders API payload.
Not sure what we can do about this. It's simply wrong info. The price returned doesn't even match what they show on their website for your trade order history.
Real Example: I had the bot purchase a new listing coin on gate.io called ZLK.
The purchase went through and I had an order closed (and filled 100%). The order id is
97094620091
. It's real. it's in the books.But... The
bot
recorded the response to the spot order with a price of7
.The
gateio website
shows a filled price of6.10
. Thebot
determined it bought a volume of49.9999998
(config set to 50) at an amount of7.14285714
at a price of7
. Thegateio website
shows a volume of43.571428554
at an amount of7.14285714
at a price of6.10
. Interesting, huh? If I GET the order by id (GET /spot/orders/{order_id}
), it shows anprice
of7
. Even a request by order id returns the wrong price amount. How can this be, Gateio? How can your website have a different price than your orders endpoint?The outcome of the bot says I lost -12%. But it was using an incorrect price. I actually lost less than 1% (it was $0.90 USDT).
2021-11-25 11:00:21,708 INFO: Sold ZLK with -0.9 profit | -12.857% PNL
Gate.io website trade history:![image](https://user-images.githubusercontent.com/4298131/143511383-d70535b3-e7b3-4981-80fe-e340b3ec9165.png)
Session data from the buy![image](https://user-images.githubusercontent.com/4298131/143511463-da11601b-551d-420f-a037-ef089996cebe.png)
API GET to orders/[id]![image](https://user-images.githubusercontent.com/4298131/143511340-f135aeee-0867-40e2-bbb4-eea94641336b.png)
I'm not sure there is anything we can do about this. It's a gate.io issue really.