Xud: [Concept] Safety net for market orders

Created on 28 Aug 2018  路  6Comments  路  Source: ExchangeUnion/xud

Safety limit: convert market into multiple limit orders with retries up to a max % from mid market price at time of order issuance

P2 questiotbd

All 6 comments

I'm not sure I follow exactly, this turns market orders into limit orders based on the average of best bid and ask? Is this in use on exchanges?

I'm not sure I follow exactly

Takes the mid market price at the moment of issuance of the market order (saves it in midmarketprice), then creates limit orders for market order quantity to fill currently available orders per orderbook, starting from price optimum. Checks that prices of these doesn't exceed +- X% from midmarketprice. If some of the limit orders fail, retries limit orders based on order book at this point of time, again checks that they don't exceed +- X% from midmarketprice. Keeps running until all filled.

Is this in use on exchanges?

Not that I'm aware of.

I'd be hesitant to do this, it seems fairly complex (particularly in splitting a market order into limit orders) and I'm not sure we want to fiddle with the concept of a market order, particularly when interfacing with exchanges that do use regular market orders. Maybe there are some other safety checks we could consider, but ultimately my feeling is that this responsibility falls on the users and especially exchanges. Even if we have a feature like this, it's still possible to put in the wrong quantity, wrong price on a limit order, etc... For exchanges, they can apply the same checks they use internally on the orders they submit to XU.

Complex, I agree and definitely not a focus (that's why 1.0.0). This feature is not meant for exchanges, but for individuals trading via xud. I would want to leave it open to revisit later.

I think we could leave this order splitting logic implementation to the API user. And I suggest we should not use market order in this case in order to make the market order conceptually the same as the original definition.

And for some market order variants we should use other order types to distinguish with the original market order like the stop order, iceberg order and etc. IMO complex order could be dismantled as basic orders + event hooks and expose those functionalities as core module API. @kilrau

Alright. Everybody ok to close this?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kilrau picture kilrau  路  6Comments

moshababo picture moshababo  路  6Comments

erkarl picture erkarl  路  6Comments

kilrau picture kilrau  路  4Comments

kilrau picture kilrau  路  5Comments