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