Skip to main content

ids_apis/
kdo.v1.lp.rs

1// @generated
2// This file is @generated by prost-build.
3/// ETF LP 설정
4#[allow(clippy::derive_partial_eq_without_eq)]
5#[derive(Clone, PartialEq, ::prost::Message)]
6pub struct EtfLp {
7    /// ETF 심볼
8    #[prost(string, tag="1")]
9    pub symbol: ::prost::alloc::string::String,
10    /// Fund
11    #[prost(string, tag="2")]
12    pub fund_code: ::prost::alloc::string::String,
13    /// Basis 스프레드 (원 단위, i64)
14    #[prost(int64, tag="6")]
15    pub basis: i64,
16    /// 주문 수량 (i64)
17    #[prost(int64, tag="7")]
18    pub quantity: i64,
19    /// 호가 깊이 (양방향 레벨 수)
20    #[prost(uint32, tag="8")]
21    pub depth: u32,
22    /// ETF tick 크기 (원 단위, i64)
23    #[prost(int64, tag="9")]
24    pub tick_size: i64,
25    /// 동적 offset 조정 설정
26    #[prost(message, optional, tag="10")]
27    pub offset: ::core::option::Option<EtfLpOffset>,
28}
29// ========== ETF LP Status Messages ==========
30
31/// ETF LP 상태
32#[allow(clippy::derive_partial_eq_without_eq)]
33#[derive(Clone, PartialEq, ::prost::Message)]
34pub struct EtfLpStatus {
35    /// ETF 심볼
36    #[prost(string, tag="1")]
37    pub etf_symbol: ::prost::alloc::string::String,
38    /// 펀드 코드
39    #[prost(string, tag="2")]
40    pub fund_code: ::prost::alloc::string::String,
41    /// Basis 스프레드 (원 단위, i64)
42    #[prost(int64, tag="6")]
43    pub basis: i64,
44    /// 주문 수량 (i64)
45    #[prost(int64, tag="7")]
46    pub quantity: i64,
47    /// LP 상태
48    #[prost(enumeration="EtfLpState", tag="8")]
49    pub state: i32,
50    /// 가격 정보
51    #[prost(message, optional, tag="9")]
52    pub pricing: ::core::option::Option<LpPricing>,
53    /// 체결 통계
54    #[prost(message, optional, tag="10")]
55    pub fill_statistics: ::core::option::Option<FillStatistics>,
56    /// 동적 offset 조정 설정 (optional)
57    #[prost(message, optional, tag="11")]
58    pub offset: ::core::option::Option<EtfLpOffset>,
59}
60/// ETF LP 상태 업데이트 메시지 (변화된 필드만 포함)
61#[allow(clippy::derive_partial_eq_without_eq)]
62#[derive(Clone, PartialEq, ::prost::Message)]
63pub struct EtfLpStatusUpdate {
64    /// ETF 심볼
65    #[prost(string, tag="1")]
66    pub etf_symbol: ::prost::alloc::string::String,
67    /// 펀드 코드
68    #[prost(string, tag="2")]
69    pub fund_code: ::prost::alloc::string::String,
70    /// Basis 스프레드 (원 단위, i64)
71    #[prost(int64, optional, tag="6")]
72    pub basis: ::core::option::Option<i64>,
73    /// 주문 수량 (i64)
74    #[prost(int64, optional, tag="7")]
75    pub quantity: ::core::option::Option<i64>,
76    /// LP 상태
77    #[prost(enumeration="EtfLpState", optional, tag="8")]
78    pub state: ::core::option::Option<i32>,
79    /// 가격 정보
80    #[prost(message, optional, tag="9")]
81    pub pricing: ::core::option::Option<LpPricing>,
82    /// 체결 통계
83    #[prost(message, optional, tag="10")]
84    pub fill_statistics: ::core::option::Option<FillStatistics>,
85    /// 동적 offset 조정 설정 (optional)
86    #[prost(message, optional, tag="11")]
87    pub offset: ::core::option::Option<EtfLpOffset>,
88}
89/// 자동 offset 조정 설정
90#[allow(clippy::derive_partial_eq_without_eq)]
91#[derive(Clone, Copy, PartialEq, ::prost::Message)]
92pub struct EtfLpOffset {
93    ///
94    #[prost(double, tag="1")]
95    pub bid_offset: f64,
96    #[prost(double, tag="2")]
97    pub ask_offset: f64,
98    /// NAV 밴드 설정
99    #[prost(double, tag="3")]
100    pub min_offset: f64,
101    #[prost(double, tag="4")]
102    pub max_offset: f64,
103    /// 시간 기반 조정
104    #[prost(bool, tag="7")]
105    pub time_adjustment_enabled: bool,
106    #[prost(uint64, tag="8")]
107    pub adjustment_interval_secs: u64,
108    #[prost(double, tag="9")]
109    pub adjustment_step: f64,
110    #[prost(bool, tag="10")]
111    pub reset_on_fill: bool,
112    /// 순매매량 기반 조정
113    #[prost(bool, tag="17")]
114    pub position_adjustment_enabled: bool,
115    #[prost(enumeration="PositionAdjustmentStrategy", tag="18")]
116    pub position_strategy: i32,
117    #[prost(int64, tag="19")]
118    pub position_threshold: i64,
119    #[prost(double, tag="20")]
120    pub position_adjustment_step: f64,
121}
122/// ETF 체결 통계 (매수/매도 체결량 및 평균 단가)
123#[allow(clippy::derive_partial_eq_without_eq)]
124#[derive(Clone, PartialEq, ::prost::Message)]
125pub struct FillStatistics {
126    /// 매수 체결량
127    #[prost(int64, tag="1")]
128    pub buy_filled_quantity: i64,
129    /// 매도 체결량
130    #[prost(int64, tag="2")]
131    pub sell_filled_quantity: i64,
132    /// 매수 총금액 (평균 단가 계산용)
133    #[prost(string, tag="3")]
134    pub buy_total_amount: ::prost::alloc::string::String,
135    /// 매도 총금액 (평균 단가 계산용)
136    #[prost(string, tag="4")]
137    pub sell_total_amount: ::prost::alloc::string::String,
138}
139/// 주문 통계
140#[allow(clippy::derive_partial_eq_without_eq)]
141#[derive(Clone, Copy, PartialEq, ::prost::Message)]
142pub struct OrderStats {
143    /// 총 전송 주문 수
144    #[prost(uint64, tag="1")]
145    pub total_orders_sent: u64,
146    /// 접수된 주문 수
147    #[prost(uint64, tag="2")]
148    pub orders_accepted: u64,
149    /// 거부된 주문 수
150    #[prost(uint64, tag="3")]
151    pub orders_rejected: u64,
152    /// 체결된 주문 수
153    #[prost(uint64, tag="4")]
154    pub orders_filled: u64,
155    /// 총 체결 수량
156    #[prost(int64, tag="5")]
157    pub total_filled_quantity: i64,
158    /// 일일 체결 수량
159    #[prost(int64, tag="6")]
160    pub daily_filled_quantity: i64,
161}
162// Order Limiter 상태
163// message OrderLimitStatus {
164//   // 일일 누적 체결 수량 (i64)
165//   int64 daily_filled_quantity = 1;
166//
167//   // 일일 누적 체결 수량 한도 (i64)
168//   int64 daily_cumulative_limit = 2;
169//
170//   // 시간 프레임별 주문 개수 현황
171//   repeated TimeFrameStatus time_frame_status = 3;
172//
173//   // 일일 사용률 (%)
174//   double daily_usage_percent = 4;
175// }
176
177/// 시간 프레임별 상태
178#[allow(clippy::derive_partial_eq_without_eq)]
179#[derive(Clone, Copy, PartialEq, ::prost::Message)]
180pub struct TimeFrameStatus {
181    /// 시간 윈도우 (초)
182    #[prost(uint64, tag="1")]
183    pub window_seconds: u64,
184    /// 현재 윈도우 내 주문 개수
185    #[prost(uint32, tag="2")]
186    pub current_count: u32,
187    /// 최대 주문 개수
188    #[prost(uint32, tag="3")]
189    pub max_orders: u32,
190    /// 사용률 (%)
191    #[prost(double, tag="4")]
192    pub usage_percent: f64,
193}
194/// LP 가격 정보
195#[allow(clippy::derive_partial_eq_without_eq)]
196#[derive(Clone, PartialEq, ::prost::Message)]
197pub struct LpPricing {
198    /// ETF 가격 (원 단위)
199    #[prost(string, tag="1")]
200    pub etf_price: ::prost::alloc::string::String,
201    // 구성 종목 가격 맵 (종목 코드 -> 가격, 원 단위)
202    //   map<string, string> constituents_price = 2;
203
204    /// ETF NAV (원 단위)
205    #[prost(string, tag="3")]
206    pub etf_nav: ::prost::alloc::string::String,
207}
208/// ========== Request/Response Messages ==========
209/// GetEtfLp
210#[allow(clippy::derive_partial_eq_without_eq)]
211#[derive(Clone, PartialEq, ::prost::Message)]
212pub struct GetEtfLpRequest {
213    #[prost(string, tag="1")]
214    pub etf: ::prost::alloc::string::String,
215    #[prost(string, tag="2")]
216    pub fund: ::prost::alloc::string::String,
217}
218/// ListEtfLps
219#[allow(clippy::derive_partial_eq_without_eq)]
220#[derive(Clone, PartialEq, ::prost::Message)]
221pub struct ListEtfLpsRequest {
222    /// 페이지 크기 (optional)
223    #[prost(uint32, optional, tag="1")]
224    pub page_size: ::core::option::Option<u32>,
225    /// 페이지 토큰 (optional, for pagination)
226    #[prost(string, optional, tag="2")]
227    pub page_token: ::core::option::Option<::prost::alloc::string::String>,
228    /// Available Sequence and Operator
229    /// * etf_symbol
230    ///    * `equal`, `contains`
231    /// * fund_code
232    ///    * `equal`, `contains`
233    ///
234    /// Examples
235    /// * filter=etf_symbol:"005930"
236    /// * filter=fund_code="0159"
237    #[prost(string, tag="3")]
238    pub filter: ::prost::alloc::string::String,
239}
240#[allow(clippy::derive_partial_eq_without_eq)]
241#[derive(Clone, PartialEq, ::prost::Message)]
242pub struct ListEtfLpsResponse {
243    /// ETF 목록
244    #[prost(message, repeated, tag="1")]
245    pub etf_lps: ::prost::alloc::vec::Vec<EtfLp>,
246    /// 다음 페이지 토큰
247    #[prost(string, tag="2")]
248    pub next_page_token: ::prost::alloc::string::String,
249}
250#[allow(clippy::derive_partial_eq_without_eq)]
251#[derive(Clone, PartialEq, ::prost::Message)]
252pub struct ListEtfLpStatusesRequest {
253    /// 페이지 크기 (optional)
254    #[prost(uint32, optional, tag="1")]
255    pub page_size: ::core::option::Option<u32>,
256    /// 페이지 토큰 (optional, for pagination)
257    #[prost(string, optional, tag="2")]
258    pub page_token: ::core::option::Option<::prost::alloc::string::String>,
259    // Available Sequence and Operator
260    // * etf_symbol
261    //    * `equal`, `contains`
262    // * fund_code
263    //    * `equal`, `contains`
264    // * state
265    //    * `equal`
266    // * fill_satistics.buy_filled_quantity
267    //    * `greater_than`, `less_than`
268    //
269    // Examples
270    // * filter=etf_symbol:"005930"
271    // * filter=fund_code="0159"
272    // * filter=state=ETF_LP_STATE_RUNNING
273    // * filter=fill_statistics.buy_filled_quantity > 1000
274
275    #[prost(string, tag="3")]
276    pub filter: ::prost::alloc::string::String,
277    /// 오더링 조건. (optional, AIP-132)
278    ///
279    /// Supported Fields
280    /// * "fill_statistics.buy_filled_quantity", "fill_statistics.sell_filled_quantity"
281    ///
282    /// Examples
283    /// * order_by=fill_statistics.buy_filled_quantity desc
284    #[prost(string, tag="5")]
285    pub order_by: ::prost::alloc::string::String,
286}
287#[allow(clippy::derive_partial_eq_without_eq)]
288#[derive(Clone, PartialEq, ::prost::Message)]
289pub struct ListEtfLpStatusesResponse {
290    /// ETF 목록
291    #[prost(message, repeated, tag="1")]
292    pub etf_lp_statuses: ::prost::alloc::vec::Vec<EtfLpStatus>,
293    /// 다음 페이지 토큰
294    #[prost(string, tag="2")]
295    pub next_page_token: ::prost::alloc::string::String,
296}
297/// UpdateEtfLp
298#[allow(clippy::derive_partial_eq_without_eq)]
299#[derive(Clone, PartialEq, ::prost::Message)]
300pub struct UpdateEtfLpRequest {
301    /// ETF 심볼
302    #[prost(string, tag="1")]
303    pub symbol: ::prost::alloc::string::String,
304    /// 펀드 코드
305    #[prost(string, tag="2")]
306    pub fund_code: ::prost::alloc::string::String,
307    /// 업데이트 대상
308    #[prost(oneof="update_etf_lp_request::Update", tags="3, 4, 5")]
309    pub update: ::core::option::Option<update_etf_lp_request::Update>,
310}
311/// Nested message and enum types in `UpdateEtfLpRequest`.
312pub mod update_etf_lp_request {
313    /// 업데이트 대상
314    #[allow(clippy::derive_partial_eq_without_eq)]
315#[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
316    pub enum Update {
317        /// 주문 수량
318        #[prost(int64, tag="3")]
319        Quantity(i64),
320        /// 호가 깊이
321        #[prost(uint32, tag="4")]
322        Depth(u32),
323        /// 동적 offset 조정 설정
324        #[prost(message, tag="5")]
325        Offset(super::EtfLpOffset),
326    }
327}
328/// GetEtfLpStatus
329#[allow(clippy::derive_partial_eq_without_eq)]
330#[derive(Clone, PartialEq, ::prost::Message)]
331pub struct GetEtfLpStatusRequest {
332    #[prost(string, tag="1")]
333    pub etf: ::prost::alloc::string::String,
334    #[prost(string, tag="2")]
335    pub fund: ::prost::alloc::string::String,
336}
337/// StreamEtfLpStatus
338#[allow(clippy::derive_partial_eq_without_eq)]
339#[derive(Clone, PartialEq, ::prost::Message)]
340pub struct StreamEtfLpStatusUpdateRequest {
341    #[prost(string, tag="1")]
342    pub etf: ::prost::alloc::string::String,
343    #[prost(string, tag="2")]
344    pub fund: ::prost::alloc::string::String,
345}
346/// ETF LP 시작 요청
347#[allow(clippy::derive_partial_eq_without_eq)]
348#[derive(Clone, PartialEq, ::prost::Message)]
349pub struct StartEtfLpRequest {
350    #[prost(string, tag="1")]
351    pub etf: ::prost::alloc::string::String,
352    #[prost(string, tag="2")]
353    pub fund: ::prost::alloc::string::String,
354}
355/// ETF LP 시작 응답
356#[allow(clippy::derive_partial_eq_without_eq)]
357#[derive(Clone, PartialEq, ::prost::Message)]
358pub struct StartEtfLpResponse {
359    /// LP 상태
360    #[prost(message, optional, tag="1")]
361    pub status: ::core::option::Option<EtfLpStatus>,
362    /// 메시지
363    #[prost(string, tag="2")]
364    pub message: ::prost::alloc::string::String,
365}
366/// ETF LP 중지 요청
367#[allow(clippy::derive_partial_eq_without_eq)]
368#[derive(Clone, PartialEq, ::prost::Message)]
369pub struct StopEtfLpRequest {
370    #[prost(string, tag="1")]
371    pub etf: ::prost::alloc::string::String,
372    #[prost(string, tag="2")]
373    pub fund: ::prost::alloc::string::String,
374}
375/// ETF LP 중지 응답
376#[allow(clippy::derive_partial_eq_without_eq)]
377#[derive(Clone, PartialEq, ::prost::Message)]
378pub struct StopEtfLpResponse {
379    /// LP 상태
380    #[prost(message, optional, tag="1")]
381    pub status: ::core::option::Option<EtfLpStatus>,
382    /// 메시지
383    #[prost(string, tag="2")]
384    pub message: ::prost::alloc::string::String,
385}
386/// StreamEtfErrors 요청
387#[allow(clippy::derive_partial_eq_without_eq)]
388#[derive(Clone, PartialEq, ::prost::Message)]
389pub struct StreamLpEventsRequest {
390    #[prost(string, tag="1")]
391    pub etf: ::prost::alloc::string::String,
392    #[prost(string, tag="2")]
393    pub fund: ::prost::alloc::string::String,
394}
395/// 주문 업데이트 스트리밍 요청
396#[allow(clippy::derive_partial_eq_without_eq)]
397#[derive(Clone, PartialEq, ::prost::Message)]
398pub struct GetUserOrderBookRequest {
399    #[prost(string, tag="1")]
400    pub etf: ::prost::alloc::string::String,
401    #[prost(string, tag="2")]
402    pub fund: ::prost::alloc::string::String,
403}
404/// 주문 업데이트 정보
405#[allow(clippy::derive_partial_eq_without_eq)]
406#[derive(Clone, PartialEq, ::prost::Message)]
407pub struct UserOrderbookData {
408    /// 매수 호가 (10단계, AIP-144)
409    #[prost(string, repeated, tag="1")]
410    pub bid_prices: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
411    /// 매도 호가 (10단계)
412    #[prost(string, repeated, tag="2")]
413    pub ask_prices: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
414    /// 매수 수량 (10단계)
415    #[prost(int64, repeated, tag="3")]
416    pub bid_quantities: ::prost::alloc::vec::Vec<i64>,
417    /// 매도 수량 (10단계)
418    #[prost(int64, repeated, tag="4")]
419    pub ask_quantities: ::prost::alloc::vec::Vec<i64>,
420}
421/// 순매매량 기반 조정 전략
422#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
423#[repr(i32)]
424pub enum PositionAdjustmentStrategy {
425    Unspecified = 0,
426    /// 회피: 순매수 과다 시 매수offset 증가 (덜 공격적으로 매수)
427    Avoidance = 1,
428    /// 매매회전: 순매수 과다 시 매도offset 감소 (더 공격적으로 매도)
429    Turnover = 2,
430    /// 모두 적용: 순매수 과다 시 매수offset 증가 및 매도offset 감소
431    All = 10,
432}
433impl PositionAdjustmentStrategy {
434    /// String value of the enum field names used in the ProtoBuf definition.
435    ///
436    /// The values are not transformed in any way and thus are considered stable
437    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
438    pub fn as_str_name(&self) -> &'static str {
439        match self {
440            PositionAdjustmentStrategy::Unspecified => "POSITION_ADJUSTMENT_STRATEGY_UNSPECIFIED",
441            PositionAdjustmentStrategy::Avoidance => "POSITION_ADJUSTMENT_STRATEGY_AVOIDANCE",
442            PositionAdjustmentStrategy::Turnover => "POSITION_ADJUSTMENT_STRATEGY_TURNOVER",
443            PositionAdjustmentStrategy::All => "POSITION_ADJUSTMENT_STRATEGY_ALL",
444        }
445    }
446    /// Creates an enum from field names used in the ProtoBuf definition.
447    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
448        match value {
449            "POSITION_ADJUSTMENT_STRATEGY_UNSPECIFIED" => Some(Self::Unspecified),
450            "POSITION_ADJUSTMENT_STRATEGY_AVOIDANCE" => Some(Self::Avoidance),
451            "POSITION_ADJUSTMENT_STRATEGY_TURNOVER" => Some(Self::Turnover),
452            "POSITION_ADJUSTMENT_STRATEGY_ALL" => Some(Self::All),
453            _ => None,
454        }
455    }
456}
457/// ETF LP 상태 enum
458#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
459#[repr(i32)]
460pub enum EtfLpState {
461    Unspecified = 0,
462    Idle = 1,
463    Running = 2,
464    Stopping = 3,
465    Error = 4,
466}
467impl EtfLpState {
468    /// String value of the enum field names used in the ProtoBuf definition.
469    ///
470    /// The values are not transformed in any way and thus are considered stable
471    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
472    pub fn as_str_name(&self) -> &'static str {
473        match self {
474            EtfLpState::Unspecified => "ETF_LP_STATE_UNSPECIFIED",
475            EtfLpState::Idle => "ETF_LP_STATE_IDLE",
476            EtfLpState::Running => "ETF_LP_STATE_RUNNING",
477            EtfLpState::Stopping => "ETF_LP_STATE_STOPPING",
478            EtfLpState::Error => "ETF_LP_STATE_ERROR",
479        }
480    }
481    /// Creates an enum from field names used in the ProtoBuf definition.
482    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
483        match value {
484            "ETF_LP_STATE_UNSPECIFIED" => Some(Self::Unspecified),
485            "ETF_LP_STATE_IDLE" => Some(Self::Idle),
486            "ETF_LP_STATE_RUNNING" => Some(Self::Running),
487            "ETF_LP_STATE_STOPPING" => Some(Self::Stopping),
488            "ETF_LP_STATE_ERROR" => Some(Self::Error),
489            _ => None,
490        }
491    }
492}
493include!("kdo.v1.lp.tonic.rs");
494include!("kdo.v1.lp.serde.rs");
495// @@protoc_insertion_point(module)