ids-apis 1.0.367

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
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
// @generated
// This file is @generated by prost-build.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Etf {
    /// ETF ID
    #[prost(uint64, tag="1")]
    pub id: u64,
    /// ETF 심볼 (ISIN 코드)
    #[prost(string, tag="2")]
    pub symbol: ::prost::alloc::string::String,
    /// ETF 코드
    #[prost(string, tag="3")]
    pub code: ::prost::alloc::string::String,
    /// ETF 이름
    #[prost(string, tag="4")]
    pub name: ::prost::alloc::string::String,
    /// 마지막 가격
    #[prost(string, tag="5")]
    pub prev_close: ::prost::alloc::string::String,
    #[prost(string, tag="6")]
    pub prev_close_nav: ::prost::alloc::string::String,
    #[prost(string, tag="7")]
    pub last_price: ::prost::alloc::string::String,
    #[prost(string, tag="8")]
    pub last_ask_inav: ::prost::alloc::string::String,
    #[prost(string, tag="9")]
    pub last_bid_inav: ::prost::alloc::string::String,
    /// PDF 구성 종목 목록
    #[prost(map="string, message", tag="10")]
    pub constituents: ::std::collections::HashMap<::prost::alloc::string::String, EtfPdfConstituent>,
    /// 설정 단위
    #[prost(int64, tag="11")]
    pub creation_unit: i64,
    /// 복제 방법
    #[prost(enumeration="ReplicationMethod", tag="12")]
    pub replication_method: i32,
    /// Tick 크기 (원 단위, i64)
    #[prost(int64, tag="13")]
    pub tick_size: i64,
    /// Tick 크기 (원 단위, i64)
    #[prost(int64, tag="14")]
    pub listed_quantity: i64,
    #[prost(float, tag="15")]
    pub leverage: f32,
    #[prost(bool, tag="16")]
    pub tradable: bool,
    #[prost(bool, tag="17")]
    pub short_sellable: bool,
    /// 기초자산 정보
    #[prost(message, optional, tag="18")]
    pub tracking_asset: ::core::option::Option<UnderlyingAsset>,
    #[prost(bool, tag="23")]
    pub cash_creditable: bool,
    #[prost(int64, tag="24")]
    pub cash_creation_amount: i64,
    /// ETF 변환 정보 (예: 레버리지/인버스 ETF의 선물 변환)
    #[prost(map="string, message", tag="25")]
    pub conversions: ::std::collections::HashMap<::prost::alloc::string::String, Conversion>,
    /// unit_delta (구성종목 기반 NAV 계산용)
    #[prost(string, tag="26")]
    pub unit_delta: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EtfConstituent {
    #[prost(oneof="etf_constituent::ConstituentType", tags="1, 2, 3")]
    pub constituent_type: ::core::option::Option<etf_constituent::ConstituentType>,
}
/// Nested message and enum types in `EtfConstituent`.
pub mod etf_constituent {
    #[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum ConstituentType {
        #[prost(message, tag="1")]
        Stock(super::StockConstituent),
        #[prost(message, tag="2")]
        Futures(super::FuturesConstituent),
        #[prost(message, tag="3")]
        Cash(super::CashConstituent),
    }
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StockConstituent {
    #[prost(string, tag="1")]
    pub symbol: ::prost::alloc::string::String,
    #[prost(string, tag="2")]
    pub prev_close: ::prost::alloc::string::String,
    #[prost(string, tag="3")]
    pub last_price: ::prost::alloc::string::String,
    #[prost(int64, tag="4")]
    pub quantity: i64,
    #[prost(int64, tag="5")]
    pub last_valuation: i64,
    #[prost(int64, tag="6")]
    pub notional_amount: i64,
    #[prost(uint32, tag="7")]
    pub num_members: u32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FuturesConstituent {
    #[prost(string, tag="1")]
    pub symbol: ::prost::alloc::string::String,
    #[prost(string, tag="2")]
    pub prev_close: ::prost::alloc::string::String,
    #[prost(string, tag="3")]
    pub last_price: ::prost::alloc::string::String,
    #[prost(float, tag="4")]
    pub quantity: f32,
    #[prost(double, tag="5")]
    pub multiple: f64,
    #[prost(int64, tag="6")]
    pub last_valuation: i64,
    #[prost(int64, tag="7")]
    pub notional_amount: i64,
    #[prost(uint32, tag="8")]
    pub num_members: u32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CashConstituent {
    #[prost(string, tag="1")]
    pub symbol: ::prost::alloc::string::String,
    #[prost(int64, tag="2")]
    pub prev_valuation: i64,
    #[prost(uint32, tag="3")]
    pub num_members: u32,
}
/// PDF 구성 종목
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EtfPdfConstituent {
    /// 종목 코드
    ///
    /// symbol
    #[prost(string, tag="1")]
    pub symbol: ::prost::alloc::string::String,
    /// 종목명
    #[prost(string, tag="2")]
    pub name: ::prost::alloc::string::String,
    /// 상품 타입
    #[prost(enumeration="super::common::ProductType", tag="3")]
    pub product_type: i32,
    /// 구성 수량 (선물 숏의 경우 음수, 소수 지원). Cash의 경우 원화 금액(원 단위 정수).
    #[prost(string, tag="4")]
    pub quantity: ::prost::alloc::string::String,
}
/// ETF가 다른 상품으로 변환될 수 있는 정보
/// 예: KODEX 2X Inverse는 1cu당 -0.37개의 코스피200 선물로 변환 가능
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Conversion {
    /// 변환 대상 심볼
    #[prost(string, tag="1")]
    pub symbol: ::prost::alloc::string::String,
    /// 변환 대상 상품 타입
    #[prost(enumeration="super::common::ProductType", tag="2")]
    pub product_type: i32,
    /// 1 CU당 변환 비율
    /// 예: KODEX 2X Inverse → 코스피200 선물 = -0.37
    #[prost(double, tag="3")]
    pub ratio_per_cu: f64,
}
/// 기초자산
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UnderlyingAsset {
    #[prost(oneof="underlying_asset::Asset", tags="1, 2, 3, 4")]
    pub asset: ::core::option::Option<underlying_asset::Asset>,
}
/// Nested message and enum types in `UnderlyingAsset`.
pub mod underlying_asset {
    #[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Asset {
        /// 선물형
        #[prost(message, tag="1")]
        Future(super::UnderlyingFuture),
        /// 채권형
        #[prost(message, tag="2")]
        FixedIncome(super::UnderlyingFixedIncome),
        /// 원자재형
        #[prost(message, tag="3")]
        Commodity(super::UnderlyingCommodity),
        /// 통화형
        #[prost(message, tag="4")]
        Currency(super::UnderlyingCurrency),
    }
}
/// 선물형 기초자산
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UnderlyingFuture {
    /// 선물 종목 심볼
    #[prost(string, tag="1")]
    pub symbol: ::prost::alloc::string::String,
    /// 승수
    #[prost(string, tag="2")]
    pub multiple: ::prost::alloc::string::String,
    /// 최근 매도호가
    #[prost(string, tag="3")]
    pub last_ask_price: ::prost::alloc::string::String,
    /// 최근 매수호가
    #[prost(string, tag="4")]
    pub last_bid_price: ::prost::alloc::string::String,
}
/// 채권형 기초자산
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UnderlyingFixedIncome {
    /// 종목 심볼
    #[prost(string, tag="1")]
    pub symbol: ::prost::alloc::string::String,
}
/// 원자재형 기초자산
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UnderlyingCommodity {
    /// 종목 심볼
    #[prost(string, tag="1")]
    pub symbol: ::prost::alloc::string::String,
}
/// 통화형 기초자산
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UnderlyingCurrency {
    /// 종목 심볼
    #[prost(string, tag="1")]
    pub symbol: ::prost::alloc::string::String,
}
// ========== Request/Response Messages ==========

/// GetEtf
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetEtfRequest {
    #[prost(string, tag="1")]
    pub etf: ::prost::alloc::string::String,
}
/// ListEtfs
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListEtfsRequest {
    /// 페이지 크기 (optional)
    #[prost(uint32, optional, tag="1")]
    pub page_size: ::core::option::Option<u32>,
    /// 페이지 토큰 (optional, for pagination)
    #[prost(string, optional, tag="2")]
    pub page_token: ::core::option::Option<::prost::alloc::string::String>,
    /// 필터링 조건 (optional, AIP-160)
    #[prost(string, tag="3")]
    pub filter: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListEtfsResponse {
    /// ETF 목록
    #[prost(message, repeated, tag="1")]
    pub etfs: ::prost::alloc::vec::Vec<Etf>,
    /// 다음 페이지 토큰
    #[prost(string, tag="2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// GetEtfTickImpact
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetEtfTickImpactRequest {
    /// ETF 리소스 이름 (예: etfs/069500)
    #[prost(string, tag="1")]
    pub etf: ::prost::alloc::string::String,
    /// 구성종목 심볼
    #[prost(string, tag="2")]
    pub constituent_symbol: ::prost::alloc::string::String,
    /// 기준가 (이 가격을 중심으로 위아래 틱 계산)
    #[prost(string, tag="3")]
    pub base_price: ::prost::alloc::string::String,
    /// 위아래 계산할 틱 수 (예: 3이면 base_price 기준 -3틱 ~ +3틱)
    #[prost(int32, tag="4")]
    pub tick_range: i32,
}
/// ETF 틱 임팩트 응답
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EtfTickImpact {
    /// ETF 심볼
    #[prost(string, tag="1")]
    pub etf_symbol: ::prost::alloc::string::String,
    /// 구성종목 심볼
    #[prost(string, tag="2")]
    pub constituent_symbol: ::prost::alloc::string::String,
    /// 현재 ETF NAV
    #[prost(string, tag="3")]
    pub current_nav: ::prost::alloc::string::String,
    /// 구성종목 현재가
    #[prost(string, tag="4")]
    pub current_price: ::prost::alloc::string::String,
    /// 틱 변동별 NAV 시뮬레이션 결과 (-tick_range ~ +tick_range 순서)
    #[prost(message, repeated, tag="5")]
    pub points: ::prost::alloc::vec::Vec<TickNavPoint>,
}
/// 틱 변동에 따른 NAV 포인트
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TickNavPoint {
    /// 틱 오프셋 (예: -3, -2, -1, 0, +1, +2, +3)
    #[prost(int32, tag="1")]
    pub tick_offset: i32,
    /// 해당 틱에서의 구성종목 가격
    #[prost(string, tag="2")]
    pub price: ::prost::alloc::string::String,
    /// 해당 틱에서의 ETF NAV
    #[prost(string, tag="3")]
    pub nav: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateEtfUnitDeltaRequest {
    #[prost(string, tag="1")]
    pub etf: ::prost::alloc::string::String,
    #[prost(string, tag="2")]
    pub unit_delta: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateRedeemEtfRequest {
    #[prost(string, tag="1")]
    pub etf: ::prost::alloc::string::String,
    #[prost(string, tag="2")]
    pub fund: ::prost::alloc::string::String,
    #[prost(int64, tag="3")]
    pub quantity: i64,
    #[prost(bool, tag="4")]
    pub is_creation: bool,
}
/// CalcEtfUnitPrice
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CalcEtfUnitPriceRequest {
    #[prost(string, tag="1")]
    pub etf: ::prost::alloc::string::String,
    /// 가격 산출 방식 (IndexTrackingHedge / LeverageFuture 만 지원)
    #[prost(message, optional, tag="2")]
    pub pricing: ::core::option::Option<super::common::EtfPricing>,
    /// ETF 체결 방향 (Bid=매수 / Ask=매도)
    #[prost(enumeration="super::common::OrderSide", tag="3")]
    pub etf_side: i32,
    /// ETF 체결 수량
    #[prost(int64, tag="4")]
    pub etf_quantity: i64,
    /// ETF 체결 가격
    #[prost(string, tag="5")]
    pub etf_price: ::prost::alloc::string::String,
    /// 헷지(선물) 방향
    #[prost(enumeration="super::common::OrderSide", tag="6")]
    pub hedge_side: i32,
    /// 헷지(선물) 수량
    #[prost(int64, tag="7")]
    pub hedge_quantity: i64,
    /// 헷지(선물) 가격
    #[prost(string, tag="8")]
    pub hedge_price: ::prost::alloc::string::String,
    /// 타겟 단가 (optional, 제공 시 PnL 계산)
    #[prost(string, optional, tag="9")]
    pub target_unit_price: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CalcEtfUnitPriceResponse {
    /// 계산된 단가
    #[prost(string, tag="1")]
    pub unit_price: ::prost::alloc::string::String,
    /// (unit_price - target_unit_price) × etf_quantity, target 제공 시에만
    #[prost(string, optional, tag="2")]
    pub pnl: ::core::option::Option<::prost::alloc::string::String>,
}
/// GetEtfConstituents
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetEtfConstituentsRequest {
    /// ETF 리소스 이름 (예: etfs/069500)
    #[prost(string, tag="1")]
    pub etf: ::prost::alloc::string::String,
    /// 가격 산출 방식 (pricing 종류에 따라 flattened 여부가 결정됨)
    #[prost(message, optional, tag="2")]
    pub pricing: ::core::option::Option<super::common::EtfPricing>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetEtfConstituentsResponse {
    /// pricing에 따라 flattened 여부가 결정된 구성종목 맵
    /// PdfDecomposeHedge: leaf(Stock/Futures/Cash)로 재귀 분해된 flattened 버전
    /// 그 외: 원본 PDF 구성종목
    #[prost(map="string, message", tag="1")]
    pub constituents: ::std::collections::HashMap<::prost::alloc::string::String, EtfPdfConstituent>,
}
/// GetEtfPricingState
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetEtfPricingStateRequest {
    /// ETF 리소스 이름 (예: "etfs/069500")
    #[prost(string, tag="1")]
    pub etf: ::prost::alloc::string::String,
    /// pricing 모드 + 파라미터
    #[prost(message, optional, tag="2")]
    pub pricing: ::core::option::Option<super::common::EtfPricing>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetEtfPricingStateResponse {
    /// pricing 식별자 (도메인 EtfPricing::as_str():
    /// "pdf_nav_hedge" | "pdf_decompose_hedge" | "index_tracking_hedge"
    /// | "future_basis" | "leverage_future")
    #[prost(string, tag="1")]
    pub pricing_kind: ::prost::alloc::string::String,
    /// 공통 — 모든 pricing 모드에서 채워짐
    #[prost(string, tag="2")]
    pub unit_delta: ::prost::alloc::string::String,
    #[prost(string, tag="3")]
    pub prev_nav: ::prost::alloc::string::String,
    /// 정적 leverage 설정값 (예: "2.0", "-1.0"). 인버스면 음수.
    #[prost(string, tag="4")]
    pub leverage: ::prost::alloc::string::String,
    #[prost(string, tag="5")]
    pub cash_per_share: ::prost::alloc::string::String,
    #[prost(int64, tag="6")]
    pub creation_unit: i64,
    /// LeverageFuture 전용 (pricing_kind == "leverage_future"일 때만 채움)
    /// k: 바스켓 내 현물 비중 (0.0 ~ 1.0)
    #[prost(double, optional, tag="10")]
    pub stock_ratio: ::core::option::Option<f64>,
    /// Nav0: 하위 ETF 시장가-NAV 괴리 보정 전일 NAV
    #[prost(string, optional, tag="11")]
    pub constituent_adjusted_prev_nav: ::core::option::Option<::prost::alloc::string::String>,
    /// L = unit_delta / Nav0 (인버스면 부호 반전)
    #[prost(string, optional, tag="12")]
    pub actual_leverage_l: ::core::option::Option<::prost::alloc::string::String>,
    /// 요청에서 받은 prev_index, prev_future echo
    /// (FutureBasis는 prev_index만 채워짐)
    #[prost(string, optional, tag="13")]
    pub prev_index: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag="14")]
    pub prev_future: ::core::option::Option<::prost::alloc::string::String>,
}
/// 복제 방법
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ReplicationMethod {
    Unspecified = 0,
    Active = 1,
    Physical = 2,
    Synthetic = 3,
}
impl ReplicationMethod {
    /// 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 {
            ReplicationMethod::Unspecified => "REPLICATION_METHOD_UNSPECIFIED",
            ReplicationMethod::Active => "REPLICATION_METHOD_ACTIVE",
            ReplicationMethod::Physical => "REPLICATION_METHOD_PHYSICAL",
            ReplicationMethod::Synthetic => "REPLICATION_METHOD_SYNTHETIC",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "REPLICATION_METHOD_UNSPECIFIED" => Some(Self::Unspecified),
            "REPLICATION_METHOD_ACTIVE" => Some(Self::Active),
            "REPLICATION_METHOD_PHYSICAL" => Some(Self::Physical),
            "REPLICATION_METHOD_SYNTHETIC" => Some(Self::Synthetic),
            _ => None,
        }
    }
}
include!("kdo.v1.etf.tonic.rs");
include!("kdo.v1.etf.serde.rs");
// @@protoc_insertion_point(module)