255 lines
5.1 KiB
Protocol Buffer
255 lines
5.1 KiB
Protocol Buffer
syntax="proto3";
|
|
package bts.api;
|
|
option csharp_namespace="bts.api";
|
|
option cc_enable_arenas=true;
|
|
import "lib/api/apioptions.proto";
|
|
|
|
enum Venue {
|
|
VENUE_UNSET = 0;
|
|
VENUE_BTS = 1;
|
|
VENUE_SIM = 2;
|
|
VENUE_CBOE = 205;
|
|
VENUE_CBOECFE = 207;
|
|
VENUE_GLBX = 301;
|
|
VENUE_ICE = 306;
|
|
VENUE_SIMICE = 3;
|
|
VENUE_DERIBIT = 400;
|
|
VENUE_FTX = 410;
|
|
}
|
|
|
|
enum SecurityType {
|
|
SECURITYTYPE_UNSET = 0;
|
|
SECURITYTYPE_STOCK = 1;
|
|
SECURITYTYPE_OPTION = 2;
|
|
SECURITYTYPE_FUTURE = 3;
|
|
SECURITYTYPE_SPREAD = 4;
|
|
SECURITYTYPE_SYNTHETIC = 5;
|
|
}
|
|
|
|
enum Currency {
|
|
CURRENCY_USD = 0;
|
|
CURRENCY_EUR = 1;
|
|
CURRENCY_JPY = 2;
|
|
CURRENCY_GBP = 3;
|
|
CURRENCY_CHF = 4;
|
|
CURRENCY_CAD = 5;
|
|
CURRENCY_AUD = 6;
|
|
CURRENCY_NZD = 7;
|
|
CURRENCY_SEK = 8;
|
|
CURRENCY_NOK = 9;
|
|
CURRENCY_RUB = 10;
|
|
CURRENCY_SGD = 11;
|
|
CURRENCY_HKD = 12;
|
|
CURRENCY_INR = 13;
|
|
CURRENCY_RMB = 14;
|
|
}
|
|
|
|
enum CMEMics {
|
|
UNSET = 0;
|
|
CME = 1;
|
|
NYMEX = 2;
|
|
CBT = 3;
|
|
COMEX = 4;
|
|
MGE = 5;
|
|
DME = 6;
|
|
NYMSW = 7;
|
|
FXS = 8;
|
|
}
|
|
|
|
enum ICEMics{
|
|
IF_UNSET = 0;
|
|
IFU = 1;
|
|
IFE = 2;
|
|
IFL = 3;
|
|
IFC = 4;
|
|
IFEN = 5;
|
|
}
|
|
|
|
enum Side {
|
|
SIDE_UNDEFINED = 0;
|
|
SIDE_BUY = 49;
|
|
SIDE_SELL = 50;
|
|
}
|
|
|
|
enum RelativeSide {
|
|
RELATIVESIDE_UNDEFINED = 0;
|
|
RELATIVESIDE_OPPOSITE = 1;
|
|
RELATIVESIDE_SAME = 2;
|
|
RELATIVESIDE_BUY = 49;
|
|
RELATIVESIDE_SELL = 50;
|
|
}
|
|
|
|
enum PutOrCall {
|
|
PUTORCALL_PUT = 0;
|
|
PUTORCALL_CALL = 1;
|
|
}
|
|
|
|
message GLBXExchangeData {
|
|
uint64 exchange_id = 10;
|
|
string security_desc = 20;
|
|
string cfi_code = 21;
|
|
string cme_symbol = 22;
|
|
uint32 do_not_use_main_fraction = 30;
|
|
uint32 do_not_use_sub_fraction = 31;
|
|
uint32 do_not_use_price_display_format = 32;
|
|
uint32 market_segment_id = 33;
|
|
}
|
|
message CBOEExchangeData {
|
|
int64 exchange_id = 10;
|
|
string security_desc = 20;
|
|
int32 class_key = 30;
|
|
}
|
|
message DeribitExchangeData {
|
|
int64 exchange_id = 10;
|
|
string security_desc = 20;
|
|
}
|
|
message FTXExchangeData {
|
|
int64 exchange_id = 10;
|
|
string security_desc = 20;
|
|
}
|
|
message CBOECFEExchangeData {
|
|
int64 exchange_id = 10;
|
|
string security_desc = 20;
|
|
int32 class_key = 30;
|
|
}
|
|
message ICEExchangeData {
|
|
int64 exchange_id = 10;
|
|
string security_desc = 15; //contractSymbol
|
|
int32 price_denominator = 17;
|
|
int32 deal_denominator = 20;
|
|
int32 settle_denominator = 30;
|
|
|
|
string market_description = 100;
|
|
string cleared_alias = 110;
|
|
string product_name = 120;
|
|
string hub_alias = 130;
|
|
string strip_name = 140;
|
|
string mic_code = 150;
|
|
bool is_strip = 160;
|
|
}
|
|
|
|
message FutureContract {
|
|
uint32 expiration_year = 20;
|
|
uint32 expiration_month = 30;
|
|
uint32 expiration_day = 40;
|
|
}
|
|
|
|
message OptionContract {
|
|
double strike = 1;
|
|
uint32 expiration_year = 2;
|
|
uint32 expiration_month = 3;
|
|
uint32 expiration_day = 4;
|
|
PutOrCall call_put = 5;
|
|
}
|
|
|
|
message ContractLeg {
|
|
Security security = 10;
|
|
double quantity = 20;
|
|
Side side = 30;
|
|
double price_multiplier = 40;
|
|
double leg_delta = 50;
|
|
}
|
|
|
|
message SpreadContract {
|
|
bool normalized = 1; // a normalized spread has security keys only instead of complete legs
|
|
repeated ContractLeg legs = 10;
|
|
}
|
|
|
|
message SecurityTuple{
|
|
SecurityType type = 10;
|
|
Venue venue = 20;
|
|
string symbol = 30;
|
|
}
|
|
|
|
message SyntheticContract {
|
|
string name = 1;
|
|
uint32 user_id = 2;
|
|
repeated ContractLeg legs = 20;
|
|
PriceCalc price_calc = 30;
|
|
enum PriceCalc {
|
|
PRICECALC_STANDARD = 0;
|
|
PRICECALC_NET_CHANGE = 1;
|
|
// RATIO = 2;
|
|
}
|
|
}
|
|
|
|
message ContractSpecification {
|
|
double low_tick = 10;
|
|
double price_break = 20;
|
|
double high_tick = 30;
|
|
double cash_per_point = 40;
|
|
double price_multiplier = 50;
|
|
|
|
uint32 main_fraction = 60;
|
|
uint32 sub_fraction = 61;
|
|
uint32 price_display_format = 62;
|
|
}
|
|
|
|
message Security {
|
|
uint32 id = 10 [(bts.api.key)=true];
|
|
string symbol = 11;
|
|
Venue exchange = 20;
|
|
ContractSpecification contract_spec = 30;
|
|
Currency currency = 40;
|
|
oneof Contract {
|
|
FutureContract future = 100;
|
|
OptionContract option = 101;
|
|
SpreadContract spread = 110;
|
|
SyntheticContract synthetic = 120;
|
|
}
|
|
oneof ExchangeData {
|
|
GLBXExchangeData glbx = 200;
|
|
CBOEExchangeData cboe = 210;
|
|
CBOECFEExchangeData cfe = 220;
|
|
ICEExchangeData ice = 230;
|
|
DeribitExchangeData deribit = 240;
|
|
FTXExchangeData ftx = 250;
|
|
}
|
|
}
|
|
message SecurityList {
|
|
repeated Security security = 1;
|
|
}
|
|
|
|
message Product {
|
|
bts.api.Venue exchange = 1;
|
|
bts.api.SecurityType type = 2;
|
|
string symbol = 3;
|
|
}
|
|
|
|
message Expiration{
|
|
uint32 expiration_year = 10;
|
|
uint32 expiration_month = 20;
|
|
uint32 expiration_day = 30;
|
|
}
|
|
|
|
// abomination of the only data AW2 didnt take over
|
|
|
|
message DateTimeType
|
|
{
|
|
double oa_date = 10;
|
|
}
|
|
|
|
message Holiday
|
|
{
|
|
double date = 10;
|
|
double percent_day_not_trading = 20;
|
|
}
|
|
|
|
message StaticHolidays
|
|
{
|
|
string key = 10;
|
|
repeated Holiday static_holiday_collection = 20;
|
|
}
|
|
|
|
message StaticSecurityMetaData
|
|
{
|
|
string key = 5;
|
|
string security_name = 10;
|
|
StaticHolidays holidays = 20;
|
|
}
|
|
|
|
message StaticConfiguration
|
|
{
|
|
repeated StaticSecurityMetaData securities = 10;
|
|
}
|