mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-24 08:25:31 +00:00
add order book endpoint
This commit is contained in:
@@ -8,6 +8,43 @@ service Stock {
|
||||
rpc Quote(QuoteRequest) returns (QuoteResponse) {}
|
||||
rpc Price(PriceRequest) returns (PriceResponse) {}
|
||||
rpc History(HistoryRequest) returns (HistoryResponse) {}
|
||||
rpc OrderBook(OrderBookRequest) returns (OrderBookResponse) {}
|
||||
}
|
||||
|
||||
message Order {
|
||||
// the asking price
|
||||
double ask_price = 2;
|
||||
// the bidding price
|
||||
double bid_price = 3;
|
||||
// the ask size
|
||||
int32 ask_size = 4;
|
||||
// the bid size
|
||||
int32 bid_size = 5;
|
||||
// the UTC timestamp of the quote
|
||||
string timestamp = 6;
|
||||
}
|
||||
|
||||
// Get the historic order book and each trade by timestamp
|
||||
message OrderBookRequest {
|
||||
// stock to retrieve e.g AAPL
|
||||
string stock = 1;
|
||||
// the date in format YYYY-MM-dd
|
||||
string date = 2;
|
||||
// optional nanosecond timestamp start
|
||||
int64 start = 3;
|
||||
// optional nanosecond timestamp end
|
||||
int64 end = 4;
|
||||
// limit number of prices
|
||||
int32 limit = 5;
|
||||
}
|
||||
|
||||
message OrderBookResponse {
|
||||
// the stock symbol
|
||||
string symbol = 1;
|
||||
// date of the request
|
||||
string date = 2;
|
||||
// list of orders
|
||||
repeated Order orders = 3;
|
||||
}
|
||||
|
||||
// Get the last price for a given stock ticker
|
||||
|
||||
Reference in New Issue
Block a user