The InstantDEX core API is shaping up pretty good:
static char *allorderbooks[] = { (char *)allorderbooks_func, "allorderbooks", "V", 0 };
static char *openorders[] = { (char *)openorders_func, "openorders", "V", 0 };
static char *orderbook[] = { (char *)orderbook_func, "orderbook", "V", "baseid", "relid", "allfields", "oldest", "subscribe", 0 };
static char *placebid[] = { (char *)placebid_func, "placebid", "V", "baseid", "relid", "volume", "price", 0 };
static char *placeask[] = { (char *)placeask_func, "placeask", "V", "baseid", "relid", "volume", "price", 0 };
static char *bid[] = { (char *)bid_func, "bid", "V", "baseid", "relid", "volume", "price", "baseamount", "relamount", "type", 0 };
static char *ask[] = { (char *)ask_func, "ask", "V", "baseid", "relid", "volume", "price", "baseamount", "relamount", "type", 0 };
static char *makeoffer[] = { (char *)makeoffer_func, "makeoffer", "V", "baseid", "relid", "baseamount", "relamount", "other", "type", 0 };
All but the last one is tested and appears to work in most cases (got stuck for some hours today to get all permutations correct). Suffice it to say it is a lot more complicated than it looks to handle all permutations of orderbooks while also accepting new orders in either polarity. Everything is looking the same, but a bit different and any mistake is getting the inverse of the price, or the volume of the other coin, so we need to really test all possibilities.
Good news is that there are only around 16 possible cases, so once they are tested it will work for all asset pairs in all polarities.
The last API call, makeoffer is how InstantDEX will allow for instant trading. But before this could work, I needed to know all the open orders a node has, so I made the openorders API call, which uncovered the polarity confusions.
Anyway, I had the makeoffer sequence done last July! so just have to port it into the current codebase and make an improvement to eliminate an obscure security hole. But we can put it into testing without that part done, so I am working toward a nofrills order matching (fill or kill) without much error handling so we can test a full cycle with the GUI.
Then as I am fixing any bugs, I will bulletproof things and add nice things like the ability to query current orderbooks remotely and create some monetization possibilities for MMatrix nodes.
It looks like I should be able to get the InstantDEX core pretty much done in the next day or two, so there will be time to start making some automated market makers and other support things. The GUI team says they are on track, so if all goes well, we will be able to test a decentralized exchange that looks and feels like a centralized one.
I know some of you are not 100% comfortable with MGW's distributed setup, especially with recent events. After I get the basic InstantDEX up and running and into testing, I will make some tradebots that will do the "deposit, trade, withdraw" that we all recommend people to do, but sometimes are forgetting to do, well this will be automated. So your funds will be in MGW just for the duration of the trade.
MGW will do this at its cost to cover txfees and the servers. I dont want there to be reasons for people to not do the "deposit, trade, withdraw" over fees. Safety first! I also have additional methods to boost security which will become a necessity when InstantDEX is reaching 100 trades per minute, as that will pretty much fill up all the NXT blocks!
I also want to make sure that the key trading pairs are liquid and have low spreads. We need a safe place to trade crypto that isnt charging big fees. InstantDEX will be this. At first not so many trading pairs will be supported, but it is structured in a way that adding new ones is pretty easy.
The NXT AE is very nice, but it only trades against NXT, it costs a txfee for each bid/ask and even for cancelling them and of course there is the occasional long time between blocks usually just as you really want to do a trade. InstantDEX solves all of these, there wont be any fees for bids and asks and trading can be against NXT or any asset. During the beta test there wont even be any trading fees other than the txfees and even when we activate the fees it will be 1/1024'th of the trade.
My goal is to make InstantDEX the lowest cost trading platform that is also the safest.
James