forked from automatedalgo/apex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGxWireFormat.proto
182 lines (142 loc) · 3.38 KB
/
GxWireFormat.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
/* Copyright 2024 Automated Algo (www.automatedalgo.com)
This file is part of Automated Algo's "Apex" project.
Apex is free software: you can redistribute it and/or modify it under the terms
of the GNU Lesser General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
Apex is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along
with Apex. If not, see <https://www.gnu.org/licenses/>.
*/
// Comment
syntax = "proto3";
package apex.pb;
enum Side {
side_none = 0;
side_buy = 1;
side_sell = 2;
}
// Note: this should be identical to the C++ enum
enum Exchange {
exchange_none = 0;
exchange_binance = 1;
exchange_binance_usdfut = 2;
exchange_binance_coinfut = 3;
}
enum RunMode {
runmode_none = 0;
runmode_sim = 1;
runmode_live = 2;
}
enum OrderState {
orderstate_none = 0;
orderstate_init = 1;
orderstate_submitted = 2;
orderstate_live = 3;
orderstate_closed = 4;
}
enum CloseReason {
closereason_none = 0;
closereason_expired = 1;
closereason_rejected = 2;
closereason_canceled = 3;
closereason_filled = 4;
}
enum OrderType {
ordertype_none = 0;
ordertype_limit = 1;
ordertype_market = 2;
}
message LogonRequest {
}
message LogonReply {
string error = 1;
}
message OmLogonRequest {
RunMode run_mode = 1;
string strategy_id = 2;
}
message OmLogonReply {
string error = 1;
}
message SubscribeTicks {
string symbol = 1;
Exchange exchange = 2;
}
message SubscribeWallet {
Exchange exchange = 1;
}
message WalletUpdate {
Exchange exchange = 1;
string symbol = 2;
double position = 3;
}
message TickTrade {
Exchange exchange = 1;
string symbol = 2;
double price = 3;
double size = 4;
Side side = 5;
}
message TickTop {
Exchange exchange = 1;
string symbol = 2;
double ask_price = 3;
double ask_qty = 4;
double bid_price = 5;
double bid_qty = 6;
uint64 rt = 7; // receive time
}
message NewOrder {
Exchange exchange = 1;
string symbol = 2;
double price = 3;
double size = 4;
Side side = 5;
// TODO: change these to ints
uint32 tif = 6;
OrderType type = 7;
string order_id = 8;
}
// maybe this should just be an int, so that
// I can place the MsgType in there.
enum OrderUpdateReason {
UNSOLICITED = 0;
NEW_ORDER_ACK = 1;
CANCEL_ORDER_ACK = 2;
}
message OrderExecution {
string order_id = 1;
uint32 order_state = 2;
uint32 close_reason = 3;
string ext_order_id = 4;
OrderUpdateReason reason = 5;
}
message CancelOrder {
Exchange exchange = 1;
string symbol = 2;
string order_id = 3;
string ext_order_id=4;
}
message CancelOrderReply {
string order_id = 1;
uint32 order_state = 2;
uint32 close_reason = 3;
string ext_order_id = 4;
}
message Error {
uint32 orig_request_type = 1;
string code = 2;
string text = 3;
}
message OrderFill {
Exchange exchange = 1;
string symbol = 2;
string order_id = 3;
double price = 4;
double size = 5;
bool fully_filled = 6;
uint64 recv_time = 7;
}