ids_apis/
kdo.v1.market.rs

1// @generated
2// This file is @generated by prost-build.
3/// ETF 주문장 데이터
4#[allow(clippy::derive_partial_eq_without_eq)]
5#[derive(Clone, PartialEq, ::prost::Message)]
6pub struct EtfOrderbookData {
7    /// 매수 호가 (10단계, AIP-144)
8    #[prost(string, repeated, tag="1")]
9    pub bid_prices: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
10    /// 매도 호가 (10단계)
11    #[prost(string, repeated, tag="2")]
12    pub ask_prices: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
13    /// 매수 수량 (10단계)
14    #[prost(int64, repeated, tag="3")]
15    pub bid_quantities: ::prost::alloc::vec::Vec<i64>,
16    /// 매도 수량 (10단계)
17    #[prost(int64, repeated, tag="4")]
18    pub ask_quantities: ::prost::alloc::vec::Vec<i64>,
19    /// LP 매수 수량 (10단계)
20    #[prost(int64, repeated, tag="5")]
21    pub lp_bid_quantities: ::prost::alloc::vec::Vec<i64>,
22    /// LP 매도 수량 (10단계)
23    #[prost(int64, repeated, tag="6")]
24    pub lp_ask_quantities: ::prost::alloc::vec::Vec<i64>,
25    /// 중간 호가
26    #[prost(string, tag="7")]
27    pub mid_price: ::prost::alloc::string::String,
28    /// 중간 매도 수량
29    #[prost(int64, tag="8")]
30    pub mid_ask_quantity: i64,
31    /// 중간 매수 수량
32    #[prost(int64, tag="9")]
33    pub mid_bid_quantity: i64,
34    /// 총 매도 호가 수량
35    #[prost(int64, tag="10")]
36    pub ask_quote_total_quantity: i64,
37    /// 총 매수 호가 수량
38    #[prost(int64, tag="11")]
39    pub bid_quote_total_quantity: i64,
40    /// 예상 가격
41    #[prost(string, tag="12")]
42    pub est_price: ::prost::alloc::string::String,
43    /// 예상 거래량
44    #[prost(int64, tag="13")]
45    pub est_volume: i64,
46    /// 세션 ID
47    #[prost(enumeration="SessionId", tag="14")]
48    pub session_id: i32,
49}
50/// 선물 주문장 데이터
51#[allow(clippy::derive_partial_eq_without_eq)]
52#[derive(Clone, PartialEq, ::prost::Message)]
53pub struct FuturesOrderbookData {
54    /// 매수 호가 (5단계, AIP-144)
55    #[prost(string, repeated, tag="1")]
56    pub bid_prices: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
57    /// 매도 호가 (5단계)
58    #[prost(string, repeated, tag="2")]
59    pub ask_prices: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
60    /// 매수 수량 (5단계)
61    #[prost(int64, repeated, tag="3")]
62    pub bid_quantities: ::prost::alloc::vec::Vec<i64>,
63    /// 매도 수량 (5단계)
64    #[prost(int64, repeated, tag="4")]
65    pub ask_quantities: ::prost::alloc::vec::Vec<i64>,
66    /// 매수 주문 수 (5단계)
67    #[prost(int64, repeated, tag="5")]
68    pub bid_counts: ::prost::alloc::vec::Vec<i64>,
69    /// 매도 주문 수 (5단계)
70    #[prost(int64, repeated, tag="6")]
71    pub ask_counts: ::prost::alloc::vec::Vec<i64>,
72    /// 총 매도 호가 수량
73    #[prost(int64, tag="7")]
74    pub ask_quote_total_quantity: i64,
75    /// 총 매수 호가 수량
76    #[prost(int64, tag="8")]
77    pub bid_quote_total_quantity: i64,
78    /// 중간 가격
79    #[prost(string, tag="9")]
80    pub mid_price: ::prost::alloc::string::String,
81    /// 예상 가격
82    #[prost(string, tag="10")]
83    pub est_price: ::prost::alloc::string::String,
84    /// 예상 거래량
85    #[prost(int64, tag="11")]
86    pub est_volume: i64,
87    /// 세션 ID
88    #[prost(enumeration="SessionId", tag="12")]
89    pub session_id: i32,
90}
91/// 주문 정보
92#[allow(clippy::derive_partial_eq_without_eq)]
93#[derive(Clone, PartialEq, ::prost::Message)]
94pub struct Order {
95    /// 주문 ID
96    #[prost(string, tag="1")]
97    pub order_id: ::prost::alloc::string::String,
98    /// 주문 타입
99    #[prost(enumeration="OrderType", tag="2")]
100    pub order_type: i32,
101    /// 상품 (예: etfs/A069500)
102    #[prost(string, tag="3")]
103    pub symbol: ::prost::alloc::string::String,
104    /// 주문 가격
105    #[prost(string, tag="4")]
106    pub price: ::prost::alloc::string::String,
107    /// 주문 수량
108    #[prost(int64, tag="5")]
109    pub quantity: i64,
110    /// 체결 수량
111    #[prost(int64, tag="6")]
112    pub filled_quantity: i64,
113    /// 주문 상태
114    #[prost(enumeration="OrderStatus", tag="7")]
115    pub status: i32,
116    /// 주문 시간 (Unix timestamp)
117    #[prost(int64, tag="8")]
118    pub created_at: i64,
119    /// 업데이트 시간 (Unix timestamp)
120    #[prost(int64, tag="9")]
121    pub updated_at: i64,
122}
123#[allow(clippy::derive_partial_eq_without_eq)]
124#[derive(Clone, PartialEq, ::prost::Message)]
125pub struct EtfNav {
126    #[prost(string, tag="1")]
127    pub name: ::prost::alloc::string::String,
128    #[prost(string, tag="2")]
129    pub etf_symbol: ::prost::alloc::string::String,
130    /// 순자산가치 (원 단위, string)
131    #[prost(string, tag="10")]
132    pub theory_nav: ::prost::alloc::string::String,
133    /// 전일 대비 (string)
134    #[prost(string, tag="11")]
135    pub krx_nav: ::prost::alloc::string::String,
136}
137// ========== Request/Response Messages ==========
138
139/// ETF 주문장 스트리밍 요청
140#[allow(clippy::derive_partial_eq_without_eq)]
141#[derive(Clone, PartialEq, ::prost::Message)]
142pub struct StreamEtfOrderbookRequest {
143    #[prost(string, tag="1")]
144    pub etf: ::prost::alloc::string::String,
145}
146/// 선물 주문장 스트리밍 요청
147#[allow(clippy::derive_partial_eq_without_eq)]
148#[derive(Clone, PartialEq, ::prost::Message)]
149pub struct StreamFuturesOrderbookRequest {
150    /// 리소스 이름 (예: futures/K101W9000)
151    #[prost(string, tag="1")]
152    pub future: ::prost::alloc::string::String,
153}
154#[allow(clippy::derive_partial_eq_without_eq)]
155#[derive(Clone, PartialEq, ::prost::Message)]
156pub struct StreamEtfNavRequest {
157    #[prost(string, tag="1")]
158    pub etf: ::prost::alloc::string::String,
159}
160/// 주문 접수 요청
161#[allow(clippy::derive_partial_eq_without_eq)]
162#[derive(Clone, PartialEq, ::prost::Message)]
163pub struct PlaceOrderRequest {
164    /// 주문 타입
165    #[prost(enumeration="OrderType", tag="1")]
166    pub order_type: i32,
167    /// 상품 (예: etfs/A069500)
168    #[prost(string, tag="2")]
169    pub symbol: ::prost::alloc::string::String,
170    /// 주문 가격
171    #[prost(string, tag="3")]
172    pub price: ::prost::alloc::string::String,
173    /// 주문 수량
174    #[prost(int64, tag="4")]
175    pub quantity: i64,
176}
177/// 주문 접수 응답
178#[allow(clippy::derive_partial_eq_without_eq)]
179#[derive(Clone, PartialEq, ::prost::Message)]
180pub struct PlaceOrderResponse {
181    /// 생성된 주문 정보
182    #[prost(message, optional, tag="1")]
183    pub order: ::core::option::Option<Order>,
184}
185/// 주문 취소 요청
186#[allow(clippy::derive_partial_eq_without_eq)]
187#[derive(Clone, PartialEq, ::prost::Message)]
188pub struct CancelOrderRequest {
189    /// 취소할 주문 ID
190    #[prost(string, tag="1")]
191    pub order_id: ::prost::alloc::string::String,
192}
193/// 주문 취소 응답
194#[allow(clippy::derive_partial_eq_without_eq)]
195#[derive(Clone, PartialEq, ::prost::Message)]
196pub struct CancelOrderResponse {
197    /// 취소된 주문 정보
198    #[prost(message, optional, tag="1")]
199    pub order: ::core::option::Option<Order>,
200}
201/// 모든 주문 취소 요청
202#[allow(clippy::derive_partial_eq_without_eq)]
203#[derive(Clone, PartialEq, ::prost::Message)]
204pub struct CancelAllOrdersRequest {
205    /// 선택적: 특정 상품의 주문만 취소
206    #[prost(string, tag="1")]
207    pub symbol: ::prost::alloc::string::String,
208}
209/// 모든 주문 취소 응답
210#[allow(clippy::derive_partial_eq_without_eq)]
211#[derive(Clone, PartialEq, ::prost::Message)]
212pub struct CancelAllOrdersResponse {
213    /// 취소된 주문 수
214    #[prost(int32, tag="1")]
215    pub cancelled_count: i32,
216    /// 취소된 주문 목록
217    #[prost(message, repeated, tag="2")]
218    pub cancelled_orders: ::prost::alloc::vec::Vec<Order>,
219}
220/// 주문 목록 조회 요청
221#[allow(clippy::derive_partial_eq_without_eq)]
222#[derive(Clone, PartialEq, ::prost::Message)]
223pub struct ListOrdersRequest {
224    /// 필터링 조건 (선택적, AIP-160)
225    #[prost(string, tag="1")]
226    pub filter: ::prost::alloc::string::String,
227    /// 페이징 (AIP-158)
228    #[prost(int32, tag="2")]
229    pub page_size: i32,
230    #[prost(string, tag="3")]
231    pub page_token: ::prost::alloc::string::String,
232}
233/// 주문 목록 조회 응답
234#[allow(clippy::derive_partial_eq_without_eq)]
235#[derive(Clone, PartialEq, ::prost::Message)]
236pub struct ListOrdersResponse {
237    /// 주문 목록
238    #[prost(message, repeated, tag="1")]
239    pub orders: ::prost::alloc::vec::Vec<Order>,
240    /// 다음 페이지 토큰 (AIP-158)
241    #[prost(string, tag="2")]
242    pub next_page_token: ::prost::alloc::string::String,
243}
244/// 주문 업데이트 스트리밍 요청
245#[allow(clippy::derive_partial_eq_without_eq)]
246#[derive(Clone, PartialEq, ::prost::Message)]
247pub struct GetUserOrderBookRequest {
248    #[prost(string, tag="1")]
249    pub etf: ::prost::alloc::string::String,
250    #[prost(string, tag="2")]
251    pub fund: ::prost::alloc::string::String,
252}
253/// 주문 업데이트 정보
254#[allow(clippy::derive_partial_eq_without_eq)]
255#[derive(Clone, PartialEq, ::prost::Message)]
256pub struct UserOrderbookData {
257    /// 매수 호가 (10단계, AIP-144)
258    #[prost(string, repeated, tag="1")]
259    pub bid_prices: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
260    /// 매도 호가 (10단계)
261    #[prost(string, repeated, tag="2")]
262    pub ask_prices: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
263    /// 매수 수량 (10단계)
264    #[prost(int64, repeated, tag="3")]
265    pub bid_quantities: ::prost::alloc::vec::Vec<i64>,
266    /// 매도 수량 (10단계)
267    #[prost(int64, repeated, tag="4")]
268    pub ask_quantities: ::prost::alloc::vec::Vec<i64>,
269}
270/// Request to add a new raw UDP socket
271#[allow(clippy::derive_partial_eq_without_eq)]
272#[derive(Clone, PartialEq, ::prost::Message)]
273pub struct AddRawMessagesSocketRequest {
274    /// Multicast address to listen on (e.g., "239.1.1.1")
275    #[prost(string, tag="1")]
276    pub multicast_address: ::prost::alloc::string::String,
277    /// Interface address to bind (e.g., "192.168.1.100")
278    #[prost(string, tag="2")]
279    pub multicast_interface: ::prost::alloc::string::String,
280    /// UDP port to listen on
281    #[prost(uint32, tag="3")]
282    pub port: u32,
283    /// Buffer size for receiving UDP packets (default: 2048)
284    #[prost(uint32, tag="4")]
285    pub buffer_size: u32,
286}
287/// Response from adding a raw socket
288#[allow(clippy::derive_partial_eq_without_eq)]
289#[derive(Clone, PartialEq, ::prost::Message)]
290pub struct AddRawMessagesSocketResponse {
291    /// Whether the socket was added successfully
292    #[prost(bool, tag="1")]
293    pub success: bool,
294    /// Error message if success is false
295    #[prost(string, tag="2")]
296    pub error_message: ::prost::alloc::string::String,
297}
298/// Request to stream raw market messages
299#[allow(clippy::derive_partial_eq_without_eq)]
300#[derive(Clone, PartialEq, ::prost::Message)]
301pub struct StreamRawMessagesRequest {
302    /// Optional filter by socket IDs (empty = all sockets)
303    #[prost(string, repeated, tag="1")]
304    pub socket_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
305    /// Optional buffer size for the stream (default: 100)
306    #[prost(uint32, tag="2")]
307    pub buffer_size: u32,
308}
309/// Raw market message received from UDP socket
310#[allow(clippy::derive_partial_eq_without_eq)]
311#[derive(Clone, PartialEq, ::prost::Message)]
312pub struct RawMarketMessage {
313    /// Raw binary data received from the socket
314    #[prost(bytes="vec", tag="1")]
315    pub data: ::prost::alloc::vec::Vec<u8>,
316    /// Timestamp when the message was received (nanoseconds since epoch)
317    #[prost(int64, tag="2")]
318    pub receive_timestamp_ns: i64,
319    /// Message sequence number (per socket)
320    #[prost(uint64, tag="3")]
321    pub sequence_number: u64,
322}
323/// 세션 ID 열거형 (AIP-126)
324#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
325#[repr(i32)]
326pub enum SessionId {
327    /// 기본값
328    Unspecified = 0,
329    /// 장개시전
330    Previous = 1,
331    /// 연결됨
332    Connected = 2,
333    /// 시가단일가
334    OpeningOnePrice = 3,
335    /// 단일가
336    OnePrice = 4,
337    /// 종가단일가
338    ClosingOnePrice = 5,
339    /// VI장중단일가
340    ViOnePrice = 6,
341    /// VI시가단일가
342    ViOpeningOnePrice = 7,
343    /// VI종가단일가
344    ViClosingOnePrice = 8,
345    /// 단위매매
346    UnitTrade = 9,
347    /// 장종료후호가접수
348    PostMarket = 10,
349    /// 경매매수호가 접수 세션
350    AuctionBid = 11,
351    /// 경매매도호가 접수 세션
352    AuctionAsk = 12,
353    /// 거래정지
354    Suspended = 13,
355    /// 셧다운
356    Shutdown = 14,
357    /// 장마감
358    Closed = 15,
359    /// 기타
360    Etc = 16,
361}
362impl SessionId {
363    /// String value of the enum field names used in the ProtoBuf definition.
364    ///
365    /// The values are not transformed in any way and thus are considered stable
366    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
367    pub fn as_str_name(&self) -> &'static str {
368        match self {
369            SessionId::Unspecified => "SESSION_ID_UNSPECIFIED",
370            SessionId::Previous => "PREVIOUS",
371            SessionId::Connected => "CONNECTED",
372            SessionId::OpeningOnePrice => "OPENING_ONE_PRICE",
373            SessionId::OnePrice => "ONE_PRICE",
374            SessionId::ClosingOnePrice => "CLOSING_ONE_PRICE",
375            SessionId::ViOnePrice => "VI_ONE_PRICE",
376            SessionId::ViOpeningOnePrice => "VI_OPENING_ONE_PRICE",
377            SessionId::ViClosingOnePrice => "VI_CLOSING_ONE_PRICE",
378            SessionId::UnitTrade => "UNIT_TRADE",
379            SessionId::PostMarket => "POST_MARKET",
380            SessionId::AuctionBid => "AUCTION_BID",
381            SessionId::AuctionAsk => "AUCTION_ASK",
382            SessionId::Suspended => "SUSPENDED",
383            SessionId::Shutdown => "SHUTDOWN",
384            SessionId::Closed => "CLOSED",
385            SessionId::Etc => "ETC",
386        }
387    }
388    /// Creates an enum from field names used in the ProtoBuf definition.
389    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
390        match value {
391            "SESSION_ID_UNSPECIFIED" => Some(Self::Unspecified),
392            "PREVIOUS" => Some(Self::Previous),
393            "CONNECTED" => Some(Self::Connected),
394            "OPENING_ONE_PRICE" => Some(Self::OpeningOnePrice),
395            "ONE_PRICE" => Some(Self::OnePrice),
396            "CLOSING_ONE_PRICE" => Some(Self::ClosingOnePrice),
397            "VI_ONE_PRICE" => Some(Self::ViOnePrice),
398            "VI_OPENING_ONE_PRICE" => Some(Self::ViOpeningOnePrice),
399            "VI_CLOSING_ONE_PRICE" => Some(Self::ViClosingOnePrice),
400            "UNIT_TRADE" => Some(Self::UnitTrade),
401            "POST_MARKET" => Some(Self::PostMarket),
402            "AUCTION_BID" => Some(Self::AuctionBid),
403            "AUCTION_ASK" => Some(Self::AuctionAsk),
404            "SUSPENDED" => Some(Self::Suspended),
405            "SHUTDOWN" => Some(Self::Shutdown),
406            "CLOSED" => Some(Self::Closed),
407            "ETC" => Some(Self::Etc),
408            _ => None,
409        }
410    }
411}
412/// 주문 타입 열거형
413#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
414#[repr(i32)]
415pub enum OrderType {
416    /// 기본값
417    Unspecified = 0,
418    /// 매수
419    Buy = 1,
420    /// 매도
421    Sell = 2,
422}
423impl OrderType {
424    /// String value of the enum field names used in the ProtoBuf definition.
425    ///
426    /// The values are not transformed in any way and thus are considered stable
427    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
428    pub fn as_str_name(&self) -> &'static str {
429        match self {
430            OrderType::Unspecified => "ORDER_TYPE_UNSPECIFIED",
431            OrderType::Buy => "BUY",
432            OrderType::Sell => "SELL",
433        }
434    }
435    /// Creates an enum from field names used in the ProtoBuf definition.
436    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
437        match value {
438            "ORDER_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
439            "BUY" => Some(Self::Buy),
440            "SELL" => Some(Self::Sell),
441            _ => None,
442        }
443    }
444}
445/// 주문 상태 열거형
446#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
447#[repr(i32)]
448pub enum OrderStatus {
449    /// 기본값
450    Unspecified = 0,
451    /// 대기중
452    Pending = 1,
453    /// 부분체결
454    PartialFilled = 2,
455    /// 체결완료
456    Filled = 3,
457    /// 취소됨
458    Cancelled = 4,
459    /// 거부됨
460    Rejected = 5,
461}
462impl OrderStatus {
463    /// String value of the enum field names used in the ProtoBuf definition.
464    ///
465    /// The values are not transformed in any way and thus are considered stable
466    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
467    pub fn as_str_name(&self) -> &'static str {
468        match self {
469            OrderStatus::Unspecified => "ORDER_STATUS_UNSPECIFIED",
470            OrderStatus::Pending => "PENDING",
471            OrderStatus::PartialFilled => "PARTIAL_FILLED",
472            OrderStatus::Filled => "FILLED",
473            OrderStatus::Cancelled => "CANCELLED",
474            OrderStatus::Rejected => "REJECTED",
475        }
476    }
477    /// Creates an enum from field names used in the ProtoBuf definition.
478    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
479        match value {
480            "ORDER_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
481            "PENDING" => Some(Self::Pending),
482            "PARTIAL_FILLED" => Some(Self::PartialFilled),
483            "FILLED" => Some(Self::Filled),
484            "CANCELLED" => Some(Self::Cancelled),
485            "REJECTED" => Some(Self::Rejected),
486            _ => None,
487        }
488    }
489}
490include!("kdo.v1.market.tonic.rs");
491include!("kdo.v1.market.serde.rs");
492// @@protoc_insertion_point(module)