Bitcoin Forum

Economy => Trading Discussion => Topic started by: aes1 on April 20, 2013, 09:49:59 AM



Title: Building a great Bitcoin exchange, part IV: the partial execution problem
Post by: aes1 on April 20, 2013, 09:49:59 AM
Imagine a bitcoin exchange with the usual continuous double auction model.

When you place a limit order, the exchange must be able to implement it in parts. (Otherwise it would have to find two equal and opposite orders - difficult.)

Suppose that the exchange tracks USD amounts fairly precisely, say to 4 digits.

Also suppose that bitcoins are tracked with the precision of one satoshi. So you can own 1.00000001 bitcoins, for example.

Now consider the following situation:

1. Trader A makes a request "Buy 1 BTC @ 100 USD", making it the highest bid at the time. There's no matching sell order, so the order will be placed on the top of the order book.

2. Trader B makes a request "Sell 1.00000001 BTC @ 100 USD" and the exchange finds that there is a matching order. But the order cannot be executed completely, since the buyer only wants 1 BTC. So the order needs to be split into parts: "Sell 1 BTC @ 100 USD", which is executed immediately, and "Sell 0.00000001 BTC @ 100 USD".

Now the most competitive sell order is left with 1 satoshi. That's not the problem, but the problem is that the value of this order is 0.00000001 * 100 USD = 0.000001, which is 100 times smaller than the smallest representable USD amount.

So what should the exchange do with this order?

1. Execute the remaining sell order with no counterparts, i.e. collect 0.00000001 BTC from the seller as a "fee" (but in the case of the buy order, it would have to donate 1 satoshi to the buyer, some traders might be tempted to abuse this feature).

2. Leave the sell order in the order book, possibly making matching of further orders more complicated.

3. Just delete the remaining sell order as worthless. (Now the seller would be puzzled as to why his sell order wasn't fulfilled completely.)

4. Avoid the situation by only allowing BTC transfers and ownership to a precision of 0.00001 BTC. Now what if someone transfers in 0.00012345?

5. Allow USD amounts to be represented with more precision. I'm not sure I want that, either.

I think all of the alternatives have disadvantages (however slight they may be). Is there another way?

(No, I didn't try to do this at Mt.Gox. I'm afraid it might crash their trading engine ;))


Title: Re: Building a great Bitcoin exchange, part IV: the partial execution problem
Post by: Come-from-Beyond on April 20, 2013, 02:13:22 PM
Prices on professional exchanges are "ticked". Do the same thing with amounts and "1.00000001" won't be placed in orders.


Title: Re: Building a great Bitcoin exchange, part IV: the partial execution problem
Post by: QuantPlus on April 20, 2013, 03:25:27 PM
Prices on professional exchanges are "ticked". Do the same thing with amounts and "1.00000001" won't be placed in orders.

I don't see why a BTC "tick" should be more than 0.01 = $1.20/BTC ...

Smaller orders are called "odd lots" and are handled differently...
They do not appear in Order Book and have special rules for execution.

An exchange is not a free public service...
That's why you have rules to eliminate spamming, etc.