47 lines
1.2 KiB
Protocol Buffer
47 lines
1.2 KiB
Protocol Buffer
syntax="proto3";
|
|
package bts.api;
|
|
option csharp_namespace="bts.api";
|
|
option cc_enable_arenas=true;
|
|
import "lib/api/apioptions.proto";
|
|
import "lib/api/apicore.proto";
|
|
import "lib/domain_model/Security.proto";
|
|
import "lib/md/protos/co2.proto";
|
|
|
|
message ProductList {
|
|
repeated bts.api.Product products = 1;
|
|
}
|
|
|
|
// Should this cary int prices?
|
|
message PriceEntry {
|
|
double price = 1;
|
|
uint32 direct = 10;
|
|
uint32 implied = 11;
|
|
}
|
|
|
|
message BookEntry {
|
|
uint32 key = 1 [(bts.api.key)=true];
|
|
repeated PriceEntry bid = 10;
|
|
repeated PriceEntry ask = 20;
|
|
}
|
|
|
|
message TickerEntry {
|
|
uint32 key = 1 [(bts.api.key)=true];
|
|
int64 time = 2;
|
|
double price = 3;
|
|
uint32 size = 4;
|
|
uint32 total_volume = 5;
|
|
bts.co2.AggressorSide aggressor_side = 6;
|
|
bool from_spread = 7;
|
|
bool gap = 10;
|
|
}
|
|
|
|
|
|
service MarketDataService {
|
|
rpc get_products(bts.api.VoidMessage) returns (ProductList);
|
|
// stream all securities
|
|
rpc securities (bts.api.VoidMessage) returns (stream bts.api.Security);
|
|
rpc book (bts.api.Product) returns (stream BookEntry);
|
|
rpc trades(bts.api.VoidMessage) returns (stream TickerEntry);
|
|
// subscribe_misc(Product)
|
|
}
|