gateio / gatews

Gate Websocket V4 SDK
89 stars 35 forks source link

multi websocket #29

Closed Ivanrputra closed 2 years ago

Ivanrputra commented 2 years ago

image

This is my code to listen price and trade order

revilwang commented 2 years ago

The code seems fine to me. Do you print the error message and find any error message on subscription?

Ivanrputra commented 2 years ago

The code seems fine to me. Do you print the error message and find any error message on subscription?

No error message, but what is the different between spot.order and spot.usertrade ?

revilwang commented 2 years ago

spot.order pushes every order update, while spot.usertrade pushes trades update. If order has no fill, then no update will be received from spot.usertrade

Ivanrputra commented 2 years ago

one

spot.order pushes every order update, while spot.usertrade pushes trades update. If order has no fill, then no update will be received from spot.usertrade

thank you for the explanation, i got one last question, when i want to know if my buy or sell order is close or fully filled which websocket should i use?

revilwang commented 2 years ago

spot.order. It pushes every order update and when the order is cancelled or finished, the event field in the order object(not the outmost event) will be updated to finish. And you can check if left is "0" to make sure if the order is fully filled.

Ivanrputra commented 2 years ago

spot.order. It pushes every order update and when the order is cancelled or finished, the event field in the order object(not the outmost event) will be updated to finish. And you can check if left is "0" to make sure if the order is fully filled.

ok thank you very much, i will close the issue