Through researching order execution algorithms I came upon something rather strange.
My dev team wrote a program that captures live bitcoin trades on bitstamp through the WebSocket API for a single full day. It then dumps all this into a CSV file.
Here is where it does not make sense to me. Normally for a trade, you would get the following.
56949997 0.02126427 0.02126427 1062946869 10915.7 10915.7 1062945930 1520021163 0
The format of above is id, amount, amount_str, buy_order_id, price, price_str, sell_order_id, timestamp, and order type.
Here is what I don't understand. In this data we are seeing orders where the timestamp, amount, and order ids are exactly the same, however, the order type is different on both (first order being a buy second being a sell)
How can it be that the same order is both a buy and a sell? I had a few theories.
Number one is a bug in bitstamps system that when you cancel an order it places that to cancel it out (although this does not make sense to me as for why would it be placed in the ticker when the trades cancel themselves out)
2 it is an HFT bot that is trying to do quote stuffing or some other form of predatory HFT behavior.
3 bitstamp is doing this to fake volume.
Here is a link to download the dataset.
I am seeing numerous examples of this, check ID 56950065 to see for yourself.
If anyone has any idea what this may be it would be greatly appreciated if you could fill me in.