ids-apis 1.0.441

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