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
// @generated
// This file is @generated by prost-build.
/// 주문 로그
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrderLog {
    /// 로그 고유 ID (DB에서 자동 생성)
    #[prost(int64, tag="1")]
    pub id: i64,
    /// 주문 ID (거래소에서 받은 ID)
    #[prost(uint64, tag="2")]
    pub order_id: u64,
    /// 원본 주문 ID (수정/취소의 경우)
    /// Option<u64>는 optional uint64로 매핑
    #[prost(uint64, optional, tag="3")]
    pub original_order_id: ::core::option::Option<u64>,
    /// 펀드 코드
    #[prost(string, tag="4")]
    pub fund_code: ::prost::alloc::string::String,
    /// 심볼
    #[prost(string, tag="5")]
    pub symbol: ::prost::alloc::string::String,
    /// 로그 타입
    #[prost(enumeration="OrderLogType", tag="6")]
    pub log_type: i32,
    /// 주문 방향 (매수/매도)
    #[prost(enumeration="super::common::OrderSide", tag="7")]
    pub side: i32,
    /// 주문 타입 (신규/정정/취소)
    #[prost(enumeration="OrderType", tag="8")]
    pub order_type: i32,
    /// 주문 가격 (Price)
    /// 정확도 유지를 위해 string 또는 고정 소수점(fixed64 등)을 사용할 수 있으나,
    /// 여기서는 간단하게 string으로 가정
    #[prost(string, tag="9")]
    pub price: ::prost::alloc::string::String,
    /// 주문 수량 (Quantity)
    /// 정확도 유지를 위해 string 또는 고정 소수점(fixed64 등)을 사용할 수 있으나,
    /// 여기서는 간단하게 string으로 가정
    #[prost(string, tag="10")]
    pub quantity: ::prost::alloc::string::String,
    /// 체결 가격 (Filled 로그의 경우) (FilledPrice)
    #[prost(string, optional, tag="11")]
    pub filled_price: ::core::option::Option<::prost::alloc::string::String>,
    /// 체결 수량 (Filled 로그의 경우) (FilledQuantity)
    #[prost(string, optional, tag="12")]
    pub filled_quantity: ::core::option::Option<::prost::alloc::string::String>,
    /// 체결 금액 (계산값) (FilledAmount)
    #[prost(string, optional, tag="13")]
    pub filled_amount: ::core::option::Option<::prost::alloc::string::String>,
    /// 거부/취소 코드
    #[prost(string, optional, tag="14")]
    pub rejection_code: ::core::option::Option<::prost::alloc::string::String>,
    /// 에러 메시지 (MeritzRejected의 경우)
    #[prost(string, optional, tag="15")]
    pub error_message: ::core::option::Option<::prost::alloc::string::String>,
    /// 거래소 시각 (KST, HHMMSSuuuuuu)
    #[prost(uint64, tag="16")]
    pub exchange_time: u64,
    /// 이벤트 수신 시각 (시스템 시각, 마이크로초)
    /// Rust Timestamp 타입을 u64로 가정
    #[prost(uint64, tag="17")]
    pub receive_time: u64,
    /// DB 삽입 시각
    /// Rust의 DateTime<Utc> 타입을 Google의 Timestamp 메시지로 매핑
    #[prost(message, optional, tag="18")]
    pub created_at: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
    /// 시장 구분
    #[prost(enumeration="super::common::MarketType", tag="19")]
    pub market_type: i32,
    /// 거래일 (YYYYMMDD)
    #[prost(uint32, tag="20")]
    pub date: u32,
    /// 사용자 영역 (JSON: QuoteContext 또는 HedgeContext)
    #[prost(string, optional, tag="21")]
    pub user_area: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct OrderLogFillStatistics {
    /// 총 체결 건수
    #[prost(int64, tag="1")]
    pub total_fills: i64,
    /// 총 체결 수량
    #[prost(int64, tag="2")]
    pub total_quantity: i64,
    /// 총 체결 금액
    #[prost(int64, tag="3")]
    pub total_amount: i64,
    /// 매수 체결 건수
    #[prost(int64, tag="4")]
    pub buy_count: i64,
    /// 매도 체결 건수
    #[prost(int64, tag="5")]
    pub sell_count: i64,
}
// ========== Request/Response Messages ==========

/// ListOrderLogs 요청
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListOrderLogsRequest {
    /// 페이지 크기 (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>,
    /// Available Sequence and Operator
    /// * fund_code
    ///    * `equal`, `contains`
    /// * symbol
    ///    * `equal`, `contains
    /// * log_type
    ///    * `equal`
    /// * side
    ///    * `equal`
    /// * order_type
    ///    * `equal`
    ///
    /// Examples
    /// * filter=fund_code="0159"
    /// * filter=symbol:"7526"
    /// * filter=log_type=FILLED
    /// * filter=side=BUY
    /// * filter=order_type=AMEND
    /// * filter=market_type=KOSPI
    #[prost(string, tag="3")]
    pub filter: ::prost::alloc::string::String,
    /// 오더링 조건. (optional, AIP-132)
    ///
    /// Supported Fields
    /// * "order_id", "exchange_time", "receive_time", "date"
    ///
    /// Examples
    /// * order_by=order_id desc
    #[prost(string, tag="4")]
    pub order_by: ::prost::alloc::string::String,
}
/// ListOrderLogs 응답
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListOrderLogsResponse {
    /// 펀드 목록
    #[prost(message, repeated, tag="1")]
    pub order_logs: ::prost::alloc::vec::Vec<OrderLog>,
    /// 다음 페이지 토큰
    #[prost(string, tag="2")]
    pub next_page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetOrderLogStatisticsRequest {
    /// AIP 스타일 문자열 필터. GetOrderLogStatistics 및 StreamOrderLogStatistics 공용.
    ///
    /// Available Fields and Operators
    /// * fund_code
    ///    * `equal`, `contains`
    /// * symbol
    ///    * `equal`, `contains`
    /// * exchange_time
    ///    * 날짜/시각 범위 필터. ISO 8601 (RFC3339) 값, 연산자 `>`, `>=`, `<`, `<=` 지원.
    ///    * 미지정(날짜 범위 생략) 시 서버가 당일(KST 00:00~)로 자동 필터한다.
    ///
    /// Examples
    /// * filter=fund_code="0159"
    /// * filter=symbol:"7526"
    /// * filter=exchange_time>="2026-06-02T00:00:00Z" AND exchange_time<"2026-06-03T00:00:00Z"
    /// * filter=fund_code="0159" AND exchange_time>="2026-06-02T00:00:00Z" AND exchange_time<"2026-06-03T00:00:00Z"
    #[prost(string, tag="1")]
    pub filter: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GetOrderChainRequest {
    #[prost(uint64, tag="1")]
    pub order_id: u64,
    /// YYYYMMDD, 미지정 시 오늘 날짜
    #[prost(uint32, optional, tag="2")]
    pub date: ::core::option::Option<u32>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetOrderChainResponse {
    #[prost(message, repeated, tag="1")]
    pub order_logs: ::prost::alloc::vec::Vec<OrderLog>,
}
/// GetHedgePairDetail 요청
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GetHedgePairDetailRequest {
    /// 주문 ID (hedge 또는 quote order)
    #[prost(uint64, tag="1")]
    pub order_id: u64,
    /// 날짜 (YYYYMMDD, optional - 미지정 시 당일)
    #[prost(uint32, optional, tag="2")]
    pub date: ::core::option::Option<u32>,
}
/// StreamHedgePairDetail 요청
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamHedgePairDetailRequest {
    /// 감시할 ETF 심볼
    #[prost(string, tag="1")]
    pub symbol: ::prost::alloc::string::String,
    /// 펀드 필터
    #[prost(string, optional, tag="2")]
    pub fund_code: ::core::option::Option<::prost::alloc::string::String>,
    /// 선물 LP 헷지 ETF 필터
    #[prost(string, optional, tag="3")]
    pub hedge_symbol: ::core::option::Option<::prost::alloc::string::String>,
    /// Quote 방향 필터 (optional - 미지정 시 양방향 모두)
    #[prost(enumeration="super::common::OrderSide", optional, tag="4")]
    pub quote_side: ::core::option::Option<i32>,
    /// 재연결 시 끊긴 시점 이후만 받고 싶을 때 (마이크로초)
    #[prost(uint64, optional, tag="5")]
    pub since_hedge_exchange_time_us: ::core::option::Option<u64>,
}
/// 헷지 쌍 상세 정보
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HedgePairDetail {
    /// Quote(원주문) 주문 ID
    #[prost(uint64, tag="1")]
    pub quote_order_id: u64,
    /// ETF 심볼
    #[prost(string, tag="2")]
    pub quote_symbol: ::prost::alloc::string::String,
    /// ETF 방향 (매수/매도)
    #[prost(enumeration="super::common::OrderSide", tag="3")]
    pub quote_side: i32,
    /// ETF 체결 수량
    #[prost(int64, tag="4")]
    pub quote_filled_quantity: i64,
    /// ETF 평균 체결 가격
    #[prost(double, tag="5")]
    pub quote_avg_price: f64,
    /// Hedge 심볼 (선물)
    #[prost(string, tag="6")]
    pub hedge_symbol: ::prost::alloc::string::String,
    /// Hedge 체결 수량
    #[prost(int64, tag="7")]
    pub hedge_filled_quantity: i64,
    /// Hedge 평균 체결 가격
    #[prost(double, tag="8")]
    pub hedge_avg_price: f64,
    /// 스프레드 (선물가격 * 100 - ETF가격)
    #[prost(double, tag="9")]
    pub spread: f64,
    /// 펀드 코드
    #[prost(string, tag="10")]
    pub fund_code: ::prost::alloc::string::String,
    /// 날짜 (YYYYMMDD)
    #[prost(uint32, tag="11")]
    pub date: u32,
    /// 마지막 Hedge 거래소 시각 (마이크로초)
    #[prost(uint64, tag="12")]
    pub hedge_exchange_time: u64,
}
/// 한쪽 방향(매수 또는 매도)의 체결 집계
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SideFillSummary {
    /// 체결 건수
    #[prost(uint64, tag="1")]
    pub fill_count: u64,
    /// 누적 체결 수량
    #[prost(int64, tag="2")]
    pub filled_quantity: i64,
    /// 평균 체결 가격 (금액/수량)
    #[prost(double, tag="3")]
    pub avg_price: f64,
    /// 체결 금액 합 (filled_price*filled_quantity 합)
    #[prost(double, tag="4")]
    pub amount: f64,
    /// 마지막 체결 거래소 시각 (마이크로초)
    #[prost(uint64, tag="5")]
    pub last_exchange_time: u64,
}
/// 한 다리(원주문 또는 헷지)의 fund+symbol 단위 집계
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LegFillSummary {
    #[prost(string, tag="1")]
    pub fund_code: ::prost::alloc::string::String,
    #[prost(string, tag="2")]
    pub symbol: ::prost::alloc::string::String,
    /// 매수 집계
    #[prost(message, optional, tag="3")]
    pub bid: ::core::option::Option<SideFillSummary>,
    /// 매도 집계
    #[prost(message, optional, tag="4")]
    pub ask: ::core::option::Option<SideFillSummary>,
}
/// 원주문/헷지 두 다리를 페어로 묶은 스냅샷 (stream 의 각 틱마다 emit)
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PairFillSummary {
    /// 원주문 다리 (ETF)
    #[prost(message, optional, tag="1")]
    pub quote: ::core::option::Option<LegFillSummary>,
    /// 헷지 다리 (선물)
    #[prost(message, optional, tag="2")]
    pub hedge: ::core::option::Option<LegFillSummary>,
    /// YYYYMMDD
    #[prost(uint32, tag="3")]
    pub date: u32,
}
/// StreamPairFillSummary 요청
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamPairFillSummaryRequest {
    /// 원주문 펀드 코드
    #[prost(string, tag="1")]
    pub quote_fund_code: ::prost::alloc::string::String,
    /// 원주문 심볼 (ETF)
    #[prost(string, tag="2")]
    pub quote_symbol: ::prost::alloc::string::String,
    /// 헷지 펀드 코드
    #[prost(string, tag="3")]
    pub hedge_fund_code: ::prost::alloc::string::String,
    /// 헷지 심볼 (선물)
    #[prost(string, tag="4")]
    pub hedge_symbol: ::prost::alloc::string::String,
    /// 날짜(YYYYMMDD). 미지정 시 서버가 당일로 처리
    #[prost(uint32, optional, tag="5")]
    pub date: ::core::option::Option<u32>,
}
/// ListHedgePairDetails 요청
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListHedgePairDetailsRequest {
    /// 감시할 ETF/quote 심볼 (필수)
    #[prost(string, tag="1")]
    pub symbol: ::prost::alloc::string::String,
    /// 펀드 필터
    #[prost(string, optional, tag="2")]
    pub fund_code: ::core::option::Option<::prost::alloc::string::String>,
    /// 선물 LP의 헷지 ETF 필터 (hedge_symbol 매칭)
    #[prost(string, optional, tag="3")]
    pub hedge_symbol: ::core::option::Option<::prost::alloc::string::String>,
    /// Quote 방향 필터
    #[prost(enumeration="super::common::OrderSide", optional, tag="4")]
    pub quote_side: ::core::option::Option<i32>,
    /// 날짜 필터 (YYYYMMDD). 당일만 조회할 때 사용
    #[prost(uint32, optional, tag="5")]
    pub date: ::core::option::Option<u32>,
    /// 이 시각 이후의 결과만 (resume용, 마이크로초)
    #[prost(uint64, optional, tag="6")]
    pub since_hedge_exchange_time_us: ::core::option::Option<u64>,
    /// 페이지 크기 (기본 200, 최대 1000)
    #[prost(int32, tag="7")]
    pub page_size: i32,
    /// 페이지 토큰
    #[prost(string, tag="8")]
    pub page_token: ::prost::alloc::string::String,
}
/// ListHedgePairDetails 응답
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListHedgePairDetailsResponse {
    #[prost(message, repeated, tag="1")]
    pub details: ::prost::alloc::vec::Vec<HedgePairDetail>,
    #[prost(string, tag="2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// 주문 로그 타입
///
/// Rust의 SCREAMING_SNAKE_CASE를 반영하여 정의
/// 주석은 Rust 코드의 내용을 번역했습니다.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OrderLogType {
    /// 알 수 없는 값 (기본값)
    Unspecified = 0,
    /// 접수 확인
    Received = 1,
    /// 거래소 거부
    Rejected = 2,
    /// 메리츠 내부 거부
    MeritzRejected = 3,
    /// 체결
    Filled = 4,
    /// 자동 취소
    AutoCancelled = 5,
}
impl OrderLogType {
    /// 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 {
            OrderLogType::Unspecified => "ORDER_LOG_TYPE_UNSPECIFIED",
            OrderLogType::Received => "RECEIVED",
            OrderLogType::Rejected => "REJECTED",
            OrderLogType::MeritzRejected => "MERITZ_REJECTED",
            OrderLogType::Filled => "FILLED",
            OrderLogType::AutoCancelled => "AUTO_CANCELLED",
        }
    }
    /// 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_LOG_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "RECEIVED" => Some(Self::Received),
            "REJECTED" => Some(Self::Rejected),
            "MERITZ_REJECTED" => Some(Self::MeritzRejected),
            "FILLED" => Some(Self::Filled),
            "AUTO_CANCELLED" => Some(Self::AutoCancelled),
            _ => None,
        }
    }
}
/// 주문 타입 (신규/정정/취소)
/// Rust 코드에는 정의되지 않았지만, OrderLog에 사용되므로 정의 가정
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OrderType {
    Unspecified = 0,
    /// 신규
    New = 1,
    /// 정정
    Amend = 2,
    /// 취소
    Cancel = 3,
}
impl OrderType {
    /// 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 {
            OrderType::Unspecified => "ORDER_TYPE_UNSPECIFIED",
            OrderType::New => "NEW",
            OrderType::Amend => "AMEND",
            OrderType::Cancel => "CANCEL",
        }
    }
    /// 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_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "NEW" => Some(Self::New),
            "AMEND" => Some(Self::Amend),
            "CANCEL" => Some(Self::Cancel),
            _ => None,
        }
    }
}
include!("kdo.v1.order_log.tonic.rs");
include!("kdo.v1.order_log.serde.rs");
// @@protoc_insertion_point(module)