Skip to main content

ids_apis/
kdo.v1.common.rs

1// @generated
2// This file is @generated by prost-build.
3/// ETF 가격 산출 방식
4#[allow(clippy::derive_partial_eq_without_eq)]
5#[derive(Clone, PartialEq, ::prost::Message)]
6pub struct EtfPricing {
7    #[prost(oneof="etf_pricing::Method", tags="1, 2, 3, 4, 5")]
8    pub method: ::core::option::Option<etf_pricing::Method>,
9}
10/// Nested message and enum types in `EtfPricing`.
11pub mod etf_pricing {
12    #[allow(clippy::derive_partial_eq_without_eq)]
13#[derive(Clone, PartialEq, ::prost::Oneof)]
14    pub enum Method {
15        /// 분해 헷지 방식
16        #[prost(message, tag="1")]
17        PdfNavHedge(super::PdfNavHedgePricing),
18        /// 선물 헷지 방식
19        #[prost(message, tag="2")]
20        IndexTrackingHedge(super::IndexTrackingHedgePricing),
21        #[prost(message, tag="3")]
22        FutureBasis(super::FutureBasis),
23        /// 레버리지 선물 방식
24        #[prost(message, tag="4")]
25        LeverageFuture(super::LeverageFuturePricing),
26        /// PDF 재귀 분해 헷지 방식: leaf가 단일 종목으로 귀결되는 ETF에 대한 프라이싱
27        #[prost(message, tag="5")]
28        PdfDecomposeHedge(super::PdfDecomposeHedgePricing),
29    }
30}
31/// 분해 헷지 가격 산출 (추가 파라미터 없음)
32#[allow(clippy::derive_partial_eq_without_eq)]
33#[derive(Clone, Copy, PartialEq, ::prost::Message)]
34pub struct PdfNavHedgePricing {
35}
36/// 선물 헷지 가격 산출
37#[allow(clippy::derive_partial_eq_without_eq)]
38#[derive(Clone, Copy, PartialEq, ::prost::Message)]
39pub struct IndexTrackingHedgePricing {
40}
41#[allow(clippy::derive_partial_eq_without_eq)]
42#[derive(Clone, PartialEq, ::prost::Message)]
43pub struct FutureBasis {
44    #[prost(string, tag="1")]
45    pub prev_index: ::prost::alloc::string::String,
46}
47/// 레버리지 선물 가격 산출
48#[allow(clippy::derive_partial_eq_without_eq)]
49#[derive(Clone, Copy, PartialEq, ::prost::Message)]
50pub struct LeverageFuturePricing {
51    /// 기초지수 전일종가
52    #[prost(double, tag="1")]
53    pub prev_index: f64,
54    /// 선물 전일종가
55    #[prost(double, tag="2")]
56    pub prev_future: f64,
57}
58/// PDF 재귀 분해 헷지 가격 산출 (파라미터 없음)
59/// NAV 계산은 Etf.decomposed_constituents를 PdfNavHedge와 동일 공식으로 적용.
60#[allow(clippy::derive_partial_eq_without_eq)]
61#[derive(Clone, Copy, PartialEq, ::prost::Message)]
62pub struct PdfDecomposeHedgePricing {
63}
64/// 주문 방향
65#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
66#[repr(i32)]
67pub enum OrderSide {
68    Unspecified = 0,
69    /// 매수
70    Bid = 1,
71    /// 매도
72    Ask = 2,
73}
74impl OrderSide {
75    /// String value of the enum field names used in the ProtoBuf definition.
76    ///
77    /// The values are not transformed in any way and thus are considered stable
78    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
79    pub fn as_str_name(&self) -> &'static str {
80        match self {
81            OrderSide::Unspecified => "ORDER_SIDE_UNSPECIFIED",
82            OrderSide::Bid => "ORDER_SIDE_BID",
83            OrderSide::Ask => "ORDER_SIDE_ASK",
84        }
85    }
86    /// Creates an enum from field names used in the ProtoBuf definition.
87    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
88        match value {
89            "ORDER_SIDE_UNSPECIFIED" => Some(Self::Unspecified),
90            "ORDER_SIDE_BID" => Some(Self::Bid),
91            "ORDER_SIDE_ASK" => Some(Self::Ask),
92            _ => None,
93        }
94    }
95}
96/// 시장 유형
97#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
98#[repr(i32)]
99pub enum MarketType {
100    Unspecified = 0,
101    /// KOSPI
102    Kospi = 1,
103    /// KOSDAQ
104    Kosdaq = 2,
105    /// 파생상품
106    Derivative = 3,
107}
108impl MarketType {
109    /// String value of the enum field names used in the ProtoBuf definition.
110    ///
111    /// The values are not transformed in any way and thus are considered stable
112    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
113    pub fn as_str_name(&self) -> &'static str {
114        match self {
115            MarketType::Unspecified => "MARKET_TYPE_UNSPECIFIED",
116            MarketType::Kospi => "MARKET_TYPE_KOSPI",
117            MarketType::Kosdaq => "MARKET_TYPE_KOSDAQ",
118            MarketType::Derivative => "MARKET_TYPE_DERIVATIVE",
119        }
120    }
121    /// Creates an enum from field names used in the ProtoBuf definition.
122    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
123        match value {
124            "MARKET_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
125            "MARKET_TYPE_KOSPI" => Some(Self::Kospi),
126            "MARKET_TYPE_KOSDAQ" => Some(Self::Kosdaq),
127            "MARKET_TYPE_DERIVATIVE" => Some(Self::Derivative),
128            _ => None,
129        }
130    }
131}
132/// 상품 타입
133#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
134#[repr(i32)]
135pub enum ProductType {
136    Unspecified = 0,
137    Stock = 1,
138    Futures = 2,
139    Etf = 3,
140    Cash = 4,
141}
142impl ProductType {
143    /// String value of the enum field names used in the ProtoBuf definition.
144    ///
145    /// The values are not transformed in any way and thus are considered stable
146    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
147    pub fn as_str_name(&self) -> &'static str {
148        match self {
149            ProductType::Unspecified => "PRODUCT_TYPE_UNSPECIFIED",
150            ProductType::Stock => "PRODUCT_TYPE_STOCK",
151            ProductType::Futures => "PRODUCT_TYPE_FUTURES",
152            ProductType::Etf => "PRODUCT_TYPE_ETF",
153            ProductType::Cash => "PRODUCT_TYPE_CASH",
154        }
155    }
156    /// Creates an enum from field names used in the ProtoBuf definition.
157    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
158        match value {
159            "PRODUCT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
160            "PRODUCT_TYPE_STOCK" => Some(Self::Stock),
161            "PRODUCT_TYPE_FUTURES" => Some(Self::Futures),
162            "PRODUCT_TYPE_ETF" => Some(Self::Etf),
163            "PRODUCT_TYPE_CASH" => Some(Self::Cash),
164            _ => None,
165        }
166    }
167}
168/// KRX 세부 세션 ID (16-state)
169#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
170#[repr(i32)]
171pub enum SessionId {
172    Unspecified = 0,
173    /// 장개시전
174    Previous = 1,
175    /// 연결됨
176    Connected = 2,
177    /// 시가단일가
178    OpeningOnePrice = 3,
179    /// 단일가
180    OnePrice = 4,
181    /// 종가단일가
182    ClosingOnePrice = 5,
183    /// VI장중단일가
184    ViOnePrice = 6,
185    /// VI시가단일가
186    ViOpeningOnePrice = 7,
187    /// VI종가단일가
188    ViClosingOnePrice = 8,
189    /// 단위매매
190    UnitTrade = 9,
191    /// 장종료후호가접수
192    PostMarket = 10,
193    /// 경매매수호가 접수 세션
194    AuctionBid = 11,
195    /// 경매매도호가 접수 세션
196    AuctionAsk = 12,
197    /// 거래정지
198    Suspended = 13,
199    /// 셧다운
200    Shutdown = 14,
201    /// 장마감
202    Closed = 15,
203    /// 기타
204    Etc = 16,
205}
206impl SessionId {
207    /// String value of the enum field names used in the ProtoBuf definition.
208    ///
209    /// The values are not transformed in any way and thus are considered stable
210    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
211    pub fn as_str_name(&self) -> &'static str {
212        match self {
213            SessionId::Unspecified => "SESSION_ID_UNSPECIFIED",
214            SessionId::Previous => "PREVIOUS",
215            SessionId::Connected => "CONNECTED",
216            SessionId::OpeningOnePrice => "OPENING_ONE_PRICE",
217            SessionId::OnePrice => "ONE_PRICE",
218            SessionId::ClosingOnePrice => "CLOSING_ONE_PRICE",
219            SessionId::ViOnePrice => "VI_ONE_PRICE",
220            SessionId::ViOpeningOnePrice => "VI_OPENING_ONE_PRICE",
221            SessionId::ViClosingOnePrice => "VI_CLOSING_ONE_PRICE",
222            SessionId::UnitTrade => "UNIT_TRADE",
223            SessionId::PostMarket => "POST_MARKET",
224            SessionId::AuctionBid => "AUCTION_BID",
225            SessionId::AuctionAsk => "AUCTION_ASK",
226            SessionId::Suspended => "SUSPENDED",
227            SessionId::Shutdown => "SHUTDOWN",
228            SessionId::Closed => "CLOSED",
229            SessionId::Etc => "ETC",
230        }
231    }
232    /// Creates an enum from field names used in the ProtoBuf definition.
233    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
234        match value {
235            "SESSION_ID_UNSPECIFIED" => Some(Self::Unspecified),
236            "PREVIOUS" => Some(Self::Previous),
237            "CONNECTED" => Some(Self::Connected),
238            "OPENING_ONE_PRICE" => Some(Self::OpeningOnePrice),
239            "ONE_PRICE" => Some(Self::OnePrice),
240            "CLOSING_ONE_PRICE" => Some(Self::ClosingOnePrice),
241            "VI_ONE_PRICE" => Some(Self::ViOnePrice),
242            "VI_OPENING_ONE_PRICE" => Some(Self::ViOpeningOnePrice),
243            "VI_CLOSING_ONE_PRICE" => Some(Self::ViClosingOnePrice),
244            "UNIT_TRADE" => Some(Self::UnitTrade),
245            "POST_MARKET" => Some(Self::PostMarket),
246            "AUCTION_BID" => Some(Self::AuctionBid),
247            "AUCTION_ASK" => Some(Self::AuctionAsk),
248            "SUSPENDED" => Some(Self::Suspended),
249            "SHUTDOWN" => Some(Self::Shutdown),
250            "CLOSED" => Some(Self::Closed),
251            "ETC" => Some(Self::Etc),
252            _ => None,
253        }
254    }
255}
256/// 호가조건코드 (KRX)
257/// 주문 체결 방식을 지정하는 조건
258#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
259#[repr(i32)]
260pub enum OrderConditionType {
261    /// 미지정 (기본값: FAS로 처리, 하위 호환)
262    Unspecified = 0,
263    /// Fill-and-Store: 체결 후 잔량은 호가창에 유지 (일반 지정가) — KRX code "0"
264    Fas = 1,
265    /// Fill-and-Kill (IOC): 체결 후 잔량 즉시 취소 — KRX code "3"
266    Fak = 2,
267    /// Fill-or-Kill: 전량 체결 아니면 전량 취소 — KRX code "4"
268    Fok = 3,
269}
270impl OrderConditionType {
271    /// String value of the enum field names used in the ProtoBuf definition.
272    ///
273    /// The values are not transformed in any way and thus are considered stable
274    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
275    pub fn as_str_name(&self) -> &'static str {
276        match self {
277            OrderConditionType::Unspecified => "ORDER_CONDITION_TYPE_UNSPECIFIED",
278            OrderConditionType::Fas => "ORDER_CONDITION_TYPE_FAS",
279            OrderConditionType::Fak => "ORDER_CONDITION_TYPE_FAK",
280            OrderConditionType::Fok => "ORDER_CONDITION_TYPE_FOK",
281        }
282    }
283    /// Creates an enum from field names used in the ProtoBuf definition.
284    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
285        match value {
286            "ORDER_CONDITION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
287            "ORDER_CONDITION_TYPE_FAS" => Some(Self::Fas),
288            "ORDER_CONDITION_TYPE_FAK" => Some(Self::Fak),
289            "ORDER_CONDITION_TYPE_FOK" => Some(Self::Fok),
290            _ => None,
291        }
292    }
293}
294/// 자동정정 전략 유형
295#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
296#[repr(i32)]
297pub enum AmendMethodType {
298    /// 미지정 (기본값: TIMED_MARKET으로 처리)
299    Unspecified = 0,
300    /// 적극적 정정: 반대편 잔량 비율이 임계값 이상이면 즉시 체결 시도
301    Aggressive = 1,
302    /// 회피적 정정: tick_offset 만큼 가격을 조정하여 미체결 유지
303    Evasive = 2,
304    /// 최우선 호가: 상대방 최우선 호가로 정정
305    BestPrice = 3,
306    /// 손절 정정: tick_threshold 이상 불리해지면 시장가로 전환
307    StopLoss = 4,
308    /// 시간 제한 시장가: timeout 후 시장가로 전환
309    TimedMarket = 5,
310    /// 시간 기반 전진 정정 (100ms 간격): 상대호가 방향으로 1tick씩 전진
311    TickAdvance100ms = 6,
312    /// 시간 기반 전진 정정 (500ms 간격): 상대호가 방향으로 1tick씩 전진
313    TickAdvance500ms = 7,
314    /// 시간 기반 전진 정정 (1s 간격): 상대호가 방향으로 1tick씩 전진
315    TickAdvance1s = 8,
316    /// 스프레드 갭 추격 + 잔량 감소 추격
317    /// 1단계: 내 가격과 상대호가 사이 빈 tick 존재 시 상대호가 ±1tick으로 점프
318    /// 2단계: 스프레드 1tick 상태에서 상대 1호가 잔량이 임계 비율 미만 시 1tick 추격
319    SpreadFollow = 9,
320}
321impl AmendMethodType {
322    /// String value of the enum field names used in the ProtoBuf definition.
323    ///
324    /// The values are not transformed in any way and thus are considered stable
325    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
326    pub fn as_str_name(&self) -> &'static str {
327        match self {
328            AmendMethodType::Unspecified => "AMEND_METHOD_TYPE_UNSPECIFIED",
329            AmendMethodType::Aggressive => "AMEND_METHOD_TYPE_AGGRESSIVE",
330            AmendMethodType::Evasive => "AMEND_METHOD_TYPE_EVASIVE",
331            AmendMethodType::BestPrice => "AMEND_METHOD_TYPE_BEST_PRICE",
332            AmendMethodType::StopLoss => "AMEND_METHOD_TYPE_STOP_LOSS",
333            AmendMethodType::TimedMarket => "AMEND_METHOD_TYPE_TIMED_MARKET",
334            AmendMethodType::TickAdvance100ms => "AMEND_METHOD_TYPE_TICK_ADVANCE_100MS",
335            AmendMethodType::TickAdvance500ms => "AMEND_METHOD_TYPE_TICK_ADVANCE_500MS",
336            AmendMethodType::TickAdvance1s => "AMEND_METHOD_TYPE_TICK_ADVANCE_1S",
337            AmendMethodType::SpreadFollow => "AMEND_METHOD_TYPE_SPREAD_FOLLOW",
338        }
339    }
340    /// Creates an enum from field names used in the ProtoBuf definition.
341    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
342        match value {
343            "AMEND_METHOD_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
344            "AMEND_METHOD_TYPE_AGGRESSIVE" => Some(Self::Aggressive),
345            "AMEND_METHOD_TYPE_EVASIVE" => Some(Self::Evasive),
346            "AMEND_METHOD_TYPE_BEST_PRICE" => Some(Self::BestPrice),
347            "AMEND_METHOD_TYPE_STOP_LOSS" => Some(Self::StopLoss),
348            "AMEND_METHOD_TYPE_TIMED_MARKET" => Some(Self::TimedMarket),
349            "AMEND_METHOD_TYPE_TICK_ADVANCE_100MS" => Some(Self::TickAdvance100ms),
350            "AMEND_METHOD_TYPE_TICK_ADVANCE_500MS" => Some(Self::TickAdvance500ms),
351            "AMEND_METHOD_TYPE_TICK_ADVANCE_1S" => Some(Self::TickAdvance1s),
352            "AMEND_METHOD_TYPE_SPREAD_FOLLOW" => Some(Self::SpreadFollow),
353            _ => None,
354        }
355    }
356}
357include!("kdo.v1.common.serde.rs");
358// @@protoc_insertion_point(module)