Skip to main content

ids_apis/
kdo.v1.etf.rs

1// @generated
2// This file is @generated by prost-build.
3#[allow(clippy::derive_partial_eq_without_eq)]
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct Etf {
6    /// ETF ID
7    #[prost(uint64, tag="1")]
8    pub id: u64,
9    /// ETF 심볼 (ISIN 코드)
10    #[prost(string, tag="2")]
11    pub symbol: ::prost::alloc::string::String,
12    /// ETF 코드
13    #[prost(string, tag="3")]
14    pub code: ::prost::alloc::string::String,
15    /// ETF 이름
16    #[prost(string, tag="4")]
17    pub name: ::prost::alloc::string::String,
18    /// 마지막 가격
19    #[prost(string, tag="5")]
20    pub prev_close: ::prost::alloc::string::String,
21    #[prost(string, tag="6")]
22    pub prev_close_nav: ::prost::alloc::string::String,
23    #[prost(string, tag="7")]
24    pub last_price: ::prost::alloc::string::String,
25    #[prost(string, tag="8")]
26    pub last_ask_inav: ::prost::alloc::string::String,
27    #[prost(string, tag="9")]
28    pub last_bid_inav: ::prost::alloc::string::String,
29    /// PDF 구성 종목 목록
30    #[prost(map="string, message", tag="10")]
31    pub constituents: ::std::collections::HashMap<::prost::alloc::string::String, EtfPdfConstituent>,
32    /// 설정 단위
33    #[prost(int64, tag="11")]
34    pub creation_unit: i64,
35    /// 복제 방법
36    #[prost(enumeration="ReplicationMethod", tag="12")]
37    pub replication_method: i32,
38    /// Tick 크기 (원 단위, i64)
39    #[prost(int64, tag="13")]
40    pub tick_size: i64,
41    /// Tick 크기 (원 단위, i64)
42    #[prost(int64, tag="14")]
43    pub listed_quantity: i64,
44    #[prost(float, tag="15")]
45    pub leverage: f32,
46    #[prost(bool, tag="16")]
47    pub tradable: bool,
48    #[prost(bool, tag="17")]
49    pub short_sellable: bool,
50    /// 기초자산 정보
51    #[prost(message, optional, tag="18")]
52    pub tracking_asset: ::core::option::Option<UnderlyingAsset>,
53    #[prost(bool, tag="23")]
54    pub cash_creditable: bool,
55    #[prost(int64, tag="24")]
56    pub cash_creation_amount: i64,
57    /// ETF 변환 정보 (예: 레버리지/인버스 ETF의 선물 변환)
58    #[prost(map="string, message", tag="25")]
59    pub conversions: ::std::collections::HashMap<::prost::alloc::string::String, Conversion>,
60    /// unit_delta (구성종목 기반 NAV 계산용)
61    #[prost(string, tag="26")]
62    pub unit_delta: ::prost::alloc::string::String,
63}
64#[allow(clippy::derive_partial_eq_without_eq)]
65#[derive(Clone, PartialEq, ::prost::Message)]
66pub struct EtfConstituent {
67    #[prost(oneof="etf_constituent::ConstituentType", tags="1, 2, 3")]
68    pub constituent_type: ::core::option::Option<etf_constituent::ConstituentType>,
69}
70/// Nested message and enum types in `EtfConstituent`.
71pub mod etf_constituent {
72    #[allow(clippy::derive_partial_eq_without_eq)]
73#[derive(Clone, PartialEq, ::prost::Oneof)]
74    pub enum ConstituentType {
75        #[prost(message, tag="1")]
76        Stock(super::StockConstituent),
77        #[prost(message, tag="2")]
78        Futures(super::FuturesConstituent),
79        #[prost(message, tag="3")]
80        Cash(super::CashConstituent),
81    }
82}
83#[allow(clippy::derive_partial_eq_without_eq)]
84#[derive(Clone, PartialEq, ::prost::Message)]
85pub struct StockConstituent {
86    #[prost(string, tag="1")]
87    pub symbol: ::prost::alloc::string::String,
88    #[prost(string, tag="2")]
89    pub prev_close: ::prost::alloc::string::String,
90    #[prost(string, tag="3")]
91    pub last_price: ::prost::alloc::string::String,
92    #[prost(int64, tag="4")]
93    pub quantity: i64,
94    #[prost(int64, tag="5")]
95    pub last_valuation: i64,
96    #[prost(int64, tag="6")]
97    pub notional_amount: i64,
98    #[prost(uint32, tag="7")]
99    pub num_members: u32,
100}
101#[allow(clippy::derive_partial_eq_without_eq)]
102#[derive(Clone, PartialEq, ::prost::Message)]
103pub struct FuturesConstituent {
104    #[prost(string, tag="1")]
105    pub symbol: ::prost::alloc::string::String,
106    #[prost(string, tag="2")]
107    pub prev_close: ::prost::alloc::string::String,
108    #[prost(string, tag="3")]
109    pub last_price: ::prost::alloc::string::String,
110    #[prost(float, tag="4")]
111    pub quantity: f32,
112    #[prost(double, tag="5")]
113    pub multiple: f64,
114    #[prost(int64, tag="6")]
115    pub last_valuation: i64,
116    #[prost(int64, tag="7")]
117    pub notional_amount: i64,
118    #[prost(uint32, tag="8")]
119    pub num_members: u32,
120}
121#[allow(clippy::derive_partial_eq_without_eq)]
122#[derive(Clone, PartialEq, ::prost::Message)]
123pub struct CashConstituent {
124    #[prost(string, tag="1")]
125    pub symbol: ::prost::alloc::string::String,
126    #[prost(int64, tag="2")]
127    pub prev_valuation: i64,
128    #[prost(uint32, tag="3")]
129    pub num_members: u32,
130}
131/// PDF 구성 종목
132#[allow(clippy::derive_partial_eq_without_eq)]
133#[derive(Clone, PartialEq, ::prost::Message)]
134pub struct EtfPdfConstituent {
135    /// 종목 코드
136    ///
137    /// symbol
138    #[prost(string, tag="1")]
139    pub symbol: ::prost::alloc::string::String,
140    /// 종목명
141    #[prost(string, tag="2")]
142    pub name: ::prost::alloc::string::String,
143    /// 상품 타입
144    #[prost(enumeration="super::common::ProductType", tag="3")]
145    pub product_type: i32,
146    /// 구성 수량 (선물 숏의 경우 음수, 소수 지원). Cash의 경우 원화 금액(원 단위 정수).
147    #[prost(string, tag="4")]
148    pub quantity: ::prost::alloc::string::String,
149}
150/// ETF가 다른 상품으로 변환될 수 있는 정보
151/// 예: KODEX 2X Inverse는 1cu당 -0.37개의 코스피200 선물로 변환 가능
152#[allow(clippy::derive_partial_eq_without_eq)]
153#[derive(Clone, PartialEq, ::prost::Message)]
154pub struct Conversion {
155    /// 변환 대상 심볼
156    #[prost(string, tag="1")]
157    pub symbol: ::prost::alloc::string::String,
158    /// 변환 대상 상품 타입
159    #[prost(enumeration="super::common::ProductType", tag="2")]
160    pub product_type: i32,
161    /// 1 CU당 변환 비율
162    /// 예: KODEX 2X Inverse → 코스피200 선물 = -0.37
163    #[prost(double, tag="3")]
164    pub ratio_per_cu: f64,
165}
166/// 기초자산
167#[allow(clippy::derive_partial_eq_without_eq)]
168#[derive(Clone, PartialEq, ::prost::Message)]
169pub struct UnderlyingAsset {
170    #[prost(oneof="underlying_asset::Asset", tags="1, 2, 3, 4")]
171    pub asset: ::core::option::Option<underlying_asset::Asset>,
172}
173/// Nested message and enum types in `UnderlyingAsset`.
174pub mod underlying_asset {
175    #[allow(clippy::derive_partial_eq_without_eq)]
176#[derive(Clone, PartialEq, ::prost::Oneof)]
177    pub enum Asset {
178        /// 선물형
179        #[prost(message, tag="1")]
180        Future(super::UnderlyingFuture),
181        /// 채권형
182        #[prost(message, tag="2")]
183        FixedIncome(super::UnderlyingFixedIncome),
184        /// 원자재형
185        #[prost(message, tag="3")]
186        Commodity(super::UnderlyingCommodity),
187        /// 통화형
188        #[prost(message, tag="4")]
189        Currency(super::UnderlyingCurrency),
190    }
191}
192/// 선물형 기초자산
193#[allow(clippy::derive_partial_eq_without_eq)]
194#[derive(Clone, PartialEq, ::prost::Message)]
195pub struct UnderlyingFuture {
196    /// 선물 종목 심볼
197    #[prost(string, tag="1")]
198    pub symbol: ::prost::alloc::string::String,
199    /// 승수
200    #[prost(string, tag="2")]
201    pub multiple: ::prost::alloc::string::String,
202    /// 최근 매도호가
203    #[prost(string, tag="3")]
204    pub last_ask_price: ::prost::alloc::string::String,
205    /// 최근 매수호가
206    #[prost(string, tag="4")]
207    pub last_bid_price: ::prost::alloc::string::String,
208}
209/// 채권형 기초자산
210#[allow(clippy::derive_partial_eq_without_eq)]
211#[derive(Clone, PartialEq, ::prost::Message)]
212pub struct UnderlyingFixedIncome {
213    /// 종목 심볼
214    #[prost(string, tag="1")]
215    pub symbol: ::prost::alloc::string::String,
216}
217/// 원자재형 기초자산
218#[allow(clippy::derive_partial_eq_without_eq)]
219#[derive(Clone, PartialEq, ::prost::Message)]
220pub struct UnderlyingCommodity {
221    /// 종목 심볼
222    #[prost(string, tag="1")]
223    pub symbol: ::prost::alloc::string::String,
224}
225/// 통화형 기초자산
226#[allow(clippy::derive_partial_eq_without_eq)]
227#[derive(Clone, PartialEq, ::prost::Message)]
228pub struct UnderlyingCurrency {
229    /// 종목 심볼
230    #[prost(string, tag="1")]
231    pub symbol: ::prost::alloc::string::String,
232}
233// ========== Request/Response Messages ==========
234
235/// GetEtf
236#[allow(clippy::derive_partial_eq_without_eq)]
237#[derive(Clone, PartialEq, ::prost::Message)]
238pub struct GetEtfRequest {
239    #[prost(string, tag="1")]
240    pub etf: ::prost::alloc::string::String,
241}
242/// ListEtfs
243#[allow(clippy::derive_partial_eq_without_eq)]
244#[derive(Clone, PartialEq, ::prost::Message)]
245pub struct ListEtfsRequest {
246    /// 페이지 크기 (optional)
247    #[prost(uint32, optional, tag="1")]
248    pub page_size: ::core::option::Option<u32>,
249    /// 페이지 토큰 (optional, for pagination)
250    #[prost(string, optional, tag="2")]
251    pub page_token: ::core::option::Option<::prost::alloc::string::String>,
252    /// 필터링 조건 (optional, AIP-160)
253    #[prost(string, tag="3")]
254    pub filter: ::prost::alloc::string::String,
255}
256#[allow(clippy::derive_partial_eq_without_eq)]
257#[derive(Clone, PartialEq, ::prost::Message)]
258pub struct ListEtfsResponse {
259    /// ETF 목록
260    #[prost(message, repeated, tag="1")]
261    pub etfs: ::prost::alloc::vec::Vec<Etf>,
262    /// 다음 페이지 토큰
263    #[prost(string, tag="2")]
264    pub next_page_token: ::prost::alloc::string::String,
265}
266/// GetEtfTickImpact
267#[allow(clippy::derive_partial_eq_without_eq)]
268#[derive(Clone, PartialEq, ::prost::Message)]
269pub struct GetEtfTickImpactRequest {
270    /// ETF 리소스 이름 (예: etfs/069500)
271    #[prost(string, tag="1")]
272    pub etf: ::prost::alloc::string::String,
273    /// 구성종목 심볼
274    #[prost(string, tag="2")]
275    pub constituent_symbol: ::prost::alloc::string::String,
276    /// 기준가 (이 가격을 중심으로 위아래 틱 계산)
277    #[prost(string, tag="3")]
278    pub base_price: ::prost::alloc::string::String,
279    /// 위아래 계산할 틱 수 (예: 3이면 base_price 기준 -3틱 ~ +3틱)
280    #[prost(int32, tag="4")]
281    pub tick_range: i32,
282}
283/// ETF 틱 임팩트 응답
284#[allow(clippy::derive_partial_eq_without_eq)]
285#[derive(Clone, PartialEq, ::prost::Message)]
286pub struct EtfTickImpact {
287    /// ETF 심볼
288    #[prost(string, tag="1")]
289    pub etf_symbol: ::prost::alloc::string::String,
290    /// 구성종목 심볼
291    #[prost(string, tag="2")]
292    pub constituent_symbol: ::prost::alloc::string::String,
293    /// 현재 ETF NAV
294    #[prost(string, tag="3")]
295    pub current_nav: ::prost::alloc::string::String,
296    /// 구성종목 현재가
297    #[prost(string, tag="4")]
298    pub current_price: ::prost::alloc::string::String,
299    /// 틱 변동별 NAV 시뮬레이션 결과 (-tick_range ~ +tick_range 순서)
300    #[prost(message, repeated, tag="5")]
301    pub points: ::prost::alloc::vec::Vec<TickNavPoint>,
302}
303/// 틱 변동에 따른 NAV 포인트
304#[allow(clippy::derive_partial_eq_without_eq)]
305#[derive(Clone, PartialEq, ::prost::Message)]
306pub struct TickNavPoint {
307    /// 틱 오프셋 (예: -3, -2, -1, 0, +1, +2, +3)
308    #[prost(int32, tag="1")]
309    pub tick_offset: i32,
310    /// 해당 틱에서의 구성종목 가격
311    #[prost(string, tag="2")]
312    pub price: ::prost::alloc::string::String,
313    /// 해당 틱에서의 ETF NAV
314    #[prost(string, tag="3")]
315    pub nav: ::prost::alloc::string::String,
316}
317#[allow(clippy::derive_partial_eq_without_eq)]
318#[derive(Clone, PartialEq, ::prost::Message)]
319pub struct UpdateEtfUnitDeltaRequest {
320    #[prost(string, tag="1")]
321    pub etf: ::prost::alloc::string::String,
322    #[prost(string, tag="2")]
323    pub unit_delta: ::prost::alloc::string::String,
324}
325#[allow(clippy::derive_partial_eq_without_eq)]
326#[derive(Clone, PartialEq, ::prost::Message)]
327pub struct CreateRedeemEtfRequest {
328    #[prost(string, tag="1")]
329    pub etf: ::prost::alloc::string::String,
330    #[prost(string, tag="2")]
331    pub fund: ::prost::alloc::string::String,
332    #[prost(int64, tag="3")]
333    pub quantity: i64,
334    #[prost(bool, tag="4")]
335    pub is_creation: bool,
336}
337/// CalcEtfUnitPrice
338#[allow(clippy::derive_partial_eq_without_eq)]
339#[derive(Clone, PartialEq, ::prost::Message)]
340pub struct CalcEtfUnitPriceRequest {
341    #[prost(string, tag="1")]
342    pub etf: ::prost::alloc::string::String,
343    /// 가격 산출 방식 (IndexTrackingHedge / LeverageFuture 만 지원)
344    #[prost(message, optional, tag="2")]
345    pub pricing: ::core::option::Option<super::common::EtfPricing>,
346    /// ETF 체결 방향 (Bid=매수 / Ask=매도)
347    #[prost(enumeration="super::common::OrderSide", tag="3")]
348    pub etf_side: i32,
349    /// ETF 체결 수량
350    #[prost(int64, tag="4")]
351    pub etf_quantity: i64,
352    /// ETF 체결 가격
353    #[prost(string, tag="5")]
354    pub etf_price: ::prost::alloc::string::String,
355    /// 헷지(선물) 방향
356    #[prost(enumeration="super::common::OrderSide", tag="6")]
357    pub hedge_side: i32,
358    /// 헷지(선물) 수량
359    #[prost(int64, tag="7")]
360    pub hedge_quantity: i64,
361    /// 헷지(선물) 가격
362    #[prost(string, tag="8")]
363    pub hedge_price: ::prost::alloc::string::String,
364    /// 타겟 단가 (optional, 제공 시 PnL 계산)
365    #[prost(string, optional, tag="9")]
366    pub target_unit_price: ::core::option::Option<::prost::alloc::string::String>,
367}
368#[allow(clippy::derive_partial_eq_without_eq)]
369#[derive(Clone, PartialEq, ::prost::Message)]
370pub struct CalcEtfUnitPriceResponse {
371    /// 계산된 단가
372    #[prost(string, tag="1")]
373    pub unit_price: ::prost::alloc::string::String,
374    /// (unit_price - target_unit_price) × etf_quantity, target 제공 시에만
375    #[prost(string, optional, tag="2")]
376    pub pnl: ::core::option::Option<::prost::alloc::string::String>,
377}
378/// GetEtfConstituents
379#[allow(clippy::derive_partial_eq_without_eq)]
380#[derive(Clone, PartialEq, ::prost::Message)]
381pub struct GetEtfConstituentsRequest {
382    /// ETF 리소스 이름 (예: etfs/069500)
383    #[prost(string, tag="1")]
384    pub etf: ::prost::alloc::string::String,
385    /// 가격 산출 방식 (pricing 종류에 따라 flattened 여부가 결정됨)
386    #[prost(message, optional, tag="2")]
387    pub pricing: ::core::option::Option<super::common::EtfPricing>,
388}
389#[allow(clippy::derive_partial_eq_without_eq)]
390#[derive(Clone, PartialEq, ::prost::Message)]
391pub struct GetEtfConstituentsResponse {
392    /// pricing에 따라 flattened 여부가 결정된 구성종목 맵
393    /// PdfDecomposeHedge: leaf(Stock/Futures/Cash)로 재귀 분해된 flattened 버전
394    /// 그 외: 원본 PDF 구성종목
395    #[prost(map="string, message", tag="1")]
396    pub constituents: ::std::collections::HashMap<::prost::alloc::string::String, EtfPdfConstituent>,
397}
398/// GetEtfPricingState
399#[allow(clippy::derive_partial_eq_without_eq)]
400#[derive(Clone, PartialEq, ::prost::Message)]
401pub struct GetEtfPricingStateRequest {
402    /// ETF 리소스 이름 (예: "etfs/069500")
403    #[prost(string, tag="1")]
404    pub etf: ::prost::alloc::string::String,
405    /// pricing 모드 + 파라미터
406    #[prost(message, optional, tag="2")]
407    pub pricing: ::core::option::Option<super::common::EtfPricing>,
408}
409#[allow(clippy::derive_partial_eq_without_eq)]
410#[derive(Clone, PartialEq, ::prost::Message)]
411pub struct GetEtfPricingStateResponse {
412    /// pricing 식별자 (도메인 EtfPricing::as_str():
413    /// "pdf_nav_hedge" | "pdf_decompose_hedge" | "index_tracking_hedge"
414    /// | "future_basis" | "leverage_future")
415    #[prost(string, tag="1")]
416    pub pricing_kind: ::prost::alloc::string::String,
417    /// 공통 — 모든 pricing 모드에서 채워짐
418    #[prost(string, tag="2")]
419    pub unit_delta: ::prost::alloc::string::String,
420    #[prost(string, tag="3")]
421    pub prev_nav: ::prost::alloc::string::String,
422    /// 정적 leverage 설정값 (예: "2.0", "-1.0"). 인버스면 음수.
423    #[prost(string, tag="4")]
424    pub leverage: ::prost::alloc::string::String,
425    #[prost(string, tag="5")]
426    pub cash_per_share: ::prost::alloc::string::String,
427    #[prost(int64, tag="6")]
428    pub creation_unit: i64,
429    /// LeverageFuture 전용 (pricing_kind == "leverage_future"일 때만 채움)
430    /// k: 바스켓 내 현물 비중 (0.0 ~ 1.0)
431    #[prost(double, optional, tag="10")]
432    pub stock_ratio: ::core::option::Option<f64>,
433    /// Nav0: 하위 ETF 시장가-NAV 괴리 보정 전일 NAV
434    #[prost(string, optional, tag="11")]
435    pub constituent_adjusted_prev_nav: ::core::option::Option<::prost::alloc::string::String>,
436    /// L = unit_delta / Nav0 (인버스면 부호 반전)
437    #[prost(string, optional, tag="12")]
438    pub actual_leverage_l: ::core::option::Option<::prost::alloc::string::String>,
439    /// 요청에서 받은 prev_index, prev_future echo
440    /// (FutureBasis는 prev_index만 채워짐)
441    #[prost(string, optional, tag="13")]
442    pub prev_index: ::core::option::Option<::prost::alloc::string::String>,
443    #[prost(string, optional, tag="14")]
444    pub prev_future: ::core::option::Option<::prost::alloc::string::String>,
445}
446/// 복제 방법
447#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
448#[repr(i32)]
449pub enum ReplicationMethod {
450    Unspecified = 0,
451    Active = 1,
452    Physical = 2,
453    Synthetic = 3,
454}
455impl ReplicationMethod {
456    /// String value of the enum field names used in the ProtoBuf definition.
457    ///
458    /// The values are not transformed in any way and thus are considered stable
459    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
460    pub fn as_str_name(&self) -> &'static str {
461        match self {
462            ReplicationMethod::Unspecified => "REPLICATION_METHOD_UNSPECIFIED",
463            ReplicationMethod::Active => "REPLICATION_METHOD_ACTIVE",
464            ReplicationMethod::Physical => "REPLICATION_METHOD_PHYSICAL",
465            ReplicationMethod::Synthetic => "REPLICATION_METHOD_SYNTHETIC",
466        }
467    }
468    /// Creates an enum from field names used in the ProtoBuf definition.
469    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
470        match value {
471            "REPLICATION_METHOD_UNSPECIFIED" => Some(Self::Unspecified),
472            "REPLICATION_METHOD_ACTIVE" => Some(Self::Active),
473            "REPLICATION_METHOD_PHYSICAL" => Some(Self::Physical),
474            "REPLICATION_METHOD_SYNTHETIC" => Some(Self::Synthetic),
475            _ => None,
476        }
477    }
478}
479include!("kdo.v1.etf.tonic.rs");
480include!("kdo.v1.etf.serde.rs");
481// @@protoc_insertion_point(module)