fluidex/dingir-exchange

bug: closedorders and openorders are not mutually exclusive

Closed this issue · 1 comments

lispc commented

https://github.com/Fluidex/dingir-exchange/blob/9dc072a081e1c8e9d338e4bdc5c8b22c56d81655/src/message/persist.rs#L574

OrderMessage.event can be PUT/UPDATE/FINISH. In the above code, all these three types of OrderMessages are inserted into the 'OrderHistory' table.

But we query 'OrderHistory' table for 'closedorders' api. So some non closed orders appears in the response.

I think we should only persist 'FINISH' order into the OrderHistory table.

UPDATE/PUT message will be used for websockets APIs later.

closed via #83