Skip to main content

ids_apis/
kdo.v1.auto_amend.rs

1// @generated
2// This file is @generated by prost-build.
3// ============================================================================
4// Entities
5// ============================================================================
6
7/// 자동정정 등록 주문
8#[allow(clippy::derive_partial_eq_without_eq)]
9#[derive(Clone, PartialEq, ::prost::Message)]
10pub struct AutoAmendOrder {
11    /// 주문 ID
12    #[prost(uint64, tag="1")]
13    pub order_id: u64,
14    /// 종목 심볼
15    #[prost(string, tag="2")]
16    pub symbol: ::prost::alloc::string::String,
17    /// 주문 방향
18    #[prost(enumeration="super::common::OrderSide", tag="3")]
19    pub side: i32,
20    /// 현재 주문 가격
21    #[prost(string, tag="4")]
22    pub price: ::prost::alloc::string::String,
23    /// 현재 주문 수량
24    #[prost(int64, tag="5")]
25    pub quantity: i64,
26    /// 미체결 수량
27    #[prost(int64, tag="6")]
28    pub remaining_quantity: i64,
29    /// 자동정정 설정
30    #[prost(message, optional, tag="7")]
31    pub config: ::core::option::Option<AmendConfig>,
32    /// 정정 횟수
33    #[prost(uint32, tag="8")]
34    pub amend_count: u32,
35    /// 마지막 정정 시각 (unix timestamp ms)
36    #[prost(int64, tag="9")]
37    pub last_amend_time_ms: i64,
38    /// 활성화 여부
39    #[prost(bool, tag="10")]
40    pub is_active: bool,
41}
42// ============================================================================
43// Configuration
44// ============================================================================
45
46/// 자동정정 설정
47#[allow(clippy::derive_partial_eq_without_eq)]
48#[derive(Clone, Copy, PartialEq, ::prost::Message)]
49pub struct AmendConfig {
50    /// 장중 정정 설정
51    #[prost(message, optional, tag="1")]
52    pub regular_session: ::core::option::Option<RegularSessionConfig>,
53    /// 동시호가 정정 설정
54    #[prost(message, optional, tag="2")]
55    pub auction_session: ::core::option::Option<AuctionSessionConfig>,
56}
57/// 장중 자동정정 설정
58#[allow(clippy::derive_partial_eq_without_eq)]
59#[derive(Clone, Copy, PartialEq, ::prost::Message)]
60pub struct RegularSessionConfig {
61    /// 활성화 여부
62    #[prost(bool, tag="1")]
63    pub enabled: bool,
64    /// 상대호가 잔량 비율 임계값 (0.0 ~ 1.0)
65    /// 매수: 매도1호가잔량 / 매수1호가잔량 < threshold → 매도1호가로 정정
66    /// 매도: 매수1호가잔량 / 매도1호가잔량 < threshold → 매수1호가로 정정
67    #[prost(double, tag="2")]
68    pub opposite_qty_ratio_threshold: f64,
69}
70/// 동시호가 정정 설정 (예체가 관여 방지)
71#[allow(clippy::derive_partial_eq_without_eq)]
72#[derive(Clone, Copy, PartialEq, ::prost::Message)]
73pub struct AuctionSessionConfig {
74    /// 활성화 여부
75    #[prost(bool, tag="1")]
76    pub enabled: bool,
77    /// 예상체결가 대비 허용 가격 범위 (0.0 ~ 1.0, e.g., 0.01 = ±1%)
78    #[prost(double, tag="2")]
79    pub price_limit_pct: f64,
80    /// 예상체결수량 대비 최대 수량 비율 (0.0 ~ 1.0, e.g., 0.30 = 30%)
81    #[prost(double, tag="3")]
82    pub quantity_limit_pct: f64,
83}
84// ============================================================================
85// Session Info
86// ============================================================================
87
88// ============================================================================
89// Service Status
90// ============================================================================
91
92/// 서비스 상태
93#[allow(clippy::derive_partial_eq_without_eq)]
94#[derive(Clone, Copy, PartialEq, ::prost::Message)]
95pub struct ServiceStatus {
96    /// 서비스 실행 중 여부
97    #[prost(bool, tag="1")]
98    pub is_running: bool,
99    /// 현재 세션
100    #[prost(enumeration="super::common::SessionId", tag="2")]
101    pub current_session: i32,
102    /// 활성 주문 수
103    #[prost(uint32, tag="3")]
104    pub active_order_count: u32,
105    /// 총 등록 주문 수
106    #[prost(uint32, tag="4")]
107    pub total_order_count: u32,
108}
109// ============================================================================
110// Events
111// ============================================================================
112
113/// 자동정정 이벤트
114#[allow(clippy::derive_partial_eq_without_eq)]
115#[derive(Clone, PartialEq, ::prost::Message)]
116pub struct AutoAmendEvent {
117    #[prost(oneof="auto_amend_event::Event", tags="1, 2, 3, 4, 5")]
118    pub event: ::core::option::Option<auto_amend_event::Event>,
119}
120/// Nested message and enum types in `AutoAmendEvent`.
121pub mod auto_amend_event {
122    #[allow(clippy::derive_partial_eq_without_eq)]
123#[derive(Clone, PartialEq, ::prost::Oneof)]
124    pub enum Event {
125        #[prost(message, tag="1")]
126        Amended(super::AmendedEvent),
127        #[prost(message, tag="2")]
128        AmendFailed(super::AmendFailedEvent),
129        #[prost(message, tag="3")]
130        SessionChanged(super::SessionChangedEvent),
131        #[prost(message, tag="4")]
132        OrderRegistered(super::OrderRegisteredEvent),
133        #[prost(message, tag="5")]
134        OrderUnregistered(super::OrderUnregisteredEvent),
135    }
136}
137/// 정정 실행 이벤트
138#[allow(clippy::derive_partial_eq_without_eq)]
139#[derive(Clone, PartialEq, ::prost::Message)]
140pub struct AmendedEvent {
141    /// 주문 ID
142    #[prost(uint64, tag="1")]
143    pub order_id: u64,
144    /// 종목 심볼
145    #[prost(string, tag="2")]
146    pub symbol: ::prost::alloc::string::String,
147    /// 정정 액션
148    #[prost(enumeration="AmendAction", tag="3")]
149    pub action: i32,
150    /// 이전 가격
151    #[prost(int64, tag="4")]
152    pub old_price: i64,
153    /// 새 가격
154    #[prost(int64, tag="5")]
155    pub new_price: i64,
156    /// 이전 수량
157    #[prost(int64, tag="6")]
158    pub old_quantity: i64,
159    /// 새 수량
160    #[prost(int64, tag="7")]
161    pub new_quantity: i64,
162    /// 정정 사유
163    #[prost(string, tag="8")]
164    pub reason: ::prost::alloc::string::String,
165}
166/// 정정 실패 이벤트
167#[allow(clippy::derive_partial_eq_without_eq)]
168#[derive(Clone, PartialEq, ::prost::Message)]
169pub struct AmendFailedEvent {
170    /// 주문 ID
171    #[prost(uint64, tag="1")]
172    pub order_id: u64,
173    /// 종목 심볼
174    #[prost(string, tag="2")]
175    pub symbol: ::prost::alloc::string::String,
176    /// 실패 사유
177    #[prost(string, tag="3")]
178    pub reason: ::prost::alloc::string::String,
179}
180/// 세션 변경 이벤트
181#[allow(clippy::derive_partial_eq_without_eq)]
182#[derive(Clone, Copy, PartialEq, ::prost::Message)]
183pub struct SessionChangedEvent {
184    /// 이전 세션
185    #[prost(enumeration="super::common::SessionId", tag="1")]
186    pub old_session: i32,
187    /// 새 세션
188    #[prost(enumeration="super::common::SessionId", tag="2")]
189    pub new_session: i32,
190}
191/// 주문 등록 이벤트
192#[allow(clippy::derive_partial_eq_without_eq)]
193#[derive(Clone, PartialEq, ::prost::Message)]
194pub struct OrderRegisteredEvent {
195    /// 주문 ID
196    #[prost(uint64, tag="1")]
197    pub order_id: u64,
198    /// 종목 심볼
199    #[prost(string, tag="2")]
200    pub symbol: ::prost::alloc::string::String,
201    /// 주문 방향
202    #[prost(enumeration="super::common::OrderSide", tag="3")]
203    pub side: i32,
204}
205/// 주문 해제 이벤트
206#[allow(clippy::derive_partial_eq_without_eq)]
207#[derive(Clone, PartialEq, ::prost::Message)]
208pub struct OrderUnregisteredEvent {
209    /// 주문 ID
210    #[prost(uint64, tag="1")]
211    pub order_id: u64,
212    /// 해제 사유
213    #[prost(string, tag="2")]
214    pub reason: ::prost::alloc::string::String,
215}
216// ============================================================================
217// Request/Response Messages
218// ============================================================================
219
220#[allow(clippy::derive_partial_eq_without_eq)]
221#[derive(Clone, Copy, PartialEq, ::prost::Message)]
222pub struct GetAutoAmendOrderRequest {
223    /// 주문 ID
224    #[prost(uint64, tag="1")]
225    pub order_id: u64,
226}
227#[allow(clippy::derive_partial_eq_without_eq)]
228#[derive(Clone, PartialEq, ::prost::Message)]
229pub struct ListAutoAmendOrdersRequest {
230    /// 종목 필터 (optional)
231    #[prost(string, tag="1")]
232    pub symbol: ::prost::alloc::string::String,
233    /// 주문 방향 필터 (optional)
234    #[prost(enumeration="super::common::OrderSide", tag="2")]
235    pub side: i32,
236    /// 활성화된 주문만 (optional, 기본: true)
237    #[prost(bool, tag="3")]
238    pub active_only: bool,
239}
240#[allow(clippy::derive_partial_eq_without_eq)]
241#[derive(Clone, PartialEq, ::prost::Message)]
242pub struct ListAutoAmendOrdersResponse {
243    /// 등록된 자동 정적 주문 목록
244    #[prost(message, repeated, tag="1")]
245    pub orders: ::prost::alloc::vec::Vec<AutoAmendOrder>,
246}
247#[allow(clippy::derive_partial_eq_without_eq)]
248#[derive(Clone, Copy, PartialEq, ::prost::Message)]
249pub struct UpdateConfigRequest {
250    /// 주문 ID
251    #[prost(uint64, tag="1")]
252    pub order_id: u64,
253    /// 새 설정
254    #[prost(message, optional, tag="2")]
255    pub config: ::core::option::Option<AmendConfig>,
256}
257#[allow(clippy::derive_partial_eq_without_eq)]
258#[derive(Clone, PartialEq, ::prost::Message)]
259pub struct StreamEventsRequest {
260    /// 특정 주문 ID 필터 (optional, 미지정 시 전체)
261    #[prost(uint64, repeated, packed="false", tag="1")]
262    pub order_ids: ::prost::alloc::vec::Vec<u64>,
263}
264/// 정정 액션 타입
265#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
266#[repr(i32)]
267pub enum AmendAction {
268    Unspecified = 0,
269    /// 가격 정정
270    ChangePrice = 1,
271    /// 수량 정정
272    ChangeQuantity = 2,
273    /// 가격+수량 정정
274    ChangePriceAndQuantity = 3,
275}
276impl AmendAction {
277    /// String value of the enum field names used in the ProtoBuf definition.
278    ///
279    /// The values are not transformed in any way and thus are considered stable
280    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
281    pub fn as_str_name(&self) -> &'static str {
282        match self {
283            AmendAction::Unspecified => "AMEND_ACTION_UNSPECIFIED",
284            AmendAction::ChangePrice => "AMEND_ACTION_CHANGE_PRICE",
285            AmendAction::ChangeQuantity => "AMEND_ACTION_CHANGE_QUANTITY",
286            AmendAction::ChangePriceAndQuantity => "AMEND_ACTION_CHANGE_PRICE_AND_QUANTITY",
287        }
288    }
289    /// Creates an enum from field names used in the ProtoBuf definition.
290    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
291        match value {
292            "AMEND_ACTION_UNSPECIFIED" => Some(Self::Unspecified),
293            "AMEND_ACTION_CHANGE_PRICE" => Some(Self::ChangePrice),
294            "AMEND_ACTION_CHANGE_QUANTITY" => Some(Self::ChangeQuantity),
295            "AMEND_ACTION_CHANGE_PRICE_AND_QUANTITY" => Some(Self::ChangePriceAndQuantity),
296            _ => None,
297        }
298    }
299}
300include!("kdo.v1.auto_amend.tonic.rs");
301include!("kdo.v1.auto_amend.serde.rs");
302// @@protoc_insertion_point(module)