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

order.put_market, amount, inconsistency #32

Open andrewshvv opened 6 years ago

andrewshvv commented 6 years ago

Hey @haipome ! We have noticed inconsistency in what we have to specify in the field amount for order.put_limit and order_put_market, and I am wondering is that was done intentionally or not.

In the command order.put_limit amount corresponds to the number of stocks user wants to buy/sell.

In the command order.put_market when we use bid side amount corresponds to number of money user wants to spend on buying the stock, and when we use ask side amount corresponds to the stock user want to sell. Wouldn't it be better to make it consistent or probably I am missing something? Thanks!

Command Side Meaning of amount
order.put_limit ask stock
order.put_limit bid stock
order.put_market ask stock
order.put_market bid money
haipome commented 6 years ago

Yes. When use put_market, the amount filed meaning is different in ask and bid. When you want use put_market to sell, the amount means the stock amount want to sell. when you want to buy, the amount means the money amount want to buy, because the price is float.

andrewshvv commented 6 years ago

Okay, thanks!

esseswann commented 6 years ago

We also have a problem with consistency of order.put_market, for such a use-case:

This puts us in a position where for Bid market order we don't allow user to input stock while for Ask market order to input money. Consistency would at least allow us to always expect input in stock like it's done on Bitfinex

haipome commented 6 years ago

@esseswann this advice is good. I can add stock or money amount in market order as an optional.

esseswann commented 6 years ago

Thanx for response and agreeing to add this feature. Can you please tell if you plan to do this any time soon so we could correct our estimates?

xtuyaowu commented 5 years ago

建了一个交易所撮合交流群: 862266237