|
| 1 | +// Copyright (c) 2021 Systemathics |
| 2 | +// |
| 3 | +// Permission is hereby granted, free of charge, to any person obtaining a copy |
| 4 | +// of this software and associated documentation files (the "Software"), to deal |
| 5 | +// in the Software without restriction, including without limitation the rights |
| 6 | +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 7 | +// copies of the Software, and to permit persons to whom the Software is |
| 8 | +// furnished to do so, subject to the following conditions: |
| 9 | +// |
| 10 | +// The above copyright notice and this permission notice shall be included in all |
| 11 | +// copies or substantial portions of the Software. |
| 12 | +// |
| 13 | +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 14 | +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 15 | +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 16 | +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 17 | +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 18 | +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 19 | +// SOFTWARE. |
| 20 | + |
| 21 | +// Calculate the bid ask spread analytics. |
| 22 | +syntax = "proto3"; |
| 23 | + |
| 24 | +import "google/protobuf/timestamp.proto"; |
| 25 | +import "google/protobuf/duration.proto"; |
| 26 | + |
| 27 | +import "systemathics/apis/type/shared/v1/constraints.proto"; |
| 28 | +import "systemathics/apis/type/shared/v1/identifier.proto"; |
| 29 | +import "systemathics/apis/type/shared/v1/side.proto"; |
| 30 | + |
| 31 | +package systemathics.apis.services.tick_analytics.v1; |
| 32 | + |
| 33 | +// Called to request TickSpreadService. |
| 34 | +service TickSpreadService |
| 35 | +{ |
| 36 | + // Gets the Spread analytics |
| 37 | + rpc TickSpread(TickSpreadRequest) returns (stream TickSpreadResponse); |
| 38 | +} |
| 39 | + |
| 40 | +// The required input to request the TickSpreadService. |
| 41 | +message TickSpreadRequest |
| 42 | +{ |
| 43 | + // [Mandatory] The instrument identifier: a ticker and exchange |
| 44 | + systemathics.apis.type.shared.v1.Identifier identifier = 1; |
| 45 | + |
| 46 | + // [Optional] The time constraints used to define the look-back period. |
| 47 | + // If empty, then all the available data is retrieved. |
| 48 | + systemathics.apis.type.shared.v1.Constraints constraints = 2; |
| 49 | + |
| 50 | + // [Optional] Accept quote conditions, by default the accept is set to null : accept all |
| 51 | + repeated string accept = 3; |
| 52 | + |
| 53 | + // [Optional] Rejected quote conditions, by default the reject is set to null : do not reject |
| 54 | + repeated string reject = 4; |
| 55 | +} |
| 56 | + |
| 57 | +// Contains the Spread data analytics. |
| 58 | +message TickSpreadResponse |
| 59 | +{ |
| 60 | + // The bid side values |
| 61 | + SideData bid = 1; |
| 62 | + |
| 63 | + // The ask side values |
| 64 | + SideData ask = 2; |
| 65 | + |
| 66 | + // The last spread |
| 67 | + double last = 3; |
| 68 | + |
| 69 | + // The average spread |
| 70 | + double average = 4; |
| 71 | + |
| 72 | + // The min spread |
| 73 | + double min = 5; |
| 74 | + |
| 75 | + // The max spread |
| 76 | + double max = 6; |
| 77 | + |
| 78 | + // The ticks count |
| 79 | + int64 count = 7; |
| 80 | +} |
| 81 | + |
| 82 | +// Contains the side details. |
| 83 | +message SideData |
| 84 | +{ |
| 85 | + // The last price |
| 86 | + double last = 1; |
| 87 | + |
| 88 | + // The average price |
| 89 | + double average = 2; |
| 90 | + |
| 91 | + // The vwap price |
| 92 | + double vwap = 3; |
| 93 | + |
| 94 | + // The min price |
| 95 | + double min = 4; |
| 96 | + |
| 97 | + // The max price |
| 98 | + double max = 5; |
| 99 | + |
| 100 | + // The total volume |
| 101 | + int64 volume = 6; |
| 102 | + |
| 103 | + // The ticks count |
| 104 | + int64 count = 7; |
| 105 | +} |
| 106 | + |
0 commit comments