Skip to main content

ids_apis/
kdo.v1.order.rs

1// @generated
2// This file is @generated by prost-build.
3// ========== SubmitOrder ==========
4
5#[allow(clippy::derive_partial_eq_without_eq)]
6#[derive(Clone, PartialEq, ::prost::Message)]
7pub struct SubmitOrderRequest {
8    /// 펀드 코드 (필수)
9    #[prost(string, tag="1")]
10    pub fund_code: ::prost::alloc::string::String,
11    /// 종목 코드 ISIN (필수)
12    #[prost(string, tag="2")]
13    pub symbol: ::prost::alloc::string::String,
14    /// 매수/매도 (필수)
15    #[prost(enumeration="super::common::OrderSide", tag="3")]
16    pub side: i32,
17    /// 수량 (필수)
18    #[prost(int64, tag="4")]
19    pub quantity: i64,
20    /// 가격 (필수, 시장가 주문 시 0)
21    #[prost(string, tag="5")]
22    pub price: ::prost::alloc::string::String,
23    /// 주문 유형 (기본: LIMIT)
24    #[prost(enumeration="QuoteType", tag="6")]
25    pub quote_type: i32,
26    /// 유동성 공급자 여부
27    #[prost(bool, tag="7")]
28    pub is_lp: bool,
29    /// 자동정정 전략
30    #[prost(enumeration="super::common::AmendMethodType", optional, tag="8")]
31    pub auto_amend_strategy: ::core::option::Option<i32>,
32    /// 지정가 가격 결정 방식 (미지정 시 price 필드의 가격 사용)
33    #[prost(enumeration="LimitPriceType", optional, tag="9")]
34    pub limit_price_type: ::core::option::Option<i32>,
35    /// 호가조건 (미지정 시 FAS, 일반 지정가)
36    #[prost(enumeration="super::common::OrderConditionType", optional, tag="10")]
37    pub order_condition: ::core::option::Option<i32>,
38    /// 헷지 누적 대상 여부 (미지정 시 false)
39    /// true 로 설정하면 외부에서 직접 제출한 주문의 체결도 hedge accumulator 에 누적되어 목표 헷지에 반영됨.
40    /// 실제 누적되려면 (fund_code, symbol) 조합으로 Hedge 가 DB 에 등록되어 있어야 함.
41    #[prost(bool, optional, tag="11")]
42    pub need_hedge: ::core::option::Option<bool>,
43    /// 자동정정 시작 전 초기 대기 시간 (ms). auto_amend_strategy 지정 시에만 유효, 미지정 시 0 (즉시 정정 시작).
44    #[prost(uint64, optional, tag="12")]
45    pub auto_amend_initial_wait_ms: ::core::option::Option<u64>,
46    /// 퀵주문 출처 (미지정 시 UNSPECIFIED). MM 퀵화면에서 낸 주문은 MM 으로 설정하면
47    /// 그 체결이 MM 서비스 체결통계에 반영된다.
48    #[prost(enumeration="QuickOrderOrigin", optional, tag="13")]
49    pub quick_order_origin: ::core::option::Option<i32>,
50}
51#[allow(clippy::derive_partial_eq_without_eq)]
52#[derive(Clone, PartialEq, ::prost::Message)]
53pub struct SubmitOrderResponse {
54    /// 주문 ID
55    #[prost(uint64, tag="1")]
56    pub order_id: u64,
57    /// 주문 상태
58    #[prost(enumeration="OrderStatus", tag="2")]
59    pub status: i32,
60    /// 결과 메시지
61    #[prost(string, tag="3")]
62    pub message: ::prost::alloc::string::String,
63}
64// ========== AmendOrder ==========
65
66#[allow(clippy::derive_partial_eq_without_eq)]
67#[derive(Clone, PartialEq, ::prost::Message)]
68pub struct AmendOrderRequest {
69    /// 원주문 ID
70    #[prost(uint64, tag="1")]
71    pub original_order_id: u64,
72    /// 종목 코드
73    #[prost(string, tag="3")]
74    pub symbol: ::prost::alloc::string::String,
75    /// 정정 가격
76    #[prost(string, tag="5")]
77    pub price: ::prost::alloc::string::String,
78}
79#[allow(clippy::derive_partial_eq_without_eq)]
80#[derive(Clone, PartialEq, ::prost::Message)]
81pub struct AmendOrderResponse {
82    /// 신규 주문 ID
83    #[prost(uint64, tag="1")]
84    pub order_id: u64,
85    /// 원주문 ID
86    #[prost(uint64, tag="2")]
87    pub original_order_id: u64,
88    /// 주문 상태
89    #[prost(enumeration="OrderStatus", tag="3")]
90    pub status: i32,
91    /// 결과 메시지
92    #[prost(string, tag="4")]
93    pub message: ::prost::alloc::string::String,
94}
95// ========== CancelOrder ==========
96
97#[allow(clippy::derive_partial_eq_without_eq)]
98#[derive(Clone, PartialEq, ::prost::Message)]
99pub struct CancelOrderRequest {
100    /// 원주문 ID
101    #[prost(uint64, tag="1")]
102    pub original_order_id: u64,
103    /// 종목 코드
104    #[prost(string, tag="3")]
105    pub symbol: ::prost::alloc::string::String,
106}
107#[allow(clippy::derive_partial_eq_without_eq)]
108#[derive(Clone, PartialEq, ::prost::Message)]
109pub struct CancelOrderResponse {
110    /// 취소 주문 ID
111    #[prost(uint64, tag="1")]
112    pub order_id: u64,
113    /// 원주문 ID
114    #[prost(uint64, tag="2")]
115    pub original_order_id: u64,
116    /// 주문 상태
117    #[prost(enumeration="OrderStatus", tag="3")]
118    pub status: i32,
119    /// 결과 메시지
120    #[prost(string, tag="4")]
121    pub message: ::prost::alloc::string::String,
122}
123// ========== ListAllUnfilledOrders ==========
124
125#[allow(clippy::derive_partial_eq_without_eq)]
126#[derive(Clone, PartialEq, ::prost::Message)]
127pub struct ListAllUnfilledOrdersRequest {
128    /// 펀드 코드 (optional, 미지정 시 전체 펀드)
129    #[prost(string, optional, tag="1")]
130    pub fund_code: ::core::option::Option<::prost::alloc::string::String>,
131    /// 종목 코드 (optional, 미지정 시 전체 종목)
132    #[prost(string, optional, tag="2")]
133    pub symbol: ::core::option::Option<::prost::alloc::string::String>,
134    /// 매수/매도 (optional, 미지정 시 양방향)
135    #[prost(enumeration="super::common::OrderSide", optional, tag="3")]
136    pub side: ::core::option::Option<i32>,
137}
138#[allow(clippy::derive_partial_eq_without_eq)]
139#[derive(Clone, PartialEq, ::prost::Message)]
140pub struct ListAllUnfilledOrdersResponse {
141    /// 미체결 주문 목록
142    #[prost(message, repeated, tag="1")]
143    pub orders: ::prost::alloc::vec::Vec<Order>,
144}
145// ========== CancelAllOrders ==========
146
147#[allow(clippy::derive_partial_eq_without_eq)]
148#[derive(Clone, Copy, PartialEq, ::prost::Message)]
149pub struct CancelAllOrdersRequest {
150}
151#[allow(clippy::derive_partial_eq_without_eq)]
152#[derive(Clone, PartialEq, ::prost::Message)]
153pub struct CancelAllOrdersResponse {
154    /// 취소 요청된 주문 수
155    #[prost(int32, tag="1")]
156    pub cancelled_count: i32,
157    /// 결과 메시지
158    #[prost(string, tag="2")]
159    pub message: ::prost::alloc::string::String,
160}
161// ========== StreamOrderResults ==========
162
163#[allow(clippy::derive_partial_eq_without_eq)]
164#[derive(Clone, PartialEq, ::prost::Message)]
165pub struct StreamOrderResultsRequest {
166    /// 필터: 특정 펀드만 (optional)
167    #[prost(string, optional, tag="1")]
168    pub fund_code: ::core::option::Option<::prost::alloc::string::String>,
169    /// 필터: 특정 종목만 (optional)
170    #[prost(string, optional, tag="2")]
171    pub symbol: ::core::option::Option<::prost::alloc::string::String>,
172}
173#[allow(clippy::derive_partial_eq_without_eq)]
174#[derive(Clone, PartialEq, ::prost::Message)]
175pub struct OrderResult {
176    /// 주문 ID
177    #[prost(uint64, tag="1")]
178    pub order_id: u64,
179    /// 종목 코드
180    #[prost(string, tag="2")]
181    pub symbol: ::prost::alloc::string::String,
182    /// 펀드 코드
183    #[prost(string, tag="3")]
184    pub fund_code: ::prost::alloc::string::String,
185    /// 매수/매도
186    #[prost(enumeration="super::common::OrderSide", tag="4")]
187    pub side: i32,
188    /// 가격
189    #[prost(string, tag="5")]
190    pub price: ::prost::alloc::string::String,
191    /// 수량
192    #[prost(int64, tag="6")]
193    pub quantity: i64,
194    /// 결과 유형
195    #[prost(enumeration="OrderResultType", tag="7")]
196    pub result_type: i32,
197    /// 타임스탬프
198    #[prost(message, optional, tag="8")]
199    pub timestamp: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
200    /// result_type에 따른 추가 정보
201    #[prost(oneof="order_result::Details", tags="10, 11, 12, 13")]
202    pub details: ::core::option::Option<order_result::Details>,
203}
204/// Nested message and enum types in `OrderResult`.
205pub mod order_result {
206    /// result_type에 따른 추가 정보
207    #[allow(clippy::derive_partial_eq_without_eq)]
208#[derive(Clone, PartialEq, ::prost::Oneof)]
209    pub enum Details {
210        #[prost(message, tag="10")]
211        Received(super::ReceivedDetails),
212        #[prost(message, tag="11")]
213        Rejected(super::RejectedDetails),
214        #[prost(message, tag="12")]
215        Filled(super::FilledDetails),
216        #[prost(message, tag="13")]
217        Cancelled(super::CancelledDetails),
218    }
219}
220#[allow(clippy::derive_partial_eq_without_eq)]
221#[derive(Clone, Copy, PartialEq, ::prost::Message)]
222pub struct ReceivedDetails {
223    /// 접수 시간 (nanoseconds since epoch)
224    #[prost(uint64, tag="1")]
225    pub receive_time: u64,
226}
227#[allow(clippy::derive_partial_eq_without_eq)]
228#[derive(Clone, PartialEq, ::prost::Message)]
229pub struct RejectedDetails {
230    /// 거부 코드
231    #[prost(string, tag="1")]
232    pub rejection_code: ::prost::alloc::string::String,
233    /// 에러 메시지
234    #[prost(string, tag="2")]
235    pub error_message: ::prost::alloc::string::String,
236}
237#[allow(clippy::derive_partial_eq_without_eq)]
238#[derive(Clone, PartialEq, ::prost::Message)]
239pub struct FilledDetails {
240    /// 체결 가격
241    #[prost(string, tag="1")]
242    pub filled_price: ::prost::alloc::string::String,
243    /// 체결 수량
244    #[prost(int64, tag="2")]
245    pub filled_quantity: i64,
246    /// 체결 시간 (nanoseconds since epoch)
247    #[prost(uint64, tag="3")]
248    pub trade_time: u64,
249}
250#[allow(clippy::derive_partial_eq_without_eq)]
251#[derive(Clone, PartialEq, ::prost::Message)]
252pub struct CancelledDetails {
253    /// 취소 코드
254    #[prost(string, tag="1")]
255    pub cancellation_code: ::prost::alloc::string::String,
256    /// 취소 수량
257    #[prost(int64, tag="2")]
258    pub cancelled_quantity: i64,
259}
260/// 주문 목록 조회 요청
261#[allow(clippy::derive_partial_eq_without_eq)]
262#[derive(Clone, PartialEq, ::prost::Message)]
263pub struct ListOrdersRequest {
264    /// 필터링 조건 (선택적, AIP-160)
265    #[prost(string, tag="1")]
266    pub filter: ::prost::alloc::string::String,
267    /// 페이징 (AIP-158)
268    #[prost(int32, tag="2")]
269    pub page_size: i32,
270    #[prost(string, tag="3")]
271    pub page_token: ::prost::alloc::string::String,
272}
273/// 주문 목록 조회 응답
274#[allow(clippy::derive_partial_eq_without_eq)]
275#[derive(Clone, PartialEq, ::prost::Message)]
276pub struct ListOrdersResponse {
277    /// 주문 목록
278    #[prost(message, repeated, tag="1")]
279    pub orders: ::prost::alloc::vec::Vec<Order>,
280    /// 다음 페이지 토큰 (AIP-158)
281    #[prost(string, tag="2")]
282    pub next_page_token: ::prost::alloc::string::String,
283}
284/// 주문 정보
285#[allow(clippy::derive_partial_eq_without_eq)]
286#[derive(Clone, PartialEq, ::prost::Message)]
287pub struct Order {
288    /// 주문 ID
289    #[prost(string, tag="1")]
290    pub order_id: ::prost::alloc::string::String,
291    /// 주문 타입
292    #[prost(enumeration="super::common::OrderSide", tag="2")]
293    pub order_side: i32,
294    /// 상품 (예: etfs/A069500)
295    #[prost(string, tag="3")]
296    pub symbol: ::prost::alloc::string::String,
297    /// 주문 가격
298    #[prost(string, tag="4")]
299    pub price: ::prost::alloc::string::String,
300    /// 주문 수량
301    #[prost(int64, tag="5")]
302    pub quantity: i64,
303    /// 체결 수량
304    #[prost(int64, tag="6")]
305    pub filled_quantity: i64,
306    /// 주문 상태
307    #[prost(enumeration="OrderStatus", tag="7")]
308    pub status: i32,
309    /// 주문 시간 (Unix timestamp)
310    #[prost(int64, tag="8")]
311    pub created_at: i64,
312    /// 업데이트 시간 (Unix timestamp)
313    #[prost(int64, tag="9")]
314    pub updated_at: i64,
315    /// 펀드 코드
316    #[prost(string, tag="10")]
317    pub fund_code: ::prost::alloc::string::String,
318}
319// ========== Enums ==========
320
321#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
322#[repr(i32)]
323pub enum QuoteType {
324    Unspecified = 0,
325    /// 지정가
326    Limit = 1,
327    /// 시장가
328    Market = 2,
329    /// 상대호가
330    BestTake = 3,
331    /// 자기호가
332    BestMake = 4,
333}
334impl QuoteType {
335    /// String value of the enum field names used in the ProtoBuf definition.
336    ///
337    /// The values are not transformed in any way and thus are considered stable
338    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
339    pub fn as_str_name(&self) -> &'static str {
340        match self {
341            QuoteType::Unspecified => "QUOTE_TYPE_UNSPECIFIED",
342            QuoteType::Limit => "QUOTE_TYPE_LIMIT",
343            QuoteType::Market => "QUOTE_TYPE_MARKET",
344            QuoteType::BestTake => "QUOTE_TYPE_BEST_TAKE",
345            QuoteType::BestMake => "QUOTE_TYPE_BEST_MAKE",
346        }
347    }
348    /// Creates an enum from field names used in the ProtoBuf definition.
349    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
350        match value {
351            "QUOTE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
352            "QUOTE_TYPE_LIMIT" => Some(Self::Limit),
353            "QUOTE_TYPE_MARKET" => Some(Self::Market),
354            "QUOTE_TYPE_BEST_TAKE" => Some(Self::BestTake),
355            "QUOTE_TYPE_BEST_MAKE" => Some(Self::BestMake),
356            _ => None,
357        }
358    }
359}
360/// 지정가 가격 결정 방식
361#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
362#[repr(i32)]
363pub enum LimitPriceType {
364    /// 직접 지정한 가격 사용 (price 필드 사용)
365    Unspecified = 0,
366    /// 상대호가 (매수→매도1호가, 매도→매수1호가)
367    BestTake = 1,
368    /// 상대호가 +1틱 (더 공격적: 매수는 가격↑, 매도는 가격↓)
369    BestTakePlus1 = 2,
370    /// 상대호가 +2틱 (더 공격적)
371    BestTakePlus2 = 3,
372    /// 상대호가 +3틱 (더 공격적)
373    BestTakePlus3 = 4,
374    /// 자기호가 -1틱 (덜 공격적: 매수는 가격↓, 매도는 가격↑)
375    BestMakeMinus1 = 5,
376    /// 자기호가 -2틱 (덜 공격적)
377    BestMakeMinus2 = 6,
378    /// 자기호가 -3틱 (덜 공격적)
379    BestMakeMinus3 = 7,
380}
381impl LimitPriceType {
382    /// String value of the enum field names used in the ProtoBuf definition.
383    ///
384    /// The values are not transformed in any way and thus are considered stable
385    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
386    pub fn as_str_name(&self) -> &'static str {
387        match self {
388            LimitPriceType::Unspecified => "LIMIT_PRICE_TYPE_UNSPECIFIED",
389            LimitPriceType::BestTake => "LIMIT_PRICE_TYPE_BEST_TAKE",
390            LimitPriceType::BestTakePlus1 => "LIMIT_PRICE_TYPE_BEST_TAKE_PLUS_1",
391            LimitPriceType::BestTakePlus2 => "LIMIT_PRICE_TYPE_BEST_TAKE_PLUS_2",
392            LimitPriceType::BestTakePlus3 => "LIMIT_PRICE_TYPE_BEST_TAKE_PLUS_3",
393            LimitPriceType::BestMakeMinus1 => "LIMIT_PRICE_TYPE_BEST_MAKE_MINUS_1",
394            LimitPriceType::BestMakeMinus2 => "LIMIT_PRICE_TYPE_BEST_MAKE_MINUS_2",
395            LimitPriceType::BestMakeMinus3 => "LIMIT_PRICE_TYPE_BEST_MAKE_MINUS_3",
396        }
397    }
398    /// Creates an enum from field names used in the ProtoBuf definition.
399    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
400        match value {
401            "LIMIT_PRICE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
402            "LIMIT_PRICE_TYPE_BEST_TAKE" => Some(Self::BestTake),
403            "LIMIT_PRICE_TYPE_BEST_TAKE_PLUS_1" => Some(Self::BestTakePlus1),
404            "LIMIT_PRICE_TYPE_BEST_TAKE_PLUS_2" => Some(Self::BestTakePlus2),
405            "LIMIT_PRICE_TYPE_BEST_TAKE_PLUS_3" => Some(Self::BestTakePlus3),
406            "LIMIT_PRICE_TYPE_BEST_MAKE_MINUS_1" => Some(Self::BestMakeMinus1),
407            "LIMIT_PRICE_TYPE_BEST_MAKE_MINUS_2" => Some(Self::BestMakeMinus2),
408            "LIMIT_PRICE_TYPE_BEST_MAKE_MINUS_3" => Some(Self::BestMakeMinus3),
409            _ => None,
410        }
411    }
412}
413/// 퀵주문(SubmitOrder 직접 제출) 출처. 해당 전략의 체결통계 귀속에 쓴다.
414#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
415#[repr(i32)]
416pub enum QuickOrderOrigin {
417    /// 일반 퀵주문 (출처 미지정)
418    Unspecified = 0,
419    /// MM 퀵주문 화면 — 체결이 MM 서비스 체결통계에 반영됨
420    Mm = 1,
421}
422impl QuickOrderOrigin {
423    /// String value of the enum field names used in the ProtoBuf definition.
424    ///
425    /// The values are not transformed in any way and thus are considered stable
426    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
427    pub fn as_str_name(&self) -> &'static str {
428        match self {
429            QuickOrderOrigin::Unspecified => "QUICK_ORDER_ORIGIN_UNSPECIFIED",
430            QuickOrderOrigin::Mm => "QUICK_ORDER_ORIGIN_MM",
431        }
432    }
433    /// Creates an enum from field names used in the ProtoBuf definition.
434    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
435        match value {
436            "QUICK_ORDER_ORIGIN_UNSPECIFIED" => Some(Self::Unspecified),
437            "QUICK_ORDER_ORIGIN_MM" => Some(Self::Mm),
438            _ => None,
439        }
440    }
441}
442#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
443#[repr(i32)]
444pub enum OrderStatus {
445    Unspecified = 0,
446    /// 주문 제출됨
447    Submitted = 1,
448    /// 거부됨 (validation 실패)
449    Rejected = 2,
450}
451impl OrderStatus {
452    /// String value of the enum field names used in the ProtoBuf definition.
453    ///
454    /// The values are not transformed in any way and thus are considered stable
455    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
456    pub fn as_str_name(&self) -> &'static str {
457        match self {
458            OrderStatus::Unspecified => "ORDER_STATUS_UNSPECIFIED",
459            OrderStatus::Submitted => "ORDER_STATUS_SUBMITTED",
460            OrderStatus::Rejected => "ORDER_STATUS_REJECTED",
461        }
462    }
463    /// Creates an enum from field names used in the ProtoBuf definition.
464    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
465        match value {
466            "ORDER_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
467            "ORDER_STATUS_SUBMITTED" => Some(Self::Submitted),
468            "ORDER_STATUS_REJECTED" => Some(Self::Rejected),
469            _ => None,
470        }
471    }
472}
473#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
474#[repr(i32)]
475pub enum OrderResultType {
476    Unspecified = 0,
477    /// 접수됨
478    Received = 1,
479    /// 거부됨
480    Rejected = 2,
481    /// 체결됨
482    Filled = 3,
483    /// 취소됨
484    Cancelled = 4,
485}
486impl OrderResultType {
487    /// String value of the enum field names used in the ProtoBuf definition.
488    ///
489    /// The values are not transformed in any way and thus are considered stable
490    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
491    pub fn as_str_name(&self) -> &'static str {
492        match self {
493            OrderResultType::Unspecified => "ORDER_RESULT_TYPE_UNSPECIFIED",
494            OrderResultType::Received => "ORDER_RESULT_TYPE_RECEIVED",
495            OrderResultType::Rejected => "ORDER_RESULT_TYPE_REJECTED",
496            OrderResultType::Filled => "ORDER_RESULT_TYPE_FILLED",
497            OrderResultType::Cancelled => "ORDER_RESULT_TYPE_CANCELLED",
498        }
499    }
500    /// Creates an enum from field names used in the ProtoBuf definition.
501    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
502        match value {
503            "ORDER_RESULT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
504            "ORDER_RESULT_TYPE_RECEIVED" => Some(Self::Received),
505            "ORDER_RESULT_TYPE_REJECTED" => Some(Self::Rejected),
506            "ORDER_RESULT_TYPE_FILLED" => Some(Self::Filled),
507            "ORDER_RESULT_TYPE_CANCELLED" => Some(Self::Cancelled),
508            _ => None,
509        }
510    }
511}
512include!("kdo.v1.order.tonic.rs");
513include!("kdo.v1.order.serde.rs");
514// @@protoc_insertion_point(module)