-
Notifications
You must be signed in to change notification settings - Fork 2
/
SPECS
executable file
·156 lines (119 loc) · 5.22 KB
/
SPECS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
********** DRAWING W/GRAPH **************
Drawing a step dataset onto graph:
i.e. where all lines are constant horizontal and values change by jumping
Use graph.drawStep(historyDataSet, curentData, styleClassName);
historyDataSet -> 2Darray of all steps in history. each entry in first array looks like [startTime, endTime, startPrice, endPrice]
curentData -> curent status of the step graph. looks like: [startTime, price, slope] or Null if currently graph is empty.
styleClassName -> string identifier for the css class that should be used to draw lines of this graph.
********** MARKET FORMAT **************
Orders have a maximum price of 199,999.9900. If a price of 214,748.3647 is specified, then the order is considered a market order with limit infinity.
These values come from the OUCH 4.2 specifications. If the IOC flag is specified, then if the transaction is not immediately completed the order is canceled.
Order objects have the following format:
{
price -> int: order price
id -> string: id of player who placed order
timestamp -> int: time at which order was placed
}
********** MESSAGE STRUCTURE **************
General Structure:
Message {
protocol -> string: Gives general idea about type of message and what protocol this message should use. Three types:
- "OUCH" Message sent to enter buy/sell offer or change market in some way.
- "ITCH" Message sent to inform about market state.
- "USER" Message generated by user interacting with UI.
- "SYNC_FP" Message sent by player on FPC
delay -> boolean: for messages going from subject through group manager only. Indicates if this message should be delayed.
timestamp -> int: time at which message was created.
msgType -> string: indicates what type of message this is. Example: "ESELL" = enter sell message
msgData -> array: Various information included with message, content varies by message type.
}
Outside investor id is 0
Specific Message Structures:
OUCH Messages:
Enter Buy Order:
protocol -> "OUCH"
msgType -> "EBUY"
msgData -> [buyer-id, price, IOC]
Enter Sell Order:
protocol -> "OUCH"
msgType -> "ESELL"
msgData -> [seller-id, price, IOC]
Remove Buy Order:
protocol -> "OUCH"
msgType -> "RBUY"
msgData -> [buyer-id]
Remove Sell Order:
protocol -> "OUCH"
msgType -> "RSELL"
msgData -> [seller-id]
Update Buy Order:
protocol -> "OUCH"
msgType -> "UBUY"
msgData -> [buyer-id, price]
Update Sell Order:
protocol -> "OUCH"
msgType -> "USELL"
msgData -> [seller-id, price]
ITCH Messages:
Fundamental Price Change:
protocol -> "ITCH"
msgType -> "FPC"
msgData -> [change-time, new-price, price-change-index]
Confirm that Buy Order was Entered:
protocol -> "ITCH"
msgType -> "C_EBUY"
msgData -> [buyer-id, price, time-order-entered]
Confirm that Sell Order was Entered:
protocol -> "ITCH"
msgType -> "C_ESELL"
msgData -> [seller-id, price, time-order-entered]
Confirm that Buy Order was Removed:
protocol -> "ITCH"
msgType -> "C_RBUY"
msgData -> [buyer-id, time-order-entered]
Confirm that Sell Order was Removed:
protocol -> "ITCH"
msgType -> "C_RSELL"
msgData -> [seller-id, time-order-entered]
Confirm that Buy Order was Updated:
protocol -> "ITCH"
msgType -> "C_UBUY"
msgData -> [buyer-id, price, time-order-updated]
Confirm that Sell Order was Updated:
protocol -> "ITCH"
msgType -> "C_USELL"
msgData -> [seller-id, price, time-order-updated]
Confirm that Transaction has taken place:
protocol -> "ITCH"
msgType -> "C_TRA"
msgData -> [time-stamp, buyer-id, seller-id, price]
USER Messages:
Round Start Message:
protocol -> "USER"
msgType -> "START"
msgData -> [start-time, initial-fundamental-price]
User Enter Market:
protocol -> "USER"
msgType -> "UENTM"
msgData -> -1
User Exit Market:
protocol -> "USER"
msgType -> "UEXTM"
msgData -> -1
User Update Spread:
protocol -> "USER"
msgType -> "UUSPR"
msgData -> [user_id, new-spread-value]
SYNC_FP Messges:
Out of Market:
protocol -> "SYNC_FP"
msgType -> "NONE"
msgData -> [uid, speed, price-change-index]
Update Offers:
protocol -> "SYNC_FP"
msgType -> "UOFFERS"
msgData -> [uid, speed, price-change-index, spread]
Snipe:
protocol -> "SYNC_FP"
msgType -> "SNIPE"
msgData -> [uid, speed, price-change-index]