#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Hedge {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
#[prost(int32, tag="2")]
pub id: i32,
#[prost(string, tag="3")]
pub source_fund_code: ::prost::alloc::string::String,
#[prost(string, tag="4")]
pub source_symbol: ::prost::alloc::string::String,
#[prost(message, optional, tag="5")]
pub hedge_method: ::core::option::Option<HedgeMethod>,
#[prost(bool, tag="6")]
pub is_active: bool,
#[prost(message, optional, tag="7")]
pub create_time: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
#[prost(message, optional, tag="8")]
pub update_time: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
#[prost(enumeration="ExecPriceType", tag="9")]
pub exec_price_type: i32,
#[prost(bool, tag="10")]
pub auto_amend: bool,
#[prost(enumeration="super::common::AmendMethodType", tag="11")]
pub amend_method: i32,
#[prost(map="string, string", tag="12")]
pub quantity_per_hedge: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
#[prost(string, tag="13")]
pub hedge_fund_code: ::prost::alloc::string::String,
#[prost(int32, tag="14")]
pub tick_offset: i32,
#[prost(enumeration="OrderTpCode", tag="15")]
pub tp_code: i32,
#[prost(uint64, tag="16")]
pub initial_wait_ms: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HedgeMethod {
#[prost(oneof="hedge_method::Method", tags="1, 2, 3")]
pub method: ::core::option::Option<hedge_method::Method>,
}
pub mod hedge_method {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Method {
#[prost(message, tag="1")]
Direct(super::DirectHedge),
#[prost(message, tag="2")]
EtfDecomposition(super::EtfDecompositionHedge),
#[prost(message, tag="3")]
EtfPdf(super::EtfPdfHedge),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DirectHedge {
#[prost(string, tag="1")]
pub hedge_symbol: ::prost::alloc::string::String,
#[prost(double, tag="2")]
pub ratio: f64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EtfDecompositionHedge {
#[prost(int32, tag="1")]
pub cu: i32,
#[prost(map="string, double", tag="2")]
pub hedge_orders_per_1cu: ::std::collections::HashMap<::prost::alloc::string::String, f64>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EtfPdfHedge {
#[prost(int32, tag="1")]
pub cu: i32,
#[prost(map="string, double", tag="2")]
pub hedge_orders_per_1cu: ::std::collections::HashMap<::prost::alloc::string::String, f64>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HedgeGroup {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
#[prost(int32, tag="2")]
pub id: i32,
#[prost(string, tag="3")]
pub portfolio: ::prost::alloc::string::String,
#[prost(string, tag="4")]
pub display_name: ::prost::alloc::string::String,
#[prost(string, tag="5")]
pub hedge_fund_code: ::prost::alloc::string::String,
#[prost(message, optional, tag="6")]
pub trigger_condition: ::core::option::Option<TriggerCondition>,
#[prost(bool, tag="8")]
pub is_active: bool,
#[prost(message, optional, tag="9")]
pub create_time: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
#[prost(message, optional, tag="10")]
pub update_time: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
#[prost(bool, tag="11")]
pub separate_by_source: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TriggerCondition {
#[prost(oneof="trigger_condition::Condition", tags="1, 2")]
pub condition: ::core::option::Option<trigger_condition::Condition>,
}
pub mod trigger_condition {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Condition {
#[prost(message, tag="1")]
Quantity(super::QuantityTrigger),
#[prost(message, tag="2")]
Amount(super::AmountTrigger),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QuantityTrigger {
#[prost(int64, tag="1")]
pub threshold: i64,
#[prost(string, tag="2")]
pub hedge_instrument: ::prost::alloc::string::String,
#[prost(double, tag="3")]
pub ratio: f64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AmountTrigger {
#[prost(int64, tag="1")]
pub threshold: i64,
#[prost(string, tag="2")]
pub hedge_instrument: ::prost::alloc::string::String,
#[prost(double, tag="3")]
pub ratio: f64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetHedgeRequest {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LookupHedgeRequest {
#[prost(string, tag="1")]
pub fund_code: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub source_symbol: ::prost::alloc::string::String,
#[prost(int32, tag="3")]
pub portfolio_id: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LookupHedgeResponse {
#[prost(message, repeated, tag="1")]
pub hedges: ::prost::alloc::vec::Vec<Hedge>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FindValidHedgeRequest {
#[prost(string, tag="1")]
pub fund_code: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub source_symbol: ::prost::alloc::string::String,
#[prost(string, tag="3")]
pub hedge_symbol: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListHedgesRequest {
#[prost(int32, optional, tag="1")]
pub page_size: ::core::option::Option<i32>,
#[prost(string, optional, tag="2")]
pub page_token: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, tag="3")]
pub filter: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListHedgesResponse {
#[prost(message, repeated, tag="1")]
pub hedges: ::prost::alloc::vec::Vec<Hedge>,
#[prost(string, tag="2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateHedgeRequest {
#[prost(message, optional, tag="1")]
pub hedge: ::core::option::Option<Hedge>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateHedgeRequest {
#[prost(message, optional, tag="1")]
pub hedge: ::core::option::Option<Hedge>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteHedgeRequest {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetHedgeGroupRequest {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListHedgeGroupsRequest {
#[prost(int32, optional, tag="1")]
pub page_size: ::core::option::Option<i32>,
#[prost(string, optional, tag="2")]
pub page_token: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, tag="3")]
pub filter: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListHedgeGroupsResponse {
#[prost(message, repeated, tag="1")]
pub hedge_groups: ::prost::alloc::vec::Vec<HedgeGroup>,
#[prost(string, tag="2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateHedgeGroupRequest {
#[prost(message, optional, tag="1")]
pub hedge_group: ::core::option::Option<HedgeGroup>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateHedgeGroupRequest {
#[prost(message, optional, tag="1")]
pub hedge_group: ::core::option::Option<HedgeGroup>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteHedgeGroupRequest {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InstrumentAccumulatorState {
#[prost(string, tag="1")]
pub hedge_symbol: ::prost::alloc::string::String,
#[prost(double, tag="2")]
pub bid_accumulator: f64,
#[prost(double, tag="3")]
pub ask_accumulator: f64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HedgeAccumulatorState {
#[prost(int32, tag="1")]
pub portfolio_id: i32,
#[prost(string, tag="2")]
pub source_fund_code: ::prost::alloc::string::String,
#[prost(string, tag="3")]
pub source_symbol: ::prost::alloc::string::String,
#[prost(string, tag="4")]
pub hedge_symbol: ::prost::alloc::string::String,
#[prost(double, tag="5")]
pub bid_accumulator: f64,
#[prost(double, tag="6")]
pub ask_accumulator: f64,
#[prost(int64, tag="7")]
pub source_bid_filled_quantity: i64,
#[prost(int64, tag="8")]
pub source_ask_filled_quantity: i64,
#[prost(double, tag="9")]
pub desired_bid_hedge_quantity: f64,
#[prost(double, tag="10")]
pub desired_ask_hedge_quantity: f64,
#[prost(message, repeated, tag="11")]
pub per_instrument: ::prost::alloc::vec::Vec<InstrumentAccumulatorState>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListHedgeAccumulatorsRequest {
#[prost(string, tag="1")]
pub filter: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListHedgeAccumulatorsResponse {
#[prost(message, repeated, tag="1")]
pub hedge_accumulators: ::prost::alloc::vec::Vec<HedgeAccumulatorState>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamHedgeAccumulatorsRequest {
#[prost(string, tag="1")]
pub filter: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateHedgeAccumulatorFilledQuantitiesRequest {
#[prost(string, tag="1")]
pub fund_code: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub source_symbol: ::prost::alloc::string::String,
#[prost(int64, tag="3")]
pub source_bid_filled_quantity: i64,
#[prost(int64, tag="4")]
pub source_ask_filled_quantity: i64,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OrderTpCode {
Unspecified = 0,
None = 1,
Lp = 2,
}
impl OrderTpCode {
pub fn as_str_name(&self) -> &'static str {
match self {
OrderTpCode::Unspecified => "ORDER_TP_CODE_UNSPECIFIED",
OrderTpCode::None => "ORDER_TP_CODE_NONE",
OrderTpCode::Lp => "ORDER_TP_CODE_LP",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ORDER_TP_CODE_UNSPECIFIED" => Some(Self::Unspecified),
"ORDER_TP_CODE_NONE" => Some(Self::None),
"ORDER_TP_CODE_LP" => Some(Self::Lp),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ExecPriceType {
Unspecified = 0,
ImmediateFill = 1,
CounterBest = 2,
QuotedPrice = 4,
}
impl ExecPriceType {
pub fn as_str_name(&self) -> &'static str {
match self {
ExecPriceType::Unspecified => "EXEC_PRICE_TYPE_UNSPECIFIED",
ExecPriceType::ImmediateFill => "EXEC_PRICE_TYPE_IMMEDIATE_FILL",
ExecPriceType::CounterBest => "EXEC_PRICE_TYPE_COUNTER_BEST",
ExecPriceType::QuotedPrice => "EXEC_PRICE_TYPE_QUOTED_PRICE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"EXEC_PRICE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"EXEC_PRICE_TYPE_IMMEDIATE_FILL" => Some(Self::ImmediateFill),
"EXEC_PRICE_TYPE_COUNTER_BEST" => Some(Self::CounterBest),
"EXEC_PRICE_TYPE_QUOTED_PRICE" => Some(Self::QuotedPrice),
_ => None,
}
}
}
include!("kdo.v1.hedge.tonic.rs");
include!("kdo.v1.hedge.serde.rs");