viabtc / viabtc_exchange_server

A trading engine with high-speed performance and real-time notification
MIT License
2.68k stars 1.48k forks source link

Issue in market order - ask #196

Closed sanada08 closed 5 years ago

sanada08 commented 5 years ago

In market order, if I try to buy "1" amount for any market it empty all other order in the sell. for example , if I have more than 5 sell order, I have tried to buy in market price, I will buy all other sell orders.

codeman-crypto commented 5 years ago

I am also facing the same issue, Say example I am having 10 sell orders and 20 buy orders with different price and the current market price is 0.02. Now if I place a market order(buy) using the method put_market for the amount 1 Expected Result: The amount 1 should be matched with the sell orders. Actual Result: All the sell orders got matched and the sell orders in the order book become empty and the balance has been deducted.

I am not sure is because of the wrong implementation or actually, it is a bug

lealife commented 5 years ago

For buy market order, the amount param means "how much money i want to use", not "how much coins i want to buy"

sanada08 commented 5 years ago

thanks.