Bitcoin Forum
November 23, 2019, 02:35:13 AM *
News: The forum is 10 years old today!
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Building a great Bitcoin exchange, part IV: the partial execution problem  (Read 656 times)
aes1
Member
**
Offline Offline

Activity: 66
Merit: 10



View Profile
April 20, 2013, 09:49:59 AM
 #1

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 Wink)
1574476513
Hero Member
*
Offline Offline

Posts: 1574476513

View Profile Personal Message (Offline)

Ignore
1574476513
Reply with quote  #2

1574476513
Report to moderator
1574476513
Hero Member
*
Offline Offline

Posts: 1574476513

View Profile Personal Message (Offline)

Ignore
1574476513
Reply with quote  #2

1574476513
Report to moderator
1574476513
Hero Member
*
Offline Offline

Posts: 1574476513

View Profile Personal Message (Offline)

Ignore
1574476513
Reply with quote  #2

1574476513
Report to moderator
The Bitcoin Forum is turning 10 years old! Join the community in sharing and exploring the notable posts made over the years.
1574476513
Hero Member
*
Offline Offline

Posts: 1574476513

View Profile Personal Message (Offline)

Ignore
1574476513
Reply with quote  #2

1574476513
Report to moderator
1574476513
Hero Member
*
Offline Offline

Posts: 1574476513

View Profile Personal Message (Offline)

Ignore
1574476513
Reply with quote  #2

1574476513
Report to moderator
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2128
Merit: 1009

Newbie


View Profile
April 20, 2013, 02:13:22 PM
 #2

Prices on professional exchanges are "ticked". Do the same thing with amounts and "1.00000001" won't be placed in orders.
QuantPlus
Sr. Member
****
Offline Offline

Activity: 280
Merit: 250



View Profile
April 20, 2013, 03:25:27 PM
 #3

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.



Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!