-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenfeed_instrument.proto
366 lines (282 loc) · 9.35 KB
/
openfeed_instrument.proto
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
/**
* Copyright (C) 2011-2017 Barchart, Inc. <http://www.barchart.com/>
*
* All rights reserved. Licensed under the OSI BSD License.
*
* http://www.opensource.org/licenses/bsd-license.php
*/
syntax = "proto3";
package org.openfeed;
option java_multiple_files = true;
option java_generate_equals_and_hash = true;
option optimize_for = SPEED;
message InstrumentDefinition {
/// Unique ID used in the data feed.
sint64 marketId = 1;
/// Instrument type as enum...
InstrumentType instrumentType = 2;
/// Supported Book Types
repeated BookType supportBookTypes = 3;
/// Maximum depth of market-by-price order book
sint32 bookDepth = 4;
/// The name of the market data vendor
string vendorId = 5;
/// Human readable market symbol, assigned by the exchange or venue.
// Not necessarily unique as the exchange or vendor could assign the same symbol to different
// instruments, for example if the instruments trade on different exchanges.
string symbol = 6;
/// Human readable market description.
string description = 7;
/// Market CFI code: http://en.wikipedia.org/wiki/ISO_10962
string cfiCode = 8;
/// Market currency code: http://en.wikipedia.org/wiki/ISO_4217
string currencyCode = 9;
// Market exchange code: http://en.wikipedia.org/wiki/ISO_10383
// For inter-exchange spreads, use the leg MICs separated by a hyphen
string exchangeCode = 10;
/// Minimum price increment in market currency.
float minimumPriceIncrement = 11;
/// Contract point value in market currency.
float contractPointValue = 12;
/// Trading schedule for a typical week
Schedule schedule = 13;
/// Trading calendar (expiration, notice days, holidays?, etc)
Calendar calendar = 14;
/// UTC Timestamp of creation, nano seconds since Unix epoch
sint64 recordCreateTime = 15;
/// UTC Timestamp of update, nano seconds since Unix epoch
sint64 recordUpdateTime = 16;
/// Market time zone TZ database name.
// Permanent. Can be resolved into timeZoneOffset for given date/time.
// See http://joda-time.sourceforge.net/timezones.html
// See http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
string timeZoneName = 17;
/// Identifies a logical grouping of instruments. By product, for example.
string instrumentGroup = 18;
/// The Date of expiration for futures and options.
MaturityDate symbolExpiration = 19;
/// active: can have market state updates, can have historical data
// passive: can NOT have market state updates, but can have historical data
// normally "active" means newly listed or currently non expired markets
// normally "passive" means expired options, de-listed equities, etc.
State state = 20;
/// The channel that updates for this instrument will appear on.
sint32 channel = 21;
/// The marketId of the underlying asset.
// Used by Futures and Options when the underlying instrument is defined by the vendor
sint64 underlyingMarketId = 22;
/// Display format
PriceFormat priceFormat = 23;
/// Strike price display format
PriceFormat optionStrikePriceFormat = 24;
// Removed deprecated field 26
// Removed deprecated field 27
/// Divide prices by this value to get real price values
sint32 priceDenominator = 28;
/// Divide trade quantities by this value to get real quantities
sint32 quantityDenominator = 29;
/// true if this is a tradable instrument
bool isTradable = 30;
/// UTC timestamp of transaction, nano seconds since Unix epoch
sint64 transactionTime = 50;
/// For internal use only. Ignore
bytes auxiliaryData = 99;
/// List of alternate symbols for this instrument. A single instrument
// may be provided by many different market data vendors, each with
// their own unique symbology. Allows this instrument to be tagged
// with as many vendor symbols as necessary.
repeated Symbol symbols = 100;
// #############################################
/// Option strike price in market currency. Multiply by
/// factorOptionsStrike to get actual strike
sint64 optionStrike = 200;
// Removed deprecated field 201
/// Option type: call vs put.
OptionType optionType = 202;
/// Option style : American vs European.
OptionStyle optionStyle = 203;
/// Divide optionStrike by this value to get real strike price
sint32 optionStrikeDenominator = 204;
// #############################################
/// Spread type, can be vendor specific
string spreadCode = 210;
/// Ordered list of underlying legs in a spread.
repeated SpreadLeg spreadLeg = 211;
/// true if user defined spread
bool userDefinedSpread = 212;
/// Listing market classification
string marketTier = 213;
/// Current financial status of the issuer
string financialStatusIndicator = 214;
/// ISIN: https://en.wikipedia.org/wiki/International_Securities_Identification_Number
string isin = 215;
/// Break out of currency pair
CurrencyPair currencyPair = 216;
/// true if exchange sends volume.
bool exchangeSendsVolume = 217;
/// true if exchange sends high.
bool exchangeSendsHigh = 218;
/// true if exchange sends low.
bool exchangeSendsLow = 219;
/// true if exchange sends open.
bool exchangeSendsOpen = 220;
/// true if this instrument represents consolidated NBBO.
bool consolidatedFeedInstrument = 221;
/// true if this instrument represents Pit symbol.
bool openOutcryInstrument = 222;
/// true if this instrument generated FX option.
bool syntheticAmericanOptionInstrument = 223;
///
string barchartExchangeCode = 224;
///
string barchartBaseCode = 225;
///
sint32 volumeDenominator = 226;
///
sint32 bidOfferQuantityDenominator = 227;
///
string primaryListingMarketParticipantId= 228;
///
string subscriptionSymbol= 229;
/// The Month/ Day of expiration for futures and options. Corresponds to the expiration month.
MaturityDate contractMaturity = 230;
/// Barchart Underlying Symbol
string underlying = 231;
string commodity = 232;
/// Barchart Exchange Id
sint32 exchangeId = 233;
/// Barchart Price Scaling Exponent
sint32 priceScalingExponent = 234;
/// The Openfeed marketId of the underlying asset.
sint64 underlyingOpenfeedMarketId = 235;
// #############################################
enum InstrumentType {
UNKNOWN_INSTRUMENT_TYPE = 0;
FOREX = 1;
INDEX = 2;
EQUITY = 3;
FUTURE = 4;
OPTION = 5;
SPREAD = 6;
MUTUAL_FUND = 7;
MONEY_MARKET_FUND = 8;
USER_DEFINED_SPREAD = 9;
EQUITY_OPTION = 10;
OTHER = 99;
}
/// Market depth implementation type
enum BookType {
UNKNOWN_BOOK_TYPE = 0;
// BBO
TOP_OF_BOOK = 1;
// Book uses price level
PRICE_LEVEL_DEPTH = 2;
// Book uses order-id
ORDER_DEPTH = 3;
}
/// Option type.
enum OptionType {
UNKNOWN_OPTION_TYPE = 0;
CALL = 1;
PUT = 2;
}
/// Option style.
enum OptionStyle {
UNKNOWN_OPTIONS_STYLE = 0;
DEFAULT = 1;
AMERICAN = 2;
EUROPEAN = 3;
}
enum State {
UNKNOWN_STATE = 0;
ACTIVE = 1;
PASSIVE = 2;
}
/// Typical trading week schedule
message Schedule {
repeated TimeSpan sessions = 1;
}
/// Trading session
// Times are in nanos since midnight UTC on the Sunday starting a given trading week
message TimeSpan {
sint64 timeStart = 1;
sint64 timeFinish = 2;
}
message Calendar {
repeated Event events = 1;
}
enum EventType {
UNKNOWN_EVENT_TYPE = 0;
// All instruments
FIRST_TRADE_DATE = 1;
LAST_TRADE_DATE = 2;
// Futures only
MATURITY_DATE = 10;
FIRST_DELIVERY_DATE = 11;
LAST_DELIVERY_DATE = 12;
FIRST_NOTICE_DATE = 13;
LAST_NOTICE_DATE = 14;
FIRST_HOLDING_DATE = 15;
LAST_HOLDING_DATE = 16;
FIRST_POSITION_DATE = 17;
LAST_POSITION_DATE = 18;
// Grain Bids
DELIVERY_START_DATE = 30;
DELIVERY_END_DATE = 31;
}
message Event {
EventType type = 1;
/// Epoch time in ms
sint64 date = 2;
}
message SpreadLeg {
// The marketId of the leg
sint64 marketId = 1;
// The ratio of the this leg with respect to the spread.
// Negative means short the absolute value, positive means long the absolute value.
// FIXME? Alternatively, we could have separate LONG/SHORT indicator in the message
// and use this field as only the absolute value
sint32 ratio = 2;
string symbol = 3;
string longSymbol = 4;
float legOptionDelta = 5;
float legPrice = 6;
// Additional information about the leg will be found in the instrument definition
// for the leg. It is not included here to reduce duplication.
}
/// Date and time with time zone.
message MaturityDate {
// Year of century.
sint32 year = 1;
// Month of year.
sint32 month = 2;
// Day of month.
sint32 day = 3;
}
/// A vendor's symbol for an instrument
message Symbol {
// The vendor that provides this symbol.
string vendor = 1;
// The symbol assigned by the vendor.
string symbol = 2;
// The long symbol assigned by the vendor. Includes 2 char year for futures.
string longSymbol = 3;
}
/// Recommended display format for prices.
message PriceFormat {
enum SubFormat {
FLAT = 0;
FRACTIONAL = 1;
DECIMAL = 2;
}
bool isFractional = 1;
sint32 denominator = 2;
sint32 subDenominator = 4;
SubFormat subFormat = 6;
}
/// Currency Pair
message CurrencyPair {
string currency1 = 1;
string currency2 = 2;
}
}