forked from upstox/upstox-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MarketDataFeed.proto
127 lines (111 loc) · 2.55 KB
/
MarketDataFeed.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
syntax = "proto3";
package com.upstox.marketdatafeeder.rpc.proto;
message LTPC {
double ltp = 1;
int64 ltt = 2;
int64 ltq = 3;
double cp = 4; //close price
}
message MarketLevel {
repeated Quote bidAskQuote = 1;
int64 lut = 2;
}
message MarketOHLC {
repeated OHLC ohlc = 1;
}
message Quote {
int32 bq = 1; //bid quantity
double bp = 2; //bid price
int32 bno = 3; //bid number of orders
int32 aq = 4; // ask quantity
double ap = 5; // ask price
int32 ano = 6; // ask number of orders
int64 bidQ = 7; //bid quantity
int64 askQ = 8; // ask quantity
}
message OptionGreeks {
double op = 1; // option price
double up = 2; //underlying price
double iv = 3; // implied volatility
double delta = 4;
double theta = 5;
double gamma = 6;
double vega = 7;
double rho = 8;
}
message ExtendedFeedDetails {
double atp = 1; //avg traded price
double cp = 2; //close price
int64 vtt = 3; //volume traded today
double oi = 4; //open interest
double changeOi = 5; //change oi
double lastClose = 6;
double tbq = 7; //total buy quantity
double tsq = 8; //total sell quantity
double close = 9;
double lc = 10; //lower circuit
double uc = 11; //upper circuit
double yh = 12; //yearly high
double yl = 13; //yearly low
double fp = 14; //fill price
int32 fv = 15; //fill volume
int64 mbpBuy = 16; //mbp buy
int64 mbpSell = 17; //mbp sell
int64 tv = 18; //traded volume
double dhoi = 19; //day high open interest
double dloi = 20; //day low open interest
double sp = 21; //spot price
double poi = 22; //previous open interest
}
message OHLC {
string interval = 1;
double open = 2;
double high = 3;
double low = 4;
double close = 5;
int32 volume = 6;
int64 ts = 7;
int64 vol = 9;
}
enum Type{
initial_feed = 0;
live_feed = 1;
}
message MarketFullFeed{
LTPC ltpc = 1;
MarketLevel marketLevel = 2;
OptionGreeks optionGreeks = 3;
MarketOHLC marketOHLC = 4;
ExtendedFeedDetails eFeedDetails = 5;
}
message IndexFullFeed{
LTPC ltpc = 1;
MarketOHLC marketOHLC = 2;
double lastClose = 3;
double yh = 4; //yearly high
double yl = 5; //yearly low
}
message FullFeed {
oneof FullFeedUnion {
MarketFullFeed marketFF = 1;
IndexFullFeed indexFF = 2;
}
}
message OptionChain{
LTPC ltpc = 1;
Quote bidAskQuote = 2;
OptionGreeks optionGreeks = 3;
ExtendedFeedDetails eFeedDetails = 4;
}
message Feed {
oneof FeedUnion {
LTPC ltpc = 1;
FullFeed ff = 2;
OptionChain oc = 3;
}
}
message FeedResponse{
Type type = 1;
map<string, Feed> feeds = 2;
int64 currentTs = 3;
}