173 lines
4.4 KiB
Protocol Buffer
173 lines
4.4 KiB
Protocol Buffer
syntax="proto3";
|
|
package bts.history;
|
|
option csharp_namespace="bts.history";
|
|
option cc_enable_arenas=true;
|
|
import "lib/api/Apioptions.proto";
|
|
import "google/protobuf/timestamp.proto";
|
|
import "google/protobuf/duration.proto";
|
|
import "lib/domain_model/Security.proto";
|
|
import "lib/md/protos/Co2.proto";
|
|
|
|
|
|
enum MDUpdateAction
|
|
{
|
|
MDUpdateAction_UNSET = 0;
|
|
NEW = 48; // '0'
|
|
CHANGE = 49;
|
|
DELETE = 50;
|
|
}
|
|
enum MDEntryType
|
|
{
|
|
MDEntryType_UNSET = 0;
|
|
BID = 48; // '0'
|
|
OFFER = 49;
|
|
TRADE = 50;
|
|
OPENING_PRICE = 52;
|
|
SETTLEMENT_PRICE = 54;
|
|
}
|
|
message MDEntry
|
|
{
|
|
MDUpdateAction md_update_action = 279; //delimiter, this member must be first
|
|
MDEntryType md_entry_type = 269;
|
|
uint32 security_id = 48;
|
|
string symbol = 55;
|
|
uint32 rptseq = 83;
|
|
double md_entry_px = 270;
|
|
uint32 md_entry_size = 271;
|
|
uint32 number_of_orders = 346;
|
|
uint32 md_price_level = 1023;
|
|
uint32 open_close_settle_flag = 286;
|
|
string settle_price_type = 731;
|
|
uint32 aggressor_side = 5797;
|
|
string md_trade_entry_id = 37711;
|
|
//...
|
|
uint32 reference_id = 9633;
|
|
uint32 last_qty = 32;
|
|
uint64 order_id = 37;
|
|
uint64 md_order_priority = 37707;
|
|
uint64 md_display_qty = 37706;
|
|
}
|
|
message OrderIDEntry
|
|
{
|
|
uint64 order_id = 37; //delimiter, this member must be first
|
|
uint64 md_display_qty = 37706;
|
|
uint64 md_order_priority = 37707;
|
|
MDUpdateAction order_update_action = 37708;
|
|
uint32 reference_id = 9633;
|
|
uint32 last_qty = 32;
|
|
}
|
|
|
|
//https://www.cmegroup.com/confluence/display/EPICSANDBOX/MDP+3.0+-+Market+by+Order+-+Book+Management
|
|
message MarketDataIncrementalRefresh
|
|
{
|
|
option (bts.api.protofix_message_type) = "X";
|
|
|
|
google.protobuf.Timestamp trade_date = 75;
|
|
uint32 msg_seq_num = 34;
|
|
google.protobuf.Timestamp sending_time = 52;
|
|
google.protobuf.Timestamp transact_time = 60;
|
|
string match_event_indicator = 5799;
|
|
|
|
repeated MDEntry md_entries = 268;
|
|
repeated OrderIDEntry order_id_entries = 37705;
|
|
}
|
|
|
|
message Slice
|
|
{
|
|
google.protobuf.Timestamp begin = 10;
|
|
google.protobuf.Timestamp end = 20;
|
|
uint32 buy_volume = 30;
|
|
double avg_buy_price = 40;
|
|
uint32 sell_volume = 50;
|
|
double avg_sell_price = 60;
|
|
}
|
|
message Slices
|
|
{
|
|
repeated Slice slice_vec = 10;
|
|
google.protobuf.Duration d_t = 60;
|
|
}
|
|
message SliceDistribution
|
|
{
|
|
google.protobuf.Timestamp begin = 10;
|
|
google.protobuf.Timestamp end = 20;
|
|
double volume_mean = 30;
|
|
double volume_variance = 40;
|
|
double price_mean = 50;
|
|
double price_variance = 60;
|
|
}
|
|
message TradingDistribution
|
|
{
|
|
double volume_mean = 10;
|
|
double volume_variance = 20;
|
|
double volume_skewness = 30;
|
|
double price_mean = 40;
|
|
double price_variance = 50;
|
|
double price_skewness = 60;
|
|
google.protobuf.Duration d_t = 70;
|
|
repeated SliceDistribution slices = 100;
|
|
}
|
|
|
|
message SlicesQuery
|
|
{
|
|
api.Venue exchange = 10;
|
|
string symbol = 20;
|
|
api.SecurityType security_type = 30;
|
|
|
|
google.protobuf.Timestamp begin = 40;
|
|
google.protobuf.Timestamp end = 50;
|
|
google.protobuf.Duration d_t = 60;
|
|
}
|
|
message TradingDistributionQuery
|
|
{
|
|
api.Venue exchange = 10;
|
|
string symbol = 20;
|
|
api.SecurityType security_type = 30;
|
|
|
|
google.protobuf.Timestamp begin = 40;
|
|
google.protobuf.Timestamp end = 50;
|
|
google.protobuf.Duration d_t = 60;
|
|
}
|
|
|
|
message MDStream
|
|
{
|
|
repeated MarketDataIncrementalRefresh md = 10;
|
|
}
|
|
|
|
message MDQuery
|
|
{
|
|
api.Venue exchange = 10;
|
|
string symbol = 20;
|
|
api.SecurityType security_type = 30;
|
|
|
|
google.protobuf.Timestamp skip = 35;
|
|
google.protobuf.Timestamp begin = 40;
|
|
google.protobuf.Timestamp end = 50;
|
|
int32 line_skip = 60;
|
|
}
|
|
|
|
message ProcessedBook
|
|
{
|
|
uint32 book_seq_num = 1;
|
|
uint32 msg_seq_num = 10;
|
|
google.protobuf.Timestamp sending_time = 20;
|
|
google.protobuf.Timestamp transact_time = 30;
|
|
string security = 40;
|
|
co2.BookMessage book = 50;
|
|
}
|
|
|
|
message Timerange{
|
|
google.protobuf.Timestamp t1 = 10;
|
|
google.protobuf.Timestamp t2 = 20;
|
|
}
|
|
|
|
message BookEntry{
|
|
ProcessedBook p_book = 10;
|
|
Timerange time_range = 20;
|
|
}
|
|
|
|
service HistoricalDataService
|
|
{
|
|
rpc get_trading_slices(SlicesQuery) returns (Slices);
|
|
rpc get_trading_distribution (TradingDistributionQuery) returns (TradingDistribution);
|
|
rpc get_md_stream (MDQuery) returns (MDStream);
|
|
} |