Revision History
1/15/97
Version 2.13
Added back in Status "T". This type has always been there, but it dropped out of the spec when I restored everything. Same thing for Type "R". Sorry.
1/8/97
Version 2.12
The plot thickens. Here we are, less than a week from implementation and we still don’t know what the rule is. The latest update is that there probably will be a SelectNet broadcast and ECNs will only be permitted to enter quotes in the "nifty fifty" stocks. So what does that mean for Island? Well, any orders you enter into Island in the 50 stocks will be represented in the NASDAQ montage as market maker identifier ISLD. Any other stocks will get routed to the SelectNet broadcast as before. This means that Status A,M and U return to the spec. I’ll keep you posted.
12/20/96
Version 2.11
Ok, everyone thinks this new spec is too hard to implement on time, so I’m making it simple. No more persistent partials, everything remains as it was in 2.0 except we simply drop the "A", "T", and "W" statuses. If you get a partial execution, your remaining shares are automatically canceled. You still need to implement the new Island Update message because other interfaces can do partials. Hey, you get the MMID of people coming in from SelectNet. If you can’t even deal with this, let me know and I’ll give you a special port that emulates the old style Island Out Messages. The login stuff is there, but you don’t have to implement it if you don’t want to. You can ignore the Good Night message too.
12/19/96
IHOST SPEC version 2.1
The NASD SR-96-43 is just around the corner, so I must make these changes. They will go live the same day NASDAQ rolls out their stuff. I have test systems up for you to play with before then.
The biggest change is the behavior for partial executions. Previously, if you got a partial execution you were automatically out on the remaining shares. Now, your remaining shares stay on the book until you cancel them or they executed. It is possible to get multiple executions from one order. Check out the Execution Message for changes.
I killed Accept, Take Out, and Pre-Execution statuses because I don’t need them anymore now that SelectNet is out of the loop. Everything should go really fast now.
I changed the status U R Out status (U) into it’s own message (R) so that you know how many shares you are out on.
I converted the Island Dead message (O) to Island Update to accommodate partial executions. I also added the MMID of the executing broker for external executions.
I added a Login message (L) so that it is viable to leave dialup connections running. If you are running dedicated lines and don’t want to have to Login, let me know. Of course, I also added the Denied (M) message if you get the password wrong.
I also added a Good Night message (N).
9/20/96
Here is IHOST SPEC version 2.0. I know a skipped a version in there somewhere, cut me some slack.
5/6/96
Described that the time field in a HeartBeat message represents the number of seconds after midnight.
Added a price field and side field to the Execution Report message.
Added message types "Q" and "C" to handle spins in the Order Dissemination Service.
5/8/96
Added Broken trade state for trades that are clearly erroneous.
Added Unknown TOKEN state.
5/11/96
Added a line to Overview stating that Island only handles NASDAQ listed stocks.
Changed the Status Request message sent by an ICleint from "S" to "U" to avoid routing problems.
5/16/96
Added a clarification to the Island Out message explaining that an Execution may not mean complete fill.
5/20/96
Added status T message for takeout orders.
Changed SPEC to "BETA" from "VERY BETA"
IHOST
SPEC 2.13
Overview
IHost is the interface to the Island trading system. Island accepts orders from participants and disseminates all orders to all participants. Matching orders are executed against each other. All participants are anonymous. The top of the Island book is represented in the NASDAQ quote by the ISLD identifier to give Island orders the maximum opportunity for discovery. Non-Island subscriber NASD members can execute orders out of the Island book by preferencing a SelectNet order to Island. Only NASDAQ listed symbols may be traded on Island at this time. Island accepts orders from about 8:00 AM to about 4:30 PM EST, but those hours could be extended. Island does not accept GTC orders, all orders are dead when Island closes each night.
Architecture
IHost lives directly on the sponsor’s network. It acts as a gateway to the subscriber. The IClient usually will be a subscriber developed gateway into the subscriber’s systems. All communications between the IHost and the IClient are based on variable length, flat ASCII encoded messages. The shortest message it 1 byte, the longest about 80 bytes. The actual transport protocol between the IHost and IClient is not defined, but could be TCP/IP, PPP, X.25, IPX, NetBios, BiSync, or any robust and efficient protocol that insures notification of lost messages. For development purposes, I set up a very simple protocol using RS-232 async, no parity , 8 data bits, 1 stop bit. Each message in either direction is preceded by an ASCII STX (0x02) and followed by an ASCII ETX (0x03). There is no error checking at all. While this is probably not robust enough for production, it’s very handy for development. You can dial into an IHost using standard V.42 modems and get things up quickly. It’s also nice to be able to put a trace-back right on the communication link for debugging. When running TCP/IP, IHost accepts connections on socket number 0x6767 (hex).
Services Available
Currently IHost provides two services, the Order Entry Service and the Order Dissemination Service. Both services are currently delivered over the same line, but could be delivered alone or separately if necessary. The Message Type field indicates the appropriate service. It is very important that you ignore any unknown message types so that I can extend the spec without breaking your code.
The Order Dissemination Service is basically a broadcast feed. It disseminates information about every order entered into Island by any participant. This lets each participant keep a local book representing every order in Island for query and display.
The Order Entry Service is a two-way dialog between the IHost and the IClient. The IClient enters and cancels orders, and the IHost executes or updates the status on those orders. Note than when you enter an order into the Order Entry Service, you will also see that order show up in the Order Dissemination Service as it is broadcast out to everyone.
IClient
The IClient is any machine that manages the communication to the IHost. There is one IClient for each IHost. The IClient can be a front end if there will only be one user, or more likely it will act as a gateway for multiple users at one subscriber site. One subscriber can have multiple IHost-IClients for load balancing or redundancy. I have written a very simple example IClient to give you an idea of what it could look like. Let me know if you want the source code.
Island Order Entry Service
Entering Orders
To enter an order into Island, first you must generate a day and IHost unique TOKEN that will track the order though the system. You can use any alphanumeric string that is four letters long. It can contain A-Z,0-9. That’s 1.5 million possible orders per IHost per day. Stick with all caps for now. I like to use the first letter to identify the user on this IClient and the last three letters as a sequence number. That allows 36 users and 50,000 orders per user per day. If you try to enter an order with a TOKEN that you have already used that day, the order will be rejected.
Order States
An order is considered transmitted when the IClient has generated a TOKEN and sent the Enter Order message to the IHost. Once transmitted the order will pass though a number of states until it’s death. On each transition you will receive an unsolicited Status Report informing of the current state.
STATE: L
TITLE: Received
The order has been received by the IHost and entered into Island.
STATE: T
TITLE: Takeout Received
The order has been received and routed to Island's takeout engine. The next message you get will either be an execution or a U R Out.
STATE: M
TITLE: Duped TOKEN Reject
You will get this message instead of a Received if you try to reuse a TOKEN. This most recently entered order is now dead. The state of the original order is unchanged.
STATE: J
TITLE: Rejected
The order was rejected by Island and is now dead. Possible reasons for rejection include bad symbol, bad price, outside of operating hours, or not enabled IHost.
STATE: E
TITLE: Executed
An execution message is different from a standard status message because it also includes a Shares field. This indicates that part or all of the order was matched.
STATE: K
TITLE: Unknown Token
This state is only sent as a response to a Request Status or Cancel Order message. It indicates that the IClient referenced a token that is not known to the IHost.
STATE: B
TITLE: Broken
This state indicates that the Island trade that was previously executed is now broken. Trades are usually broken because of a clearly erroneous price.
STATE: A
TITLE: Accepted
SelectNet has accepted the order. This tells you that the details of the order were valid and it is now available to the street for possible execution. It is possible to get an execution without ever getting an Accepted message if the order matches internally on Island.
STATE: J
TITLE: Rejected
The order was rejected either by Island or SelectNet and is now dead. Possible reasons for rejection include bad symbol, bad price, outside of operating hours, or a NASDAQ trading halt.
STATE: X
TITLE: Pending Cancel
A Cancel Order message was received by the IHost. The order is still alive until you get a You Are Out message or an Execution message (too late to cancel).
STATE: U
TITLE: You Are Out
This indicates that nothing was done on the order and the order is now dead. It could be the result of a Cancel Order or just the order having it’s Time In Force expire.
STATE: W
TITLE: Pre-Execution
This message indicates that Island has matched the order. An execution should follow immediately. You can safely ignore this message, however you may want to use it to indicate to the user as soon as possible that the order has been executed even though the details are not yet available.
Message Formats
Each message in either direction always begins with a single letter type code. This code also defines the length of the message. The format of the remainder of the message depends on the type code.
All alphanumerics (a) should be all caps. All integers (i) should be right justified, space or zero padded. All fixed decimals (f) should be left padded with spaces or zeros and right padded with zeros.
TYPE: E
TITLE: Execution Report
SENDER: IHost
LENGTH: 11
FORMAT: "E"+token(a4)+shares(i6)+price(f4.5)+side(a1)
shares: The number of shares executed.
price: Execution price.
side: The ACT side to be reported by the IClient.
‘O’: Order Entry Side (AO)
‘M’: Market Maker Side (AM)
An execution report tells you that a previously entered order has been executed. The execution price may be superior to the entry price. Once you get an execution report, the order is dead. Any remaining shares must be reentered. You can safely ignore the side field, it is left over from the days when the client was responsible for ACTing the trade.
TYPE: S
TITLE: Status Report
SENDER: IHost
LENGTH: 6
FORMAT "S"+token(a4)+status(a1)
status: The current state, "L", "M", "J", "K", "B","W","U"
You will receive an unsolicited status message for each phase of an entered order’s life. You can also solicit a status message by a Status Request message or a Spin Request message. Note that if an order’s status is Executed (STATE=E) you will get an Execution Report (TYPE=E) message rather than a Status Report (TYPE=S) message to report on it’s status.
TYPE: O
TITLE: Enter Order
SENDER: IClient
FORMAT: "O"+token(a4)+buy_sell(a1)+shares(i6)+stock(a5)+price(f4.5)+tif(i2)
buy_sell: "B", "S" or "T" for Buy, Sell or sell shorT.
shares: Integer number of shares.
stock: NASDAQ symbol for stock, right padded with a space if needed
price: Limit price as 4 whole numbers, ".", 5 decimals. (like 1234.12500).
For now, only 1/32nds are supported, any smaller fractions will be rejected
tif: Time In Force, the minutes before the order expires, from 1 to 90 minutes.
TIF of 0 indicates Fill or Kill, if there is no matching order available, this order is canceled. Fill or Kill orders are not disseminated.
TIF of 99 indicates a Day order. Day orders remain in force until the end of the current trading day, or until they are canceled with a Cancel Order message.
This enters a new order into Island. You should get back a status Received message immediately, followed by a status Accepted message. If you try to reuse an already entered TOKEN, you will get back a Duplicate Token Reject message.
TYPE: X
TITLE: Cancel Order
SENDER: IClient
FORMAT: "X"+token(a4)
This will attempt to cancel the order. You should get back a Pending Cancel acknowledging your intent to cancel, quickly followed by either a You Are Out or by an Execution if you were too late to cancel.
TYPE: U
TITLE: Status Request
SENDER: IClient
FORMAT: "S"+token(a4)
This lets you asynchronously check the status of any order entered. You should get back either a Status Report or an Execution Report depending on the state of the order. You should never need this unless your line goes down or your database is lost.
TYPE: P
TITLE: Spin Request
SENDER: IClient
FORMAT: "P"+what(a1)
what: The type of spin requested,
"O" Spin all orders that I’ve entered today that remain open.
Responds with Status Report messages.
"E" Spin all orders that I’ve entered today that were executed.
Responds with Execution Report messages.
This lets you initiate a spin cycle. A spin is a complete refresh of data. It is useful in recovering from a fault condition where the current database may be incomplete. Spins always start with the beginning of the day and continue until they catch up with current data. The two types of spins can be running concurrently. If you request a spin and a spin is already running on that type, the running spin will be reset to the beginning of the day and continue until it is caught up.
TYPE: R
TITLE: Spin Response
SENDER: IHost
FORMAT "R"+ token(a4)+status(a1)+buy_sell(a1)+oeshares(i6)+
stock(a5)+oeprice(f4.5)+tif(i2)+exshares(i6)+exprice(f4.5)+side(a1)
oeprice: The price the order was entered with
oeshares: The number of shares entered
exprice: The execution price or 0 if the order is not executed
exshares: The number of shares executed or 0 if the order is not executed
This message comes in response to a Spin Request. It gives you all the info you need to rebuild your database in a fault condition.
TYPE: D
TITLE: End of Spin Marker
SENDER: IHost
FORMAT: "D"+what(a1)
This message comes at the tail of an IClient requested spin. It just indicates that the spin has caught up to current data and is terminating. You can safely ignore this message.
TYPE: H
TITLE: Heartbeat
SENDER: IHost
FORMAT: "H"+time(i5)
time: Number of seconds since midnight
This message is stuffed onto the line at least once per minute. It lets you know that there is an active IHost on the other side during idle periods. It also can be use to sync your clock to IHost time, which should be the same as NASDAQ time, which should be the same as NIST time. Anytime you receive a Heartbeat, you should send out a Heartbeat Response message as soon as possible.
TYPE: G
TITLE: Heartbeat Response
SENDER: IClient
FORMAT: "G"
You should send this message any time you hear a Heartbeat. This just lets IHost know that you are still there and keeps track of your average round-trip end-to-end delay. If we see that the delays are becoming significant, we can upgrade the communications link. Also, if I don’t hear you answering for a while, IHost sounds an alarm, logs you off, and if you so desire, can cancel all your open orders.
TYPE: L
TITLE: Login
SENDER: Iclient
FORMAT: "L"+password(10)
You need to send this message before entering any real orders. If you don’t send a login, you will stay in non-enabled mode where you will get all the data, but any order you try to enter will be rejected. Send a login every time you connect. I will assume you have logged out if you don’t answer three Heartbeat messages. You can assume your Login worked unless you get a Denied message. If you are using a dedicated connection or do not want to implement this function, let me know and I can set your Ihost to default into an enabled state.
TYPE: M
TITLE: Denied
SENDER: Ihost
FROMAT: "M"
This is a possible response to a Login message indicating that your password was wrong. You will stay connected and still get data, but you won’t be able to enter any orders. You should generate a message to your supervisory users. You can also get a Denied message if you miss several Heartbeats in a row. If this happens, just login again.
Island Order Dissemination Service
Databasing Disseminated Orders
You will receive a message for every order entered into Island by any subscriber. You will probably want to database these orders so you can provide an Island Quote to your users showing all open orders in a stock with the best orders listed first. You also may want to integrate these orders into a ticker for the users. A unique key called the Branch Sequence Code identifies every disseminated order. The BRSEQ is unique for every order ever entered into Island. Every order in Island is assigned a unique BRSEQ on entry. Right now, it is 4 alphas and 4 digits. It has nothing to do with the TOKEN. The TOKEN identifies your orders to you, the BRSEQ gets assigned by Island and is shown to everyone. For example, you enter an order with the TOKEN A123, you get back an accept on your order TOKEN. You will also see your order show up in the Dissemination feed with an unrelated BRSEQ, like MGDA2113. You could even enter another order that matches off on your first order and have them execute.
Once an Island order is dead, you may want to delete it from your database to keep your database small. You may also want to save the order and provide a sort of Island "times and sales" for the users.
TYPE: I
TITLE: Island Alive
SENDER: IHost
FORMAT: "I"+brseq(a8)+ buy_sell(a1)+shares(i6)+stock(a5)+price(f4.5)+tif(i2)
brseq: The key that will be used to reference this new order and update it’s status.
buy_sell: "B" for contra wants to buy, "S" contra wants to sell.
shares: Number of shares available to execute.
stock: NASDAQ stock symbol.
price: Limit Price in fixed decimal format, i.e. 25 1/8 would be " 25.12500".
tif: Time in Force. See type "O" for details.
This message informs for the a new order has been entered into Island and is available to you for viewing or execution. This message always shows what the contra wants to do, so a type "I" sell order means that you would be buying if you executed against it. The brseq uniquely identifies each order in Island. The IClient should database all Island Alive orders received and index them by stock and price so you can give users a best bid/offer quote on request. Time in Force is provided for display purposes only, you do not need to age Island orders, you will receive an Island Dead message when an order expires.
TYPE: O
TITLE: Island Update
SENDER: IHost
FORMAT: "O"+brseq(a8)+executed(n8)+leaves(n8)+mmid(c4)
executed: The cumulative number of shares that have been executed.
leaves: The total number of unexecuted shares left. When zero, this order is dead.
Mmid: The Market Maker I.D. of the executing broker, or "####" if Island
This message informs you that an Island order that was transmitted as an Island Alive has been executed or canceled, in whole or in part. The brseq will reference a previous Island Alive message. There should eventually beat least one Island Update message for each Island Alive message. When an Island Update message is received with zero in the leaves field, you may wish to delete the order from your database.
The MMID field will show the contra broker if the order was executed on SelectNet. The MMID field will contain "####" if the order was executed internally on Island. The MMID field will be all spaces if this is a non-execution message. Also, please note that I feel that the MMID field represents very valuable information and I do have the ability to filter it out for people who are clearly not using Island as their primary book.
TYPE: Q
TITLE: Dissemination Spin Request
SENDER: IClient
FORMAT: "Q"+what(a1)
what: The type of spin requested,
"O" Spin all Island orders that are currently available for
execution.
Responds with Island Alive messages.
This lets you initiate a spin cycle in the dissemination service. A spin is a complete refresh of data. It is useful in recovering from a fault condition where the current database may be incomplete. Spins always start with the beginning of the day and continue until they catch up with current data. If you request a spin and a spin is already running on that type, the running spin will be reset to the beginning of the day and continue until it is caught up.
TYPE: C
TITLE: End of Dissemination Spin Marker
SENDER: IHost
FORMAT: "C"+what(a1)
This message comes at the tail of an IClient requested spin. It just indicates that the spin has caught up to current data and is terminating. You can safely ignore this message.
Common Messages
The following Common Messages appear as part of both the Order Dissemination Service and the Order Entry Service. When the services are delivered over a single line, these messages will appear only once.
TYPE: T
TITLE: Text Alert
SENDER: IHost
FORMAT "T"+message(a70)
You should quickly display this message to users, preferably in a pop-up window. The text will be padded with spaces to the right. I try not to send too many of these, so the one I do send are usually important. Example: "TNASDAQ has suspended SelectNet, so Island orders are not mirrored"
TYPE: N
TITLE: Good Night
SENDER: IHost
FORMAT "N"
This is the last message sent out before Island shuts down for the night. It should come at around 16:30 EST for now, but could come much later.