current price is 1000usd/bts
here is the buy order:
buy 1000 usd with 1bts
buy 1001 usd with 1bts
buy 1002 usd with 1bts
.....
buy 1100 usd with 1bts
anytime I can give a buy order with
buy 1000000000 usd with 1bts
And I can give a short with
short 10000000000 usd with 1bts
So there is a line of people each wanting to buy about 1000 usd for 1 bts ....
And along comes someone who wants to sell 1000,0000 usd for 1 bts....
Assuming he actually had this usd (ie it was a long/long sale) then the market should match him against all of the buys (4103 usd), give the seller his .0001 bts and earn 3.999 bts in fees for the network because the seller was an idiot and sold way below market.
Now in the event of a short position the result of this move should be...
Buyers get 4103 usd and the short seller ends up short -4103 with collateral of 4 bts (from buyers) + .0001 bts (from himself) which would seem to justify a margin call immediately... thus I need to adjust the short-sell code to always use the price of the bids to determine required collateral (bts) or this kind of abuse could carry on.
Let me look into it a tad more and if it pans out I will send 25 PTS your way for finding this.