Bitcoin Forum

Economy => Trading Discussion => Topic started by: Dirk83 on April 29, 2013, 01:14:24 PM



Title: Order Management System
Post by: Dirk83 on April 29, 2013, 01:14:24 PM
Hi,

I want to create an order management system; can someone with experience with the Websocket API as well as the HTTP API shortly tell the pros and cons of the two for inserting/deleting/updating/showing orders? I already (partly) wrote the logic to calculate which orders I wanted to insert and I am coding in a Javascript/HTML/PHP environment.

Is there a difference in reliability between the Websocket and HTTP API for inserting/deleting/updating/showing orders?

Thanks, Dirk.


Title: Re: Order Management System
Post by: nfurno on April 29, 2013, 01:23:10 PM
I think the toughest part is the transaction logic against your database. I primarily use MS SQL and for something like this most of the time goes into the transaction code so that either all steps of the transaction succeed, or the whole thing fails and no change is made.  I do alot of work verifying that the changes my code makes to the DB are actually the ones i expected to happen.  In a current project i am doing against MtGox API, i make trades and then cross check all of the values in my wallet, transaction log and each element of the mtgox completed order record to make sure that the order completely executed (sometimes there are multiple actual transactions that happen to fulfill one mtGox order, and they return the results of each individual transaction).  Being able to PROVE that your system does exactly what it's supposed to do every time while preventing any undesirable changes to the DB via bad data, unexpected values or values out of the range of your normal expected values is very important.


Title: Re: Order Management System
Post by: nfurno on April 29, 2013, 01:28:15 PM
i forgot to share one important situation that came up recently related to my last post.
When MtGox suspended fees, that threw an exception in my code. it refused to react to the completed order because it couldn't verify what the fees were.
I found the API returned a success with a null array (Basically, "Result:Success { }")
I had to rewrite that section to watch for the success and allow 0 fee objects to be an acceptable path.
Stuff like this can really mess up your day.


Title: Re: Order Management System
Post by: Dirk83 on April 29, 2013, 02:44:09 PM
Thanks, that makes sense.

Does anyone know if there is something available (pref open source) that I can integrate easily in my own Javascript/HTML/PHP based trading system?