// @generated
// This file is @generated by prost-build.
// ============================================================================
// Pair Entity
// ============================================================================

/// Pair 전략 — 두 심볼의 가격 조건에 따른 동시 주문 설정
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Pair {
    /// 리소스 이름 (pairs/{id})
    #[prost(string, tag="1")]
    pub name: ::prost::alloc::string::String,
    /// Pair ID
    #[prost(int32, tag="2")]
    pub id: i32,
    /// 전략 이름 (고유)
    #[prost(string, tag="3")]
    pub display_name: ::prost::alloc::string::String,
    /// Portfolio ID
    #[prost(int32, tag="4")]
    pub portfolio_id: i32,
    /// Left 엔트리
    #[prost(message, optional, tag="5")]
    pub left: ::core::option::Option<PairEntry>,
    /// Right 엔트리
    #[prost(message, optional, tag="6")]
    pub right: ::core::option::Option<PairEntry>,
    /// 가격 비교 조건 (oneof)
    #[prost(message, optional, tag="7")]
    pub condition: ::core::option::Option<PairCondition>,
    /// 주문 실행 설정
    #[prost(message, optional, tag="8")]
    pub exec_config: ::core::option::Option<PairExecConfig>,
    /// 상태
    #[prost(enumeration="PairStatus", tag="9")]
    pub status: i32,
    /// 실행 모드 (oneof)
    #[prost(message, optional, tag="10")]
    pub mode: ::core::option::Option<PairMode>,
    /// 생성 시간
    #[prost(message, optional, tag="11")]
    pub create_time: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
    /// 수정 시간
    #[prost(message, optional, tag="12")]
    pub update_time: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
}
// ============================================================================
// Pair Entry
// ============================================================================

/// 페어의 한쪽 엔트리 (단일 심볼 주문 스펙)
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PairEntry {
    /// 종목 심볼
    #[prost(string, tag="1")]
    pub symbol: ::prost::alloc::string::String,
    /// 주문에 사용할 펀드 코드
    #[prost(string, tag="2")]
    pub fund_code: ::prost::alloc::string::String,
    /// 주문 방향
    #[prost(enumeration="PairSide", tag="3")]
    pub side: i32,
    /// 주문 수량 (1 이상)
    #[prost(int64, tag="4")]
    pub quantity: i64,
    /// 참조 가격 소스
    #[prost(enumeration="PriceSource", tag="5")]
    pub price_source: i32,
    /// 지정가 산출 시 참조 호가에서 이동할 틱 수
    /// Bid: 양수 = 더 높은 가격. Ask: 양수 = 더 낮은 가격.
    #[prost(int32, tag="6")]
    pub price_offset_ticks: i32,
}
// ============================================================================
// Pair Condition (oneof wrapper)
// ============================================================================

/// 페어 가격 비교 조건 (세 가지 variant 중 하나)
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct PairCondition {
    #[prost(oneof="pair_condition::Kind", tags="1, 2, 3")]
    pub kind: ::core::option::Option<pair_condition::Kind>,
}
/// Nested message and enum types in `PairCondition`.
pub mod pair_condition {
    #[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
    pub enum Kind {
        /// 절대 스프레드 금액 기준
        #[prost(message, tag="1")]
        SpreadAmount(super::SpreadAmountCondition),
        /// 상대 스프레드 (bps) 기준
        #[prost(message, tag="2")]
        SpreadBps(super::SpreadBpsCondition),
        /// 가격 비율 기준
        #[prost(message, tag="3")]
        PriceRatio(super::PriceRatioCondition),
    }
}
/// 절대 스프레드 금액 조건 (|left - right| >= threshold)
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SpreadAmountCondition {
    /// 스프레드 임계값 (원, 1 이상)
    #[prost(int64, tag="1")]
    pub threshold: i64,
    /// 트리거 방향
    #[prost(enumeration="SpreadDirection", tag="2")]
    pub direction: i32,
}
/// 상대 스프레드 (bps) 조건 (|spread| / mid * 10000 >= threshold_bps)
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SpreadBpsCondition {
    /// 스프레드 임계값 (bps, 1bp = 0.01%)
    #[prost(double, tag="1")]
    pub threshold_bps: f64,
    /// 트리거 방향
    #[prost(enumeration="SpreadDirection", tag="2")]
    pub direction: i32,
}
/// 가격 비율 조건 (left / right)
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct PriceRatioCondition {
    /// 최소 비율 (이 값 미만이면 RightHigh 트리거)
    #[prost(double, tag="1")]
    pub min_ratio: f64,
    /// 최대 비율 (이 값 초과 시 LeftHigh 트리거)
    #[prost(double, tag="2")]
    pub max_ratio: f64,
}
// ============================================================================
// Pair Execution Config
// ============================================================================

/// 페어 주문 실행 설정
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct PairExecConfig {
    /// 주문 유형
    #[prost(enumeration="PairOrderType", tag="1")]
    pub order_type: i32,
    /// 트리거 후 재트리거까지 대기시간 (ms)
    #[prost(uint64, tag="2")]
    pub cooldown_ms: u64,
    /// hit 직후 지정가 조정 여부
    #[prost(bool, tag="3")]
    pub apply_tick_offset: bool,
}
// ============================================================================
// Pair Mode (oneof wrapper)
// ============================================================================

/// Pair 실행 모드
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct PairMode {
    #[prost(oneof="pair_mode::Kind", tags="1, 2")]
    pub kind: ::core::option::Option<pair_mode::Kind>,
}
/// Nested message and enum types in `PairMode`.
pub mod pair_mode {
    #[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
    pub enum Kind {
        /// 기존 동작: 두 시세 비교 후 조건 충족 시 양측 동시 발주
        #[prost(message, tag="1")]
        SimultaneousCompare(super::SimultaneousCompare),
        /// 신규: pricer 시세 기반 maker 호가 유지 + 체결 시 taker 헷지
        #[prost(message, tag="2")]
        PricingMakerTaker(super::PricingMakerTaker),
    }
}
/// SimultaneousCompare 모드 설정 (현재 파라미터 없음)
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SimultaneousCompare {
}
/// PricingMakerTaker 모드 설정
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct PricingMakerTaker {
    /// maker 역할 leg (반대 leg가 pricer 겸 taker)
    #[prost(enumeration="PairLeg", tag="1")]
    pub maker_leg: i32,
    /// pricer → maker 가격 환산 방식
    #[prost(message, optional, tag="2")]
    pub pricing: ::core::option::Option<PairPricingMethod>,
    /// 정정(retick) 정책
    #[prost(message, optional, tag="3")]
    pub retick: ::core::option::Option<RetickPolicy>,
    /// taker(헷지) 측 주문 유형
    #[prost(enumeration="PairOrderType", tag="4")]
    pub taker_order_type: i32,
}
// ============================================================================
// Pair Pricing Method (oneof wrapper)
// ============================================================================

/// pricer 가격으로부터 maker fair price를 산출하는 방식
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct PairPricingMethod {
    #[prost(oneof="pair_pricing_method::Method", tags="1, 2")]
    pub method: ::core::option::Option<pair_pricing_method::Method>,
}
/// Nested message and enum types in `PairPricingMethod`.
pub mod pair_pricing_method {
    #[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
    pub enum Method {
        /// 선형 환산: maker_price = pricer_price * multiple + basis(side)
        #[prost(message, tag="1")]
        LinearBasis(super::LinearBasis),
        /// ETF NAV 기반 환산 (ETF↔선물 비선형 케이스)
        #[prost(message, tag="2")]
        EtfNav(super::EtfNav),
    }
}
/// 선형 환산 방식
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct LinearBasis {
    /// 배율 (예: 1.0, non-zero finite)
    #[prost(double, tag="1")]
    pub multiple: f64,
    /// Bid quote 산출용 basis 오프셋 (원)
    #[prost(int64, tag="2")]
    pub basis_bid: i64,
    /// Ask quote 산출용 basis 오프셋 (원)
    #[prost(int64, tag="3")]
    pub basis_ask: i64,
}
/// ETF NAV 기반 환산 방식
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct EtfNav {
    /// NAV 계산 공식 종류
    #[prost(enumeration="EtfNavKind", tag="1")]
    pub pricing_kind: i32,
    /// 환산 방향 (Inverse: pricer=ETF→maker=선물, Forward: pricer=선물→maker=ETF)
    #[prost(enumeration="NavDirection", tag="2")]
    pub direction: i32,
    /// 정적 pricing 파라미터 snapshot
    #[prost(message, optional, tag="3")]
    pub ctx: ::core::option::Option<PricingContextSnapshot>,
    /// Bid quote 산출용 basis (원, raw int64)
    #[prost(int64, tag="4")]
    pub bid_basis: i64,
    /// Ask quote 산출용 basis (원, raw int64)
    #[prost(int64, tag="5")]
    pub ask_basis: i64,
    /// PDF/Pdf fallback용 선형 배율 (inverse 모드, 기본 1.0)
    #[prost(double, tag="6")]
    pub linear_fallback_multiplier: f64,
    /// FutureBasis/LeverageFuture variant의 전일 기초지수 가격 (원, raw int64)
    /// EtfNavKind가 FUTURE_BASIS 또는 LEVERAGE_FUTURE일 때 필수
    #[prost(int64, tag="7")]
    pub prev_index: i64,
    /// LeverageFuture variant의 전일 선물 가격 (원, raw int64)
    /// EtfNavKind가 LEVERAGE_FUTURE일 때 필수
    #[prost(int64, tag="8")]
    pub prev_future: i64,
}
/// PricingContext 정적 파라미터 snapshot
/// (Price 타입은 i64 raw value 기반 — int64로 직렬화)
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct PricingContextSnapshot {
    /// 전일 NAV (LeverageFuture의 nav0)
    #[prost(int64, tag="1")]
    pub nav0: i64,
    /// 바스켓 내 현물(Stock/ETF) 비중 (0.0 ~ 1.0)
    #[prost(double, tag="2")]
    pub stock_ratio: f64,
    /// 실질 레버리지 (= unit_delta / Nav0, 인버스면 부호 반전)
    #[prost(double, tag="3")]
    pub actual_leverage: f64,
    /// 단위 델타 (unit_delta)
    #[prost(int64, tag="4")]
    pub unit_delta: i64,
    /// 주당 현금 (cash_per_share)
    #[prost(int64, tag="5")]
    pub cash_per_share: i64,
    /// 지수 추종 배율 (IndexTrackingHedge 시 필수, 그 외 미사용)
    #[prost(int64, optional, tag="6")]
    pub tracking_multiple: ::core::option::Option<i64>,
}
// ============================================================================
// Retick Policy
// ============================================================================

/// maker 정정(amend) 정책
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct RetickPolicy {
    /// fair 가격이 이 tick 수 이상 이동해야 정정 (1 이상)
    #[prost(int32, tag="1")]
    pub tick_threshold: i32,
    /// 직전 정정으로부터 이만큼 경과해야 다음 정정 허용 (ms)
    #[prost(uint64, tag="2")]
    pub amend_cooldown_ms: u64,
    /// stop 시 미체결 maker 주문 자동 취소 여부
    #[prost(bool, tag="3")]
    pub cancel_on_stop: bool,
}
// ============================================================================
// Request / Response Messages — CRUD
// ============================================================================

#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetPairRequest {
    /// 리소스 이름 (pairs/{id})
    #[prost(string, tag="1")]
    pub pair: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListPairsRequest {
    /// 페이지 크기 (optional)
    #[prost(int32, optional, tag="1")]
    pub page_size: ::core::option::Option<i32>,
    /// 페이지 토큰 (optional, for pagination)
    #[prost(string, optional, tag="2")]
    pub page_token: ::core::option::Option<::prost::alloc::string::String>,
    /// 필터링 조건 (optional, AIP-160)
    ///
    /// Available Fields:
    /// * status - 상태 (ACTIVE / PAUSED / ARCHIVED)
    /// * portfolio_id - Portfolio ID
    ///
    /// Examples:
    /// * status=ACTIVE
    /// * portfolio_id=1
    #[prost(string, tag="3")]
    pub filter: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListPairsResponse {
    /// Pair 목록
    #[prost(message, repeated, tag="1")]
    pub pairs: ::prost::alloc::vec::Vec<Pair>,
    /// 다음 페이지 토큰
    #[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 CreatePairRequest {
    /// 생성할 Pair
    #[prost(message, optional, tag="1")]
    pub pair: ::core::option::Option<Pair>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdatePairRequest {
    /// 수정할 Pair
    #[prost(message, optional, tag="1")]
    pub pair: ::core::option::Option<Pair>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeletePairRequest {
    /// 리소스 이름 (pairs/{id})
    #[prost(string, tag="1")]
    pub pair: ::prost::alloc::string::String,
}
// ============================================================================
// Request / Response Messages — Lifecycle
// ============================================================================

#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ActivatePairRequest {
    /// 리소스 이름 (pairs/{id})
    #[prost(string, tag="1")]
    pub pair: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PausePairRequest {
    /// 리소스 이름 (pairs/{id})
    #[prost(string, tag="1")]
    pub pair: ::prost::alloc::string::String,
}
// ============================================================================
// Pair Execution Log (SimultaneousCompare 모드 사이클별 기록)
// ============================================================================

/// 페어 실행 로그 레코드
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PairExecutionLog {
    /// Pair ID
    #[prost(int32, tag="1")]
    pub pair_id: i32,
    /// 시그널 시나리오 (예: "LEFT_HIGH", "RIGHT_HIGH")
    #[prost(string, tag="2")]
    pub scenario: ::prost::alloc::string::String,
    /// 실행 결과
    #[prost(enumeration="PairExecutionOutcome", tag="3")]
    pub outcome: i32,
    /// Left 측 주문 ID (발주 성공 시)
    #[prost(uint64, optional, tag="4")]
    pub left_order_id: ::core::option::Option<u64>,
    /// Right 측 주문 ID (발주 성공 시)
    #[prost(uint64, optional, tag="5")]
    pub right_order_id: ::core::option::Option<u64>,
    /// Left 참조 가격 (원, raw int64)
    #[prost(int64, tag="6")]
    pub left_price: i64,
    /// Right 참조 가격 (원, raw int64)
    #[prost(int64, tag="7")]
    pub right_price: i64,
    /// 스프레드 (left - right, 원, raw int64)
    #[prost(int64, tag="8")]
    pub spread: i64,
    /// 발주 시각
    #[prost(message, optional, tag="9")]
    pub dispatched_at: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
    /// 상세 내용 (오류 메시지 등, optional)
    #[prost(string, optional, tag="10")]
    pub detail: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListPairExecutionLogsRequest {
    /// 리소스 이름 (pairs/{id})
    #[prost(string, tag="1")]
    pub pair: ::prost::alloc::string::String,
    /// 페이지 크기 (기본: 50, 최대: 200)
    #[prost(int32, optional, tag="2")]
    pub page_size: ::core::option::Option<i32>,
    /// 페이지 토큰 (다음 페이지 조회용)
    #[prost(string, optional, tag="3")]
    pub page_token: ::core::option::Option<::prost::alloc::string::String>,
    /// 정렬 기준 (기본: dispatched_at DESC)
    #[prost(string, tag="4")]
    pub order_by: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListPairExecutionLogsResponse {
    /// 실행 로그 목록
    #[prost(message, repeated, tag="1")]
    pub execution_logs: ::prost::alloc::vec::Vec<PairExecutionLog>,
    /// 다음 페이지 토큰
    #[prost(string, tag="2")]
    pub next_page_token: ::prost::alloc::string::String,
    /// 전체 건수
    #[prost(int32, tag="3")]
    pub total_count: i32,
}
// ============================================================================
// Maker-Taker Event Log (PricingMakerTaker 모드 전용)
// ============================================================================

/// Maker-Taker 이벤트 로그 레코드
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MakerTakerEventLog {
    /// Pair ID
    #[prost(int32, tag="1")]
    pub pair_id: i32,
    /// 이벤트 유형
    #[prost(enumeration="MakerTakerEventType", tag="2")]
    pub event_type: i32,
    /// 사이클 식별자 (동일 사이클의 이벤트를 묶음)
    #[prost(int64, tag="3")]
    pub cycle_id: i64,
    /// maker 주문 ID (해당 이벤트에서 참조 가능한 경우)
    #[prost(uint64, optional, tag="4")]
    pub maker_order_id: ::core::option::Option<u64>,
    /// taker 주문 ID (TakerSubmitted / TakerFilled 시점)
    #[prost(uint64, optional, tag="5")]
    pub taker_order_id: ::core::option::Option<u64>,
    /// 해당 이벤트 시점의 maker fair price (원, raw int64)
    #[prost(int64, optional, tag="6")]
    pub fair_price: ::core::option::Option<i64>,
    /// 정정 시 새 호가 (MakerAmended 전용, 원, raw int64)
    #[prost(int64, optional, tag="7")]
    pub new_price: ::core::option::Option<i64>,
    /// 체결 가격 (MakerFilled / TakerFilled, 원, raw int64)
    #[prost(int64, optional, tag="8")]
    pub fill_price: ::core::option::Option<i64>,
    /// 체결 수량 (MakerFilled / TakerFilled)
    #[prost(int64, optional, tag="9")]
    pub fill_quantity: ::core::option::Option<i64>,
    /// 이벤트 발생 시각
    #[prost(message, optional, tag="10")]
    pub at: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
    /// 상세 내용 (optional)
    #[prost(string, optional, tag="11")]
    pub detail: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListMakerTakerEventsRequest {
    /// 리소스 이름 (pairs/{id})
    #[prost(string, tag="1")]
    pub pair: ::prost::alloc::string::String,
    /// 페이지 크기 (기본: 50, 최대: 200)
    #[prost(int32, optional, tag="2")]
    pub page_size: ::core::option::Option<i32>,
    /// 페이지 토큰 (다음 페이지 조회용)
    #[prost(string, optional, tag="3")]
    pub page_token: ::core::option::Option<::prost::alloc::string::String>,
    /// 필터링 조건 (optional)
    ///
    /// Available Fields:
    /// * cycle_id - 사이클 ID
    /// * event_type - 이벤트 유형
    #[prost(string, tag="4")]
    pub filter: ::prost::alloc::string::String,
    /// 정렬 기준 (기본: at DESC)
    #[prost(string, tag="5")]
    pub order_by: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListMakerTakerEventsResponse {
    /// 이벤트 로그 목록
    #[prost(message, repeated, tag="1")]
    pub events: ::prost::alloc::vec::Vec<MakerTakerEventLog>,
    /// 다음 페이지 토큰
    #[prost(string, tag="2")]
    pub next_page_token: ::prost::alloc::string::String,
    /// 전체 건수
    #[prost(int32, tag="3")]
    pub total_count: i32,
}
// ============================================================================
// Real-time Status Streaming
// ============================================================================

/// StreamPairStatus 요청
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamPairStatusRequest {
    /// 리소스 이름 (pairs/{id})
    #[prost(string, tag="1")]
    pub pair: ::prost::alloc::string::String,
}
/// 페어 단일 leg 실시간 상태 스냅샷
/// (태그 번호는 클라이언트 UI 계약으로 보존됨)
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct LegStatus {
    /// 미체결 수량 (submitted - filled)
    #[prost(int64, tag="1")]
    pub unfilled_quantity: i64,
    /// 누적 체결 수량 (현재 세션 메모리 카운터, 재시작 시 0)
    #[prost(int64, tag="2")]
    pub filled_quantity: i64,
    /// 체결 VWAP (milli-won 단위)
    #[prost(int64, tag="3")]
    pub avg_fill_price: i64,
    /// 누적 발주 수량 (현재 세션 메모리 카운터)
    #[prost(int64, tag="4")]
    pub submitted_quantity: i64,
}
/// StreamPairStatus 스트리밍 응답 — 페어 상태 스냅샷
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PairStatusUpdate {
    /// 리소스 이름 (pairs/{id})
    #[prost(string, tag="1")]
    pub pair: ::prost::alloc::string::String,
    /// Left leg 상태
    #[prost(message, optional, tag="2")]
    pub left: ::core::option::Option<LegStatus>,
    /// Right leg 상태
    #[prost(message, optional, tag="3")]
    pub right: ::core::option::Option<LegStatus>,
    /// 스냅샷 시각
    #[prost(message, optional, tag="4")]
    pub updated_at: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
}
// ============================================================================
// Pair Statistics
// ============================================================================

/// GetPairStatistics 요청
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetPairStatisticsRequest {
    /// 리소스 이름 (pairs/{id})
    #[prost(string, tag="1")]
    pub pair: ::prost::alloc::string::String,
}
/// 페어 누적 통계 스냅샷 (인메모리 카운터 기반)
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PairStatistics {
    /// 리소스 이름 (pairs/{id})
    #[prost(string, tag="1")]
    pub pair: ::prost::alloc::string::String,
    /// left + right 누적 발주 수량
    #[prost(int64, tag="2")]
    pub total_submitted: i64,
    /// left + right 누적 체결 수량
    #[prost(int64, tag="3")]
    pub total_filled: i64,
    /// Spread 모드: 발주 성공 횟수 / PricingMakerTaker 모드: 사이클 수
    #[prost(int64, tag="4")]
    pub execution_count: i64,
    /// 실현 손익 (milli-won). 현재 메모리 카운터 기반, Spread 모드는 0.
    #[prost(int64, tag="5")]
    pub realized_pnl: i64,
}
/// 주문 방향
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PairSide {
    Unspecified = 0,
    /// 매수
    Bid = 1,
    /// 매도
    Ask = 2,
}
impl PairSide {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            PairSide::Unspecified => "PAIR_SIDE_UNSPECIFIED",
            PairSide::Bid => "PAIR_SIDE_BID",
            PairSide::Ask => "PAIR_SIDE_ASK",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "PAIR_SIDE_UNSPECIFIED" => Some(Self::Unspecified),
            "PAIR_SIDE_BID" => Some(Self::Bid),
            "PAIR_SIDE_ASK" => Some(Self::Ask),
            _ => None,
        }
    }
}
/// 참조 가격 소스
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PriceSource {
    Unspecified = 0,
    /// 중간가 (Bid1 + Ask1) / 2
    MidPrice = 1,
    /// 직전 체결가
    LastPrice = 2,
    /// 최우선 매수호가
    BestBid = 3,
    /// 최우선 매도호가
    BestAsk = 4,
}
impl PriceSource {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            PriceSource::Unspecified => "PRICE_SOURCE_UNSPECIFIED",
            PriceSource::MidPrice => "PRICE_SOURCE_MID_PRICE",
            PriceSource::LastPrice => "PRICE_SOURCE_LAST_PRICE",
            PriceSource::BestBid => "PRICE_SOURCE_BEST_BID",
            PriceSource::BestAsk => "PRICE_SOURCE_BEST_ASK",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "PRICE_SOURCE_UNSPECIFIED" => Some(Self::Unspecified),
            "PRICE_SOURCE_MID_PRICE" => Some(Self::MidPrice),
            "PRICE_SOURCE_LAST_PRICE" => Some(Self::LastPrice),
            "PRICE_SOURCE_BEST_BID" => Some(Self::BestBid),
            "PRICE_SOURCE_BEST_ASK" => Some(Self::BestAsk),
            _ => None,
        }
    }
}
/// 스프레드 방향 (어느 쪽이 비쌀 때 트리거할지)
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SpreadDirection {
    Unspecified = 0,
    /// Left가 비쌀 때만 트리거
    LeftHigh = 1,
    /// Right가 비쌀 때만 트리거
    RightHigh = 2,
    /// 양방향
    Both = 3,
}
impl SpreadDirection {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            SpreadDirection::Unspecified => "SPREAD_DIRECTION_UNSPECIFIED",
            SpreadDirection::LeftHigh => "SPREAD_DIRECTION_LEFT_HIGH",
            SpreadDirection::RightHigh => "SPREAD_DIRECTION_RIGHT_HIGH",
            SpreadDirection::Both => "SPREAD_DIRECTION_BOTH",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "SPREAD_DIRECTION_UNSPECIFIED" => Some(Self::Unspecified),
            "SPREAD_DIRECTION_LEFT_HIGH" => Some(Self::LeftHigh),
            "SPREAD_DIRECTION_RIGHT_HIGH" => Some(Self::RightHigh),
            "SPREAD_DIRECTION_BOTH" => Some(Self::Both),
            _ => None,
        }
    }
}
/// 페어 주문 유형
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PairOrderType {
    Unspecified = 0,
    /// 지정가
    Limit = 1,
    /// 시장가
    Market = 2,
    /// 공격적 지정가 (상대 최우선 호가 기반)
    Aggressive = 3,
}
impl PairOrderType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            PairOrderType::Unspecified => "PAIR_ORDER_TYPE_UNSPECIFIED",
            PairOrderType::Limit => "PAIR_ORDER_TYPE_LIMIT",
            PairOrderType::Market => "PAIR_ORDER_TYPE_MARKET",
            PairOrderType::Aggressive => "PAIR_ORDER_TYPE_AGGRESSIVE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "PAIR_ORDER_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "PAIR_ORDER_TYPE_LIMIT" => Some(Self::Limit),
            "PAIR_ORDER_TYPE_MARKET" => Some(Self::Market),
            "PAIR_ORDER_TYPE_AGGRESSIVE" => Some(Self::Aggressive),
            _ => None,
        }
    }
}
// ============================================================================
// Pair Status
// ============================================================================

/// Pair 상태
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PairStatus {
    Unspecified = 0,
    /// 운영 중 (hot loop 동작)
    Active = 1,
    /// 일시 중지
    Paused = 2,
    /// 보관 (더 이상 사용 안 함)
    Archived = 3,
}
impl PairStatus {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            PairStatus::Unspecified => "PAIR_STATUS_UNSPECIFIED",
            PairStatus::Active => "PAIR_STATUS_ACTIVE",
            PairStatus::Paused => "PAIR_STATUS_PAUSED",
            PairStatus::Archived => "PAIR_STATUS_ARCHIVED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "PAIR_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
            "PAIR_STATUS_ACTIVE" => Some(Self::Active),
            "PAIR_STATUS_PAUSED" => Some(Self::Paused),
            "PAIR_STATUS_ARCHIVED" => Some(Self::Archived),
            _ => None,
        }
    }
}
/// Pair leg 식별자
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PairLeg {
    Unspecified = 0,
    Left = 1,
    Right = 2,
}
impl PairLeg {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            PairLeg::Unspecified => "PAIR_LEG_UNSPECIFIED",
            PairLeg::Left => "PAIR_LEG_LEFT",
            PairLeg::Right => "PAIR_LEG_RIGHT",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "PAIR_LEG_UNSPECIFIED" => Some(Self::Unspecified),
            "PAIR_LEG_LEFT" => Some(Self::Left),
            "PAIR_LEG_RIGHT" => Some(Self::Right),
            _ => None,
        }
    }
}
/// ETF NAV 계산 공식 종류
/// (PdfNavHedge/PdfDecomposeHedge는 Pair 미지원 — 서버에서 거부됨)
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum EtfNavKind {
    Unspecified = 0,
    /// 지수 추종 헷지 프라이싱: (future + basis) * multiple + cash
    IndexTrackingHedge = 1,
    /// 선물 베이시스 기반: unit_delta * future / (prev_index + basis) + cash
    FutureBasis = 2,
    /// 레버리지/인버스 ETF용 선물 기반
    LeverageFuture = 3,
}
impl EtfNavKind {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            EtfNavKind::Unspecified => "ETF_NAV_KIND_UNSPECIFIED",
            EtfNavKind::IndexTrackingHedge => "ETF_NAV_KIND_INDEX_TRACKING_HEDGE",
            EtfNavKind::FutureBasis => "ETF_NAV_KIND_FUTURE_BASIS",
            EtfNavKind::LeverageFuture => "ETF_NAV_KIND_LEVERAGE_FUTURE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "ETF_NAV_KIND_UNSPECIFIED" => Some(Self::Unspecified),
            "ETF_NAV_KIND_INDEX_TRACKING_HEDGE" => Some(Self::IndexTrackingHedge),
            "ETF_NAV_KIND_FUTURE_BASIS" => Some(Self::FutureBasis),
            "ETF_NAV_KIND_LEVERAGE_FUTURE" => Some(Self::LeverageFuture),
            _ => None,
        }
    }
}
/// NAV 환산 방향
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum NavDirection {
    Unspecified = 0,
    /// pricer=ETF → maker=선물 가격 역산
    Inverse = 1,
    /// pricer=선물 → maker=ETF NAV forward 산출
    Forward = 2,
}
impl NavDirection {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            NavDirection::Unspecified => "NAV_DIRECTION_UNSPECIFIED",
            NavDirection::Inverse => "NAV_DIRECTION_INVERSE",
            NavDirection::Forward => "NAV_DIRECTION_FORWARD",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "NAV_DIRECTION_UNSPECIFIED" => Some(Self::Unspecified),
            "NAV_DIRECTION_INVERSE" => Some(Self::Inverse),
            "NAV_DIRECTION_FORWARD" => Some(Self::Forward),
            _ => None,
        }
    }
}
/// 페어 실행 결과
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PairExecutionOutcome {
    Unspecified = 0,
    /// 발주 성공
    Submitted = 1,
    /// 사전 검증 실패로 스킵
    SkippedPreValidation = 2,
    /// 쿨다운 중 스킵
    SkippedCooldown = 3,
    /// 사전 계산 없음으로 스킵
    SkippedNoPrecomputed = 4,
    /// 한쪽만 발주 성공 (부분 실패)
    PartialFailure = 5,
    /// 전체 실패
    Failed = 6,
}
impl PairExecutionOutcome {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            PairExecutionOutcome::Unspecified => "PAIR_EXECUTION_OUTCOME_UNSPECIFIED",
            PairExecutionOutcome::Submitted => "PAIR_EXECUTION_OUTCOME_SUBMITTED",
            PairExecutionOutcome::SkippedPreValidation => "PAIR_EXECUTION_OUTCOME_SKIPPED_PRE_VALIDATION",
            PairExecutionOutcome::SkippedCooldown => "PAIR_EXECUTION_OUTCOME_SKIPPED_COOLDOWN",
            PairExecutionOutcome::SkippedNoPrecomputed => "PAIR_EXECUTION_OUTCOME_SKIPPED_NO_PRECOMPUTED",
            PairExecutionOutcome::PartialFailure => "PAIR_EXECUTION_OUTCOME_PARTIAL_FAILURE",
            PairExecutionOutcome::Failed => "PAIR_EXECUTION_OUTCOME_FAILED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "PAIR_EXECUTION_OUTCOME_UNSPECIFIED" => Some(Self::Unspecified),
            "PAIR_EXECUTION_OUTCOME_SUBMITTED" => Some(Self::Submitted),
            "PAIR_EXECUTION_OUTCOME_SKIPPED_PRE_VALIDATION" => Some(Self::SkippedPreValidation),
            "PAIR_EXECUTION_OUTCOME_SKIPPED_COOLDOWN" => Some(Self::SkippedCooldown),
            "PAIR_EXECUTION_OUTCOME_SKIPPED_NO_PRECOMPUTED" => Some(Self::SkippedNoPrecomputed),
            "PAIR_EXECUTION_OUTCOME_PARTIAL_FAILURE" => Some(Self::PartialFailure),
            "PAIR_EXECUTION_OUTCOME_FAILED" => Some(Self::Failed),
            _ => None,
        }
    }
}
/// Maker-Taker 이벤트 유형
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MakerTakerEventType {
    Unspecified = 0,
    /// maker 신규 발주 (FEP submit 직후)
    MakerSubmitted = 1,
    /// maker 정정 (가격/수량 변경)
    MakerAmended = 2,
    /// maker 부분/완전 체결
    MakerFilled = 3,
    /// maker 주문 reject
    MakerRejected = 4,
    /// maker 주문 거래소 auto-cancel
    MakerCancelled = 5,
    /// taker 헷지 주문 발주
    TakerSubmitted = 6,
    /// taker 헷지 체결
    TakerFilled = 7,
    /// taker 헷지 reject (수동 개입 필요)
    TakerRejected = 8,
}
impl MakerTakerEventType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            MakerTakerEventType::Unspecified => "MAKER_TAKER_EVENT_TYPE_UNSPECIFIED",
            MakerTakerEventType::MakerSubmitted => "MAKER_TAKER_EVENT_TYPE_MAKER_SUBMITTED",
            MakerTakerEventType::MakerAmended => "MAKER_TAKER_EVENT_TYPE_MAKER_AMENDED",
            MakerTakerEventType::MakerFilled => "MAKER_TAKER_EVENT_TYPE_MAKER_FILLED",
            MakerTakerEventType::MakerRejected => "MAKER_TAKER_EVENT_TYPE_MAKER_REJECTED",
            MakerTakerEventType::MakerCancelled => "MAKER_TAKER_EVENT_TYPE_MAKER_CANCELLED",
            MakerTakerEventType::TakerSubmitted => "MAKER_TAKER_EVENT_TYPE_TAKER_SUBMITTED",
            MakerTakerEventType::TakerFilled => "MAKER_TAKER_EVENT_TYPE_TAKER_FILLED",
            MakerTakerEventType::TakerRejected => "MAKER_TAKER_EVENT_TYPE_TAKER_REJECTED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "MAKER_TAKER_EVENT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "MAKER_TAKER_EVENT_TYPE_MAKER_SUBMITTED" => Some(Self::MakerSubmitted),
            "MAKER_TAKER_EVENT_TYPE_MAKER_AMENDED" => Some(Self::MakerAmended),
            "MAKER_TAKER_EVENT_TYPE_MAKER_FILLED" => Some(Self::MakerFilled),
            "MAKER_TAKER_EVENT_TYPE_MAKER_REJECTED" => Some(Self::MakerRejected),
            "MAKER_TAKER_EVENT_TYPE_MAKER_CANCELLED" => Some(Self::MakerCancelled),
            "MAKER_TAKER_EVENT_TYPE_TAKER_SUBMITTED" => Some(Self::TakerSubmitted),
            "MAKER_TAKER_EVENT_TYPE_TAKER_FILLED" => Some(Self::TakerFilled),
            "MAKER_TAKER_EVENT_TYPE_TAKER_REJECTED" => Some(Self::TakerRejected),
            _ => None,
        }
    }
}
include!("kdo.v1.pair.tonic.rs");
include!("kdo.v1.pair.serde.rs");
// @@protoc_insertion_point(module)