#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Arbitrage {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
#[prost(int32, tag="2")]
pub id: i32,
#[prost(int32, tag="3")]
pub portfolio_id: i32,
#[prost(int32, tag="5")]
pub basket_a_id: i32,
#[prost(int32, tag="6")]
pub basket_b_id: i32,
#[prost(message, optional, tag="7")]
pub trigger_config: ::core::option::Option<TriggerConfig>,
#[prost(bool, tag="9")]
pub is_active: bool,
#[prost(message, optional, tag="10")]
pub create_time: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
#[prost(message, optional, tag="11")]
pub update_time: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
#[prost(message, optional, tag="12")]
pub basket_a: ::core::option::Option<super::basket::Basket>,
#[prost(message, optional, tag="13")]
pub basket_b: ::core::option::Option<super::basket::Basket>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct TriggerConfig {
#[prost(message, optional, tag="1")]
pub condition: ::core::option::Option<TriggerCondition>,
#[prost(uint64, tag="2")]
pub cooldown_ms: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, 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, Copy, PartialEq, ::prost::Oneof)]
pub enum Condition {
#[prost(message, tag="1")]
SpreadAmount(super::SpreadAmountCondition),
#[prost(message, tag="2")]
SpreadBps(super::SpreadBpsCondition),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SpreadAmountCondition {
#[prost(int64, tag="1")]
pub threshold: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SpreadBpsCondition {
#[prost(double, tag="1")]
pub threshold_bps: f64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ArbitrageStatus {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
#[prost(int32, tag="2")]
pub id: i32,
#[prost(enumeration="ArbitrageState", tag="3")]
pub state: i32,
#[prost(int64, tag="4")]
pub basket_a_value: i64,
#[prost(int64, tag="5")]
pub basket_b_value: i64,
#[prost(int64, tag="6")]
pub current_spread: i64,
#[prost(double, tag="7")]
pub current_spread_bps: f64,
#[prost(message, optional, tag="8")]
pub execution_state: ::core::option::Option<ExecutionState>,
#[prost(message, optional, tag="9")]
pub stats: ::core::option::Option<ArbitrageStats>,
#[prost(message, optional, tag="10")]
pub estimate: ::core::option::Option<ExecutionEstimate>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutionEstimate {
#[prost(int64, tag="1")]
pub buy_a_sell_b_pnl: i64,
#[prost(int64, tag="2")]
pub buy_b_sell_a_pnl: i64,
#[prost(double, tag="3")]
pub slippage_bps: f64,
#[prost(bool, tag="4")]
pub executable: bool,
#[prost(string, tag="5")]
pub reason: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutionState {
#[prost(enumeration="ArbitrageSide", tag="1")]
pub side: i32,
#[prost(uint32, tag="2")]
pub current_round: u32,
#[prost(uint32, tag="3")]
pub total_rounds: u32,
#[prost(message, repeated, tag="4")]
pub round_fills: ::prost::alloc::vec::Vec<RoundFillState>,
#[prost(double, tag="5")]
pub total_fill_rate: f64,
#[prost(int64, tag="6")]
pub trigger_spread: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RoundFillState {
#[prost(uint32, tag="1")]
pub round: u32,
#[prost(map="string, int64", tag="2")]
pub ordered_quantities: ::std::collections::HashMap<::prost::alloc::string::String, i64>,
#[prost(map="string, int64", tag="3")]
pub filled_quantities: ::std::collections::HashMap<::prost::alloc::string::String, i64>,
#[prost(double, tag="4")]
pub fill_rate: f64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ArbitrageStats {
#[prost(uint64, tag="1")]
pub trigger_count: u64,
#[prost(uint64, tag="2")]
pub execution_count: u64,
#[prost(uint64, tag="3")]
pub execution_failures: u64,
#[prost(int64, tag="4")]
pub total_profit: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ArbitrageStatusUpdate {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
#[prost(int32, tag="2")]
pub id: i32,
#[prost(message, optional, tag="3")]
pub update_mask: ::core::option::Option<super::super::super::google::protobuf::FieldMask>,
#[prost(message, optional, tag="4")]
pub status: ::core::option::Option<ArbitrageStatus>,
#[prost(message, repeated, tag="5")]
pub basket_a_prices: ::prost::alloc::vec::Vec<BasketItemPrice>,
#[prost(message, repeated, tag="6")]
pub basket_b_prices: ::prost::alloc::vec::Vec<BasketItemPrice>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ArbitrageEvent {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
#[prost(int32, tag="2")]
pub id: i32,
#[prost(oneof="arbitrage_event::Event", tags="3, 4, 5, 6, 7, 8, 9, 10, 11, 12")]
pub event: ::core::option::Option<arbitrage_event::Event>,
}
pub mod arbitrage_event {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Event {
#[prost(message, tag="3")]
StateChanged(super::StateChangedEvent),
#[prost(message, tag="4")]
PriceUpdate(super::PriceUpdateEvent),
#[prost(message, tag="5")]
Triggered(super::TriggeredEvent),
#[prost(message, tag="6")]
RoundStarted(super::RoundStartedEvent),
#[prost(message, tag="7")]
OrderSubmitted(super::OrderSubmittedEvent),
#[prost(message, tag="8")]
OrderFilled(super::OrderFilledEvent),
#[prost(message, tag="9")]
RoundCompleted(super::RoundCompletedEvent),
#[prost(message, tag="10")]
ExecutionCompleted(super::ExecutionCompletedEvent),
#[prost(message, tag="11")]
Error(super::ErrorEvent),
#[prost(message, tag="12")]
BasketPrice(super::BasketPriceUpdateEvent),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct StateChangedEvent {
#[prost(enumeration="ArbitrageState", tag="1")]
pub old_state: i32,
#[prost(enumeration="ArbitrageState", tag="2")]
pub new_state: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct PriceUpdateEvent {
#[prost(int64, tag="1")]
pub basket_a_value: i64,
#[prost(int64, tag="2")]
pub basket_b_value: i64,
#[prost(int64, tag="3")]
pub spread: i64,
#[prost(double, tag="4")]
pub spread_bps: f64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct TriggeredEvent {
#[prost(enumeration="ArbitrageSide", tag="1")]
pub side: i32,
#[prost(int64, tag="2")]
pub spread: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct RoundStartedEvent {
#[prost(uint32, tag="1")]
pub round: u32,
#[prost(uint32, tag="2")]
pub total_rounds: u32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrderSubmittedEvent {
#[prost(uint32, tag="1")]
pub round: u32,
#[prost(string, tag="2")]
pub symbol: ::prost::alloc::string::String,
#[prost(int64, tag="3")]
pub quantity: i64,
#[prost(string, tag="4")]
pub price: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrderFilledEvent {
#[prost(uint32, tag="1")]
pub round: u32,
#[prost(string, tag="2")]
pub symbol: ::prost::alloc::string::String,
#[prost(int64, tag="3")]
pub filled_quantity: i64,
#[prost(int64, tag="4")]
pub filled_price: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct RoundCompletedEvent {
#[prost(uint32, tag="1")]
pub round: u32,
#[prost(double, tag="2")]
pub fill_rate: f64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ExecutionCompletedEvent {
#[prost(double, tag="1")]
pub total_fill_rate: f64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ErrorEvent {
#[prost(string, tag="1")]
pub message: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BasketItemPrice {
#[prost(string, tag="1")]
pub symbol: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub bid1: ::prost::alloc::string::String,
#[prost(string, tag="3")]
pub ask1: ::prost::alloc::string::String,
#[prost(int64, tag="4")]
pub bid1_qty: i64,
#[prost(int64, tag="5")]
pub ask1_qty: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BasketPriceUpdateEvent {
#[prost(enumeration="BasketSide", tag="1")]
pub side: i32,
#[prost(message, repeated, tag="2")]
pub updated_items: ::prost::alloc::vec::Vec<BasketItemPrice>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetArbitrageRequest {
#[prost(string, tag="1")]
pub arbitrage: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListArbitragesRequest {
#[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 ListArbitragesResponse {
#[prost(message, repeated, tag="1")]
pub arbitrages: ::prost::alloc::vec::Vec<Arbitrage>,
#[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 CreateArbitrageRequest {
#[prost(message, optional, tag="1")]
pub arbitrage: ::core::option::Option<Arbitrage>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateArbitrageRequest {
#[prost(message, optional, tag="1")]
pub arbitrage: ::core::option::Option<Arbitrage>,
#[prost(message, optional, tag="2")]
pub update_mask: ::core::option::Option<super::super::super::google::protobuf::FieldMask>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteArbitrageRequest {
#[prost(string, tag="1")]
pub arbitrage: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartArbitrageRequest {
#[prost(string, tag="1")]
pub arbitrage: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StopArbitrageRequest {
#[prost(string, tag="1")]
pub arbitrage: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetArbitrageStatusRequest {
#[prost(string, tag="1")]
pub arbitrage: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListArbitrageStatusesRequest {
#[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 ListArbitrageStatusesResponse {
#[prost(message, repeated, tag="1")]
pub arbitrage_statuses: ::prost::alloc::vec::Vec<ArbitrageStatus>,
#[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 StreamArbitrageStatusRequest {
#[prost(string, tag="1")]
pub arbitrage: ::prost::alloc::string::String,
#[prost(bool, tag="2")]
pub include_basket_prices: bool,
#[prost(bool, tag="3")]
pub include_estimate: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamArbitrageEventsRequest {
#[prost(string, tag="1")]
pub arbitrage: ::prost::alloc::string::String,
#[prost(bool, tag="2")]
pub include_basket_prices: bool,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ArbitrageState {
Unspecified = 0,
Idle = 1,
Monitoring = 2,
Triggered = 3,
Executing = 4,
Stopped = 5,
Error = 6,
}
impl ArbitrageState {
pub fn as_str_name(&self) -> &'static str {
match self {
ArbitrageState::Unspecified => "ARBITRAGE_STATE_UNSPECIFIED",
ArbitrageState::Idle => "ARBITRAGE_STATE_IDLE",
ArbitrageState::Monitoring => "ARBITRAGE_STATE_MONITORING",
ArbitrageState::Triggered => "ARBITRAGE_STATE_TRIGGERED",
ArbitrageState::Executing => "ARBITRAGE_STATE_EXECUTING",
ArbitrageState::Stopped => "ARBITRAGE_STATE_STOPPED",
ArbitrageState::Error => "ARBITRAGE_STATE_ERROR",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ARBITRAGE_STATE_UNSPECIFIED" => Some(Self::Unspecified),
"ARBITRAGE_STATE_IDLE" => Some(Self::Idle),
"ARBITRAGE_STATE_MONITORING" => Some(Self::Monitoring),
"ARBITRAGE_STATE_TRIGGERED" => Some(Self::Triggered),
"ARBITRAGE_STATE_EXECUTING" => Some(Self::Executing),
"ARBITRAGE_STATE_STOPPED" => Some(Self::Stopped),
"ARBITRAGE_STATE_ERROR" => Some(Self::Error),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ArbitrageSide {
Unspecified = 0,
BuyASellB = 1,
BuyBSellA = 2,
}
impl ArbitrageSide {
pub fn as_str_name(&self) -> &'static str {
match self {
ArbitrageSide::Unspecified => "ARBITRAGE_SIDE_UNSPECIFIED",
ArbitrageSide::BuyASellB => "ARBITRAGE_SIDE_BUY_A_SELL_B",
ArbitrageSide::BuyBSellA => "ARBITRAGE_SIDE_BUY_B_SELL_A",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ARBITRAGE_SIDE_UNSPECIFIED" => Some(Self::Unspecified),
"ARBITRAGE_SIDE_BUY_A_SELL_B" => Some(Self::BuyASellB),
"ARBITRAGE_SIDE_BUY_B_SELL_A" => Some(Self::BuyBSellA),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum BasketSide {
Unspecified = 0,
A = 1,
B = 2,
}
impl BasketSide {
pub fn as_str_name(&self) -> &'static str {
match self {
BasketSide::Unspecified => "BASKET_SIDE_UNSPECIFIED",
BasketSide::A => "BASKET_SIDE_A",
BasketSide::B => "BASKET_SIDE_B",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"BASKET_SIDE_UNSPECIFIED" => Some(Self::Unspecified),
"BASKET_SIDE_A" => Some(Self::A),
"BASKET_SIDE_B" => Some(Self::B),
_ => None,
}
}
}
include!("kdo.v1.arbitrage.tonic.rs");
include!("kdo.v1.arbitrage.serde.rs");