You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

114 lines
2.0 KiB

syntax = "proto3";
option go_package = "./pb";
enum SubscribeType {
Subscribe = 0;
Unsubscribe = 1;
UnsubscribeAll = 2;
}
enum Exchange {
SIG = 0;
OKX = 1;
BINANCE = 2;
}
enum TradeInstanceType {
Unknow = 0;
Spot = 1; // 1现货
PerpetualContract = 2; // 2永续合约
}
enum Event {
UNKNOWN = 0;
SUBSCRIBED = 1;
UNSUBSCRIBED = 2;
SNAPSHOT = 3;
UPDATE = 4;
AUTHENTICATED = 5;
ERROR = 99;
}
enum Channel {
BOOK = 0;
TRADE = 1;
TICKER = 2;
KLINE = 3;
BALANCE = 4;
ORDER = 5;
}
enum Side {
BUY = 0;
SELL = 1;
}
enum OrderType {
MARKET = 0;
LIMIT = 1;
STOP_MARKET = 2;
STOP_LIMIT = 3;
POST_ONLY = 4;
IOC_LIMIT = 5;
}
message Error {
int64 error_code = 1;
string error_message = 2;
}
// 交易产品基础信息
message TradeInstance {
string instId = 1;
string instPair = 2;
string instCoin = 3;
TradeInstanceType instType = 4;
int32 status = 5;
int32 priceSz = 6;
int32 quantitySz = 7;
string icon = 8;
string updateBy = 9;
int64 updateTime = 10;
repeated int32 leverages = 11;
repeated TradeInstanceExchange exchanges = 15; // 交易产品支持的交易所
}
// 交易所交易产品
message TradeInstanceExchange {
string exchangeInstId = 1;
string instId = 2;
int32 status = 3;
int32 exchange = 4;
string updateBy = 5;
int64 updateTime = 6;
}
message Kline {
int64 Ts = 2;
string interval = 3; // 周期
string Open = 4;
string High = 5;
string Low = 6;
string Close = 7;
string vol = 8; // 交易量
string volQuote = 9; // 交易额
bool Confirm = 10; // k线是否完结
}
// https://maicoin.github.io/max-websocket-docs/#/private_channels?id=snapshot
message Order {
string exchange = 1;
string symbol = 2;
string id = 3;
Side side = 4;
OrderType order_type = 5;
string price = 6;
string stop_price = 7;
string status = 9;
string quantity = 11;
string executed_quantity = 12;
string client_order_id = 14;
int64 group_id = 15;
int64 created_at = 10;
}