Post
Topic
Board Service Discussion
Re: Mtgox trades per second
by
kiko
on 12/04/2013, 12:14:49 UTC
I've downloaded the list of all trades executed on Mtgox over the past 24 hours (there's an API URL for that), and wrote a tiny script to count the number of trades during every 1-minute interval.

Turns out, the single worst minute saw SIX trades per second. The top 15 worst 1-minute intervals saw an average of 3.8 trades per second.

Let's try to estimate how many trades per second their engine is capable of. The worst lag I saw over the past 24 hours was about 500 seconds, i.e. 8 minutes. Let's simplify this a lot, and assume that this lag was created after the worst 1-minute interval, when Mtgox saw 370 trades. In the most conservative scenario, a lag of 8 minutes would mean that these 370 trades took 7 minutes to execute (this is a bit of an approximation, but I think it's close enough).

That gives us an upper bound on Mtgox trading engine speed of just 0.9 trades per second.

This is so ridiculous that I have to wonder if I made a mistake somewhere. But if I didn't, their trading engine was written by monkeys (something that everyone seems to agree on anyway).

No, you are correct. I've been thinking the same thing for months. I just can't get my head around how it could be that slow. It must be re-sorting the entire order book on every order, added or removed. Not just re-arranging pointers. but actually copying the data on disk, every time. I just can't think of another way it could be slower.

[BTW. this kind of thread really belongs in Service Discussion for future reference.]