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    /// 국내 마스터·시세가 없는 해외 보유분 (미국채/미국ETF/해외주식 등, 평가금액만 고정 반영)
142    Foreign = 5,
143}
144impl ProductType {
145    /// String value of the enum field names used in the ProtoBuf definition.
146    ///
147    /// The values are not transformed in any way and thus are considered stable
148    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
149    pub fn as_str_name(&self) -> &'static str {
150        match self {
151            ProductType::Unspecified => "PRODUCT_TYPE_UNSPECIFIED",
152            ProductType::Stock => "PRODUCT_TYPE_STOCK",
153            ProductType::Futures => "PRODUCT_TYPE_FUTURES",
154            ProductType::Etf => "PRODUCT_TYPE_ETF",
155            ProductType::Cash => "PRODUCT_TYPE_CASH",
156            ProductType::Foreign => "PRODUCT_TYPE_FOREIGN",
157        }
158    }
159    /// Creates an enum from field names used in the ProtoBuf definition.
160    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
161        match value {
162            "PRODUCT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
163            "PRODUCT_TYPE_STOCK" => Some(Self::Stock),
164            "PRODUCT_TYPE_FUTURES" => Some(Self::Futures),
165            "PRODUCT_TYPE_ETF" => Some(Self::Etf),
166            "PRODUCT_TYPE_CASH" => Some(Self::Cash),
167            "PRODUCT_TYPE_FOREIGN" => Some(Self::Foreign),
168            _ => None,
169        }
170    }
171}
172/// KRX 세부 세션 ID (16-state)
173#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
174#[repr(i32)]
175pub enum SessionId {
176    Unspecified = 0,
177    /// 장개시전
178    Previous = 1,
179    /// 연결됨
180    Connected = 2,
181    /// 시가단일가
182    OpeningOnePrice = 3,
183    /// 단일가
184    OnePrice = 4,
185    /// 종가단일가
186    ClosingOnePrice = 5,
187    /// VI장중단일가
188    ViOnePrice = 6,
189    /// VI시가단일가
190    ViOpeningOnePrice = 7,
191    /// VI종가단일가
192    ViClosingOnePrice = 8,
193    /// 단위매매
194    UnitTrade = 9,
195    /// 장종료후호가접수
196    PostMarket = 10,
197    /// 경매매수호가 접수 세션
198    AuctionBid = 11,
199    /// 경매매도호가 접수 세션
200    AuctionAsk = 12,
201    /// 거래정지
202    Suspended = 13,
203    /// 셧다운
204    Shutdown = 14,
205    /// 장마감
206    Closed = 15,
207    /// 기타
208    Etc = 16,
209}
210impl SessionId {
211    /// String value of the enum field names used in the ProtoBuf definition.
212    ///
213    /// The values are not transformed in any way and thus are considered stable
214    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
215    pub fn as_str_name(&self) -> &'static str {
216        match self {
217            SessionId::Unspecified => "SESSION_ID_UNSPECIFIED",
218            SessionId::Previous => "PREVIOUS",
219            SessionId::Connected => "CONNECTED",
220            SessionId::OpeningOnePrice => "OPENING_ONE_PRICE",
221            SessionId::OnePrice => "ONE_PRICE",
222            SessionId::ClosingOnePrice => "CLOSING_ONE_PRICE",
223            SessionId::ViOnePrice => "VI_ONE_PRICE",
224            SessionId::ViOpeningOnePrice => "VI_OPENING_ONE_PRICE",
225            SessionId::ViClosingOnePrice => "VI_CLOSING_ONE_PRICE",
226            SessionId::UnitTrade => "UNIT_TRADE",
227            SessionId::PostMarket => "POST_MARKET",
228            SessionId::AuctionBid => "AUCTION_BID",
229            SessionId::AuctionAsk => "AUCTION_ASK",
230            SessionId::Suspended => "SUSPENDED",
231            SessionId::Shutdown => "SHUTDOWN",
232            SessionId::Closed => "CLOSED",
233            SessionId::Etc => "ETC",
234        }
235    }
236    /// Creates an enum from field names used in the ProtoBuf definition.
237    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
238        match value {
239            "SESSION_ID_UNSPECIFIED" => Some(Self::Unspecified),
240            "PREVIOUS" => Some(Self::Previous),
241            "CONNECTED" => Some(Self::Connected),
242            "OPENING_ONE_PRICE" => Some(Self::OpeningOnePrice),
243            "ONE_PRICE" => Some(Self::OnePrice),
244            "CLOSING_ONE_PRICE" => Some(Self::ClosingOnePrice),
245            "VI_ONE_PRICE" => Some(Self::ViOnePrice),
246            "VI_OPENING_ONE_PRICE" => Some(Self::ViOpeningOnePrice),
247            "VI_CLOSING_ONE_PRICE" => Some(Self::ViClosingOnePrice),
248            "UNIT_TRADE" => Some(Self::UnitTrade),
249            "POST_MARKET" => Some(Self::PostMarket),
250            "AUCTION_BID" => Some(Self::AuctionBid),
251            "AUCTION_ASK" => Some(Self::AuctionAsk),
252            "SUSPENDED" => Some(Self::Suspended),
253            "SHUTDOWN" => Some(Self::Shutdown),
254            "CLOSED" => Some(Self::Closed),
255            "ETC" => Some(Self::Etc),
256            _ => None,
257        }
258    }
259}
260/// 호가조건코드 (KRX)
261/// 주문 체결 방식을 지정하는 조건
262#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
263#[repr(i32)]
264pub enum OrderConditionType {
265    /// 미지정 (기본값: FAS로 처리, 하위 호환)
266    Unspecified = 0,
267    /// Fill-and-Store: 체결 후 잔량은 호가창에 유지 (일반 지정가) — KRX code "0"
268    Fas = 1,
269    /// Fill-and-Kill (IOC): 체결 후 잔량 즉시 취소 — KRX code "3"
270    Fak = 2,
271    /// Fill-or-Kill: 전량 체결 아니면 전량 취소 — KRX code "4"
272    Fok = 3,
273}
274impl OrderConditionType {
275    /// String value of the enum field names used in the ProtoBuf definition.
276    ///
277    /// The values are not transformed in any way and thus are considered stable
278    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
279    pub fn as_str_name(&self) -> &'static str {
280        match self {
281            OrderConditionType::Unspecified => "ORDER_CONDITION_TYPE_UNSPECIFIED",
282            OrderConditionType::Fas => "ORDER_CONDITION_TYPE_FAS",
283            OrderConditionType::Fak => "ORDER_CONDITION_TYPE_FAK",
284            OrderConditionType::Fok => "ORDER_CONDITION_TYPE_FOK",
285        }
286    }
287    /// Creates an enum from field names used in the ProtoBuf definition.
288    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
289        match value {
290            "ORDER_CONDITION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
291            "ORDER_CONDITION_TYPE_FAS" => Some(Self::Fas),
292            "ORDER_CONDITION_TYPE_FAK" => Some(Self::Fak),
293            "ORDER_CONDITION_TYPE_FOK" => Some(Self::Fok),
294            _ => None,
295        }
296    }
297}
298/// 참조 가격 소스 — entry(주문) 의 side 기준 자기/상대 호가. 절대 위치(Bid1/Ask1/MidPrice 등)를
299/// 나타내는 kdo.v1.basket.PriceSource 와 달리 side 에 상대적이므로 혼동 방지를 위해 이름을
300/// RelativePriceSource 로 구분한다. kdo.v1.pair.PriceSource 와 동일한 의미.
301#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
302#[repr(i32)]
303pub enum RelativePriceSource {
304    Unspecified = 0,
305    /// 자기호가 (entry.side 와 같은 방향의 1호가). Bid 주문 → bid1, Ask 주문 → ask1.
306    BestMake = 1,
307    /// 상대호가 (entry.side 반대 방향의 1호가). Bid 주문 → ask1, Ask 주문 → bid1.
308    BestTake = 2,
309}
310impl RelativePriceSource {
311    /// String value of the enum field names used in the ProtoBuf definition.
312    ///
313    /// The values are not transformed in any way and thus are considered stable
314    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
315    pub fn as_str_name(&self) -> &'static str {
316        match self {
317            RelativePriceSource::Unspecified => "RELATIVE_PRICE_SOURCE_UNSPECIFIED",
318            RelativePriceSource::BestMake => "RELATIVE_PRICE_SOURCE_BEST_MAKE",
319            RelativePriceSource::BestTake => "RELATIVE_PRICE_SOURCE_BEST_TAKE",
320        }
321    }
322    /// Creates an enum from field names used in the ProtoBuf definition.
323    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
324        match value {
325            "RELATIVE_PRICE_SOURCE_UNSPECIFIED" => Some(Self::Unspecified),
326            "RELATIVE_PRICE_SOURCE_BEST_MAKE" => Some(Self::BestMake),
327            "RELATIVE_PRICE_SOURCE_BEST_TAKE" => Some(Self::BestTake),
328            _ => None,
329        }
330    }
331}
332/// ETF NAV 계산 공식 종류. kdo.v1.pair.EtfNavKind 와 동일한 의미(패키지 간 결합을 피하기 위해
333/// 별도 정의).
334#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
335#[repr(i32)]
336pub enum EtfNavKind {
337    Unspecified = 0,
338    /// 지수 추종 헷지 프라이싱
339    IndexTrackingHedge = 1,
340    /// 선물 베이시스 기반
341    FutureBasis = 2,
342    /// 레버리지/인버스 ETF용 선물 기반
343    LeverageFuture = 3,
344    /// PDF 구성종목 기반 헷지 프라이싱 (단일 선물 구성종목 전제, flatten 필수)
345    PdfDecomposeHedge = 4,
346}
347impl EtfNavKind {
348    /// String value of the enum field names used in the ProtoBuf definition.
349    ///
350    /// The values are not transformed in any way and thus are considered stable
351    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
352    pub fn as_str_name(&self) -> &'static str {
353        match self {
354            EtfNavKind::Unspecified => "ETF_NAV_KIND_UNSPECIFIED",
355            EtfNavKind::IndexTrackingHedge => "ETF_NAV_KIND_INDEX_TRACKING_HEDGE",
356            EtfNavKind::FutureBasis => "ETF_NAV_KIND_FUTURE_BASIS",
357            EtfNavKind::LeverageFuture => "ETF_NAV_KIND_LEVERAGE_FUTURE",
358            EtfNavKind::PdfDecomposeHedge => "ETF_NAV_KIND_PDF_DECOMPOSE_HEDGE",
359        }
360    }
361    /// Creates an enum from field names used in the ProtoBuf definition.
362    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
363        match value {
364            "ETF_NAV_KIND_UNSPECIFIED" => Some(Self::Unspecified),
365            "ETF_NAV_KIND_INDEX_TRACKING_HEDGE" => Some(Self::IndexTrackingHedge),
366            "ETF_NAV_KIND_FUTURE_BASIS" => Some(Self::FutureBasis),
367            "ETF_NAV_KIND_LEVERAGE_FUTURE" => Some(Self::LeverageFuture),
368            "ETF_NAV_KIND_PDF_DECOMPOSE_HEDGE" => Some(Self::PdfDecomposeHedge),
369            _ => None,
370        }
371    }
372}
373/// 자동정정 전략 유형
374#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
375#[repr(i32)]
376pub enum AmendMethodType {
377    /// 미지정 (기본값: SELF_QUOTE로 처리)
378    Unspecified = 0,
379    /// 셀프쿼팅 정정: 반대편 잔량 비율이 임계값 이상이면 즉시 체결 시도
380    SelfQuote = 1,
381    /// 손절 정정: tick_threshold 이상 불리해지면 시장가로 전환
382    StopLoss = 4,
383}
384impl AmendMethodType {
385    /// String value of the enum field names used in the ProtoBuf definition.
386    ///
387    /// The values are not transformed in any way and thus are considered stable
388    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
389    pub fn as_str_name(&self) -> &'static str {
390        match self {
391            AmendMethodType::Unspecified => "AMEND_METHOD_TYPE_UNSPECIFIED",
392            AmendMethodType::SelfQuote => "AMEND_METHOD_TYPE_SELF_QUOTE",
393            AmendMethodType::StopLoss => "AMEND_METHOD_TYPE_STOP_LOSS",
394        }
395    }
396    /// Creates an enum from field names used in the ProtoBuf definition.
397    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
398        match value {
399            "AMEND_METHOD_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
400            "AMEND_METHOD_TYPE_SELF_QUOTE" => Some(Self::SelfQuote),
401            "AMEND_METHOD_TYPE_STOP_LOSS" => Some(Self::StopLoss),
402            _ => None,
403        }
404    }
405}
406include!("kdo.v1.common.serde.rs");
407// @@protoc_insertion_point(module)