monaco-grpc-sdk 1.0.3

Typed Rust gRPC client SDK for the Monaco Exchange API — generated from Protocol Buffer definitions
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
// @generated
// This file is @generated by prost-build.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct MarginAccountSummary {
    /// Parent margin account UUID.
    #[prost(string, tag="1")]
    pub margin_account_id: ::prost::alloc::string::String,
    #[prost(string, tag="2")]
    pub account_state: ::prost::alloc::string::String,
    #[prost(string, tag="3")]
    pub equity: ::prost::alloc::string::String,
    #[prost(string, tag="4")]
    pub initial_margin_required: ::prost::alloc::string::String,
    #[prost(string, tag="5")]
    pub maintenance_margin_required: ::prost::alloc::string::String,
    #[prost(string, tag="6")]
    pub free_collateral: ::prost::alloc::string::String,
    #[prost(string, tag="7")]
    pub withdrawable_collateral: ::prost::alloc::string::String,
    #[prost(string, tag="8")]
    pub total_position_notional: ::prost::alloc::string::String,
    #[prost(string, tag="9")]
    pub unrealized_pnl: ::prost::alloc::string::String,
    #[prost(string, tag="10")]
    pub realized_pnl: ::prost::alloc::string::String,
    #[prost(string, tag="11")]
    pub updated_at: ::prost::alloc::string::String,
    #[prost(string, optional, tag="12")]
    pub label: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag="13")]
    pub trading_pair_id: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag="14")]
    pub strategy_key: ::core::option::Option<::prost::alloc::string::String>,
    /// Present only for risk-bucket summary rows.
    #[prost(string, optional, tag="15")]
    pub risk_bucket_id: ::core::option::Option<::prost::alloc::string::String>,
    /// Present only for risk-bucket summary rows. Values: ISOLATED, CROSS.
    #[prost(string, optional, tag="16")]
    pub margin_mode: ::core::option::Option<::prost::alloc::string::String>,
    /// Present for cross risk-bucket summary rows.
    #[prost(string, repeated, tag="17")]
    pub selected_trading_pair_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetMarginAccountSummaryRequest {
    /// Margin account UUID for the current isolated bucket.
    #[prost(string, tag="1")]
    pub margin_account_id: ::prost::alloc::string::String,
    /// Optional trading pair UUID used when a parent margin account has multiple buckets.
    #[prost(string, optional, tag="2")]
    pub trading_pair_id: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetParentMarginAccountSummaryRequest {
    /// Optional trading pair UUID used when a parent margin account has multiple buckets.
    #[prost(string, optional, tag="1")]
    pub trading_pair_id: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetMarginAccountSummaryResponse {
    #[prost(string, tag="1")]
    pub margin_account_id: ::prost::alloc::string::String,
    #[prost(string, tag="2")]
    pub account_state: ::prost::alloc::string::String,
    #[prost(string, tag="3")]
    pub equity: ::prost::alloc::string::String,
    #[prost(string, tag="4")]
    pub initial_margin_required: ::prost::alloc::string::String,
    #[prost(string, tag="5")]
    pub maintenance_margin_required: ::prost::alloc::string::String,
    #[prost(string, tag="6")]
    pub free_collateral: ::prost::alloc::string::String,
    #[prost(string, tag="7")]
    pub withdrawable_collateral: ::prost::alloc::string::String,
    #[prost(string, tag="8")]
    pub total_position_notional: ::prost::alloc::string::String,
    #[prost(string, tag="9")]
    pub unrealized_pnl: ::prost::alloc::string::String,
    #[prost(string, tag="10")]
    pub realized_pnl: ::prost::alloc::string::String,
    #[prost(string, tag="11")]
    pub updated_at: ::prost::alloc::string::String,
    #[prost(string, optional, tag="12")]
    pub label: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag="13")]
    pub trading_pair_id: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag="14")]
    pub strategy_key: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag="15")]
    pub risk_bucket_id: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag="16")]
    pub margin_mode: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, repeated, tag="17")]
    pub selected_trading_pair_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListMarginAccountsRequest {
    #[prost(uint32, optional, tag="1")]
    pub page: ::core::option::Option<u32>,
    #[prost(uint32, optional, tag="2")]
    pub page_size: ::core::option::Option<u32>,
    #[prost(string, optional, tag="3")]
    pub state: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag="4")]
    pub trading_pair_id: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListMarginAccountsResponse {
    #[prost(message, repeated, tag="1")]
    pub accounts: ::prost::alloc::vec::Vec<MarginAccountSummary>,
    #[prost(uint32, tag="2")]
    pub total: u32,
    #[prost(uint32, tag="3")]
    pub page: u32,
    #[prost(uint32, tag="4")]
    pub page_size: u32,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetAvailableCollateralRequest {
    #[prost(string, optional, tag="1")]
    pub asset: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetAvailableCollateralResponse {
    #[prost(string, tag="1")]
    pub asset: ::prost::alloc::string::String,
    #[prost(string, tag="2")]
    pub wallet_available: ::prost::alloc::string::String,
    #[prost(string, tag="3")]
    pub wallet_locked: ::prost::alloc::string::String,
    #[prost(string, optional, tag="4")]
    pub margin_transferable: ::core::option::Option<::prost::alloc::string::String>,
    /// Free collateral currently held in the user's parent margin account for this
    /// asset (equity minus initial margin required), i.e. collateral already inside
    /// margin and available to open new positions or transfer back out. Absent when
    /// the user has no margin account yet.
    #[prost(string, optional, tag="5")]
    pub margin_available_collateral: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TransferCollateralToMarginAccountRequest {
    /// Parent margin account UUID that receives collateral.
    #[prost(string, tag="1")]
    pub margin_account_id: ::prost::alloc::string::String,
    #[prost(string, tag="2")]
    pub asset: ::prost::alloc::string::String,
    #[prost(string, tag="3")]
    pub amount: ::prost::alloc::string::String,
    /// Optional trading pair UUID used to allocate collateral to an isolated risk
    /// bucket under the parent margin account. If omitted, the transfer applies to
    /// the parent margin account only.
    #[prost(string, optional, tag="4")]
    pub trading_pair_id: ::core::option::Option<::prost::alloc::string::String>,
    /// Optional strategy key echoed in responses when callers scope a risk bucket.
    #[prost(string, optional, tag="5")]
    pub strategy_key: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TransferCollateralToMarginAccountResponse {
    #[prost(string, tag="1")]
    pub movement_id: ::prost::alloc::string::String,
    #[prost(string, tag="2")]
    pub margin_account_id: ::prost::alloc::string::String,
    #[prost(string, tag="3")]
    pub asset: ::prost::alloc::string::String,
    #[prost(string, tag="4")]
    pub amount: ::prost::alloc::string::String,
    #[prost(string, tag="5")]
    pub status: ::prost::alloc::string::String,
    #[prost(string, tag="6")]
    pub new_equity: ::prost::alloc::string::String,
    #[prost(string, tag="7")]
    pub new_total_collateral_value: ::prost::alloc::string::String,
    #[prost(string, tag="8")]
    pub new_withdrawable_collateral: ::prost::alloc::string::String,
    #[prost(string, optional, tag="9")]
    pub strategy_key: ::core::option::Option<::prost::alloc::string::String>,
    /// Present when collateral was allocated to a risk bucket.
    #[prost(string, optional, tag="10")]
    pub risk_bucket_id: ::core::option::Option<::prost::alloc::string::String>,
    /// Present when collateral was allocated to a risk bucket. Values: ISOLATED, CROSS.
    #[prost(string, optional, tag="11")]
    pub margin_mode: ::core::option::Option<::prost::alloc::string::String>,
    /// Present for cross risk-bucket transfers.
    #[prost(string, repeated, tag="12")]
    pub selected_trading_pair_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TransferCollateralFromMarginAccountRequest {
    /// Parent margin account UUID that releases collateral.
    #[prost(string, tag="1")]
    pub margin_account_id: ::prost::alloc::string::String,
    #[prost(string, tag="2")]
    pub asset: ::prost::alloc::string::String,
    #[prost(string, tag="3")]
    pub amount: ::prost::alloc::string::String,
    /// Optional trading pair UUID used to release collateral from an isolated risk
    /// bucket under the parent margin account. If omitted, the transfer applies to
    /// the parent margin account only.
    #[prost(string, optional, tag="4")]
    pub trading_pair_id: ::core::option::Option<::prost::alloc::string::String>,
    /// Optional strategy key echoed in responses when callers scope a risk bucket.
    #[prost(string, optional, tag="5")]
    pub strategy_key: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TransferCollateralFromMarginAccountResponse {
    #[prost(string, tag="1")]
    pub movement_id: ::prost::alloc::string::String,
    #[prost(string, tag="2")]
    pub margin_account_id: ::prost::alloc::string::String,
    #[prost(string, tag="3")]
    pub asset: ::prost::alloc::string::String,
    #[prost(string, tag="4")]
    pub amount: ::prost::alloc::string::String,
    #[prost(string, tag="5")]
    pub status: ::prost::alloc::string::String,
    #[prost(string, tag="6")]
    pub new_equity: ::prost::alloc::string::String,
    #[prost(string, tag="7")]
    pub new_total_collateral_value: ::prost::alloc::string::String,
    #[prost(string, tag="8")]
    pub new_withdrawable_collateral: ::prost::alloc::string::String,
    #[prost(string, optional, tag="9")]
    pub strategy_key: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct MarginAccountMovement {
    #[prost(string, tag="1")]
    pub id: ::prost::alloc::string::String,
    #[prost(string, tag="2")]
    pub movement_type: ::prost::alloc::string::String,
    #[prost(string, tag="3")]
    pub asset: ::prost::alloc::string::String,
    #[prost(string, tag="4")]
    pub amount: ::prost::alloc::string::String,
    #[prost(string, tag="5")]
    pub status: ::prost::alloc::string::String,
    #[prost(string, tag="6")]
    pub created_at: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetMarginAccountMovementsRequest {
    /// Margin account UUID for the current isolated bucket.
    #[prost(string, tag="1")]
    pub margin_account_id: ::prost::alloc::string::String,
    #[prost(string, optional, tag="2")]
    pub movement_type: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(uint32, optional, tag="3")]
    pub page: ::core::option::Option<u32>,
    #[prost(uint32, optional, tag="4")]
    pub page_size: ::core::option::Option<u32>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetParentMarginAccountMovementsRequest {
    #[prost(string, optional, tag="1")]
    pub movement_type: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(uint32, optional, tag="2")]
    pub page: ::core::option::Option<u32>,
    #[prost(uint32, optional, tag="3")]
    pub page_size: ::core::option::Option<u32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetMarginAccountMovementsResponse {
    #[prost(message, repeated, tag="1")]
    pub movements: ::prost::alloc::vec::Vec<MarginAccountMovement>,
    #[prost(uint32, tag="2")]
    pub total: u32,
    #[prost(uint32, tag="3")]
    pub page: u32,
    #[prost(uint32, tag="4")]
    pub page_size: u32,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SimulateOrderRiskRequest {
    /// Margin account UUID for the isolated bucket being simulated.
    #[prost(string, tag="1")]
    pub margin_account_id: ::prost::alloc::string::String,
    #[prost(string, tag="2")]
    pub trading_pair_id: ::prost::alloc::string::String,
    #[prost(string, tag="3")]
    pub side: ::prost::alloc::string::String,
    #[prost(string, tag="4")]
    pub position_side: ::prost::alloc::string::String,
    #[prost(string, tag="5")]
    pub order_type: ::prost::alloc::string::String,
    #[prost(string, optional, tag="6")]
    pub price: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, tag="7")]
    pub quantity: ::prost::alloc::string::String,
    #[prost(string, tag="8")]
    pub leverage: ::prost::alloc::string::String,
    #[prost(bool, optional, tag="9")]
    pub reduce_only: ::core::option::Option<bool>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SimulateParentMarginOrderRiskRequest {
    #[prost(string, tag="1")]
    pub trading_pair_id: ::prost::alloc::string::String,
    #[prost(string, tag="2")]
    pub side: ::prost::alloc::string::String,
    #[prost(string, tag="3")]
    pub position_side: ::prost::alloc::string::String,
    #[prost(string, tag="4")]
    pub order_type: ::prost::alloc::string::String,
    #[prost(string, optional, tag="5")]
    pub price: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, tag="6")]
    pub quantity: ::prost::alloc::string::String,
    #[prost(string, tag="7")]
    pub leverage: ::prost::alloc::string::String,
    #[prost(bool, optional, tag="8")]
    pub reduce_only: ::core::option::Option<bool>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SimulateOrderRiskResponse {
    #[prost(bool, tag="1")]
    pub accepted: bool,
    #[prost(string, optional, tag="2")]
    pub reject_reason: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, tag="3")]
    pub equity_after: ::prost::alloc::string::String,
    #[prost(string, tag="4")]
    pub initial_margin_required_after: ::prost::alloc::string::String,
    #[prost(string, tag="5")]
    pub maintenance_margin_required_after: ::prost::alloc::string::String,
    #[prost(string, tag="6")]
    pub free_collateral_after: ::prost::alloc::string::String,
    #[prost(string, optional, tag="7")]
    pub estimated_fee: ::core::option::Option<::prost::alloc::string::String>,
    /// Estimated liquidation mark-price. In ISOLATED mode, this is the
    /// position/risk-bucket threshold. In CROSS mode, it is conditional: it varies
    /// only the target position's mark while all other marks in the cross risk
    /// bucket remain unchanged. Other position marks, funding, realized PnL,
    /// fees/reserves, and collateral can change it. Treat an absent or blank value
    /// as unavailable, never as zero.
    #[prost(string, optional, tag="8")]
    pub estimated_liquidation_price: ::core::option::Option<::prost::alloc::string::String>,
    /// The margin account the simulation was resolved against. Always populated;
    /// useful for auto-resolved buckets where the caller didn't supply the id.
    #[prost(string, tag="9")]
    pub margin_account_id: ::prost::alloc::string::String,
    /// Populated when the simulated account is an auto-resolved bucket.
    #[prost(string, optional, tag="10")]
    pub strategy_key: ::core::option::Option<::prost::alloc::string::String>,
    /// Present when the simulation resolved against a risk bucket.
    #[prost(string, optional, tag="11")]
    pub risk_bucket_id: ::core::option::Option<::prost::alloc::string::String>,
    /// Present when the simulation resolved against a risk bucket. Values: ISOLATED, CROSS.
    #[prost(string, optional, tag="12")]
    pub margin_mode: ::core::option::Option<::prost::alloc::string::String>,
    /// Present for cross risk-bucket simulations.
    #[prost(string, repeated, tag="13")]
    pub selected_trading_pair_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TransferCollateralToParentMarginAccountRequest {
    #[prost(string, tag="1")]
    pub asset: ::prost::alloc::string::String,
    #[prost(string, tag="2")]
    pub amount: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TransferCollateralFromParentMarginAccountRequest {
    #[prost(string, tag="1")]
    pub asset: ::prost::alloc::string::String,
    #[prost(string, tag="2")]
    pub amount: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TransferCollateralToRiskBucketRequest {
    #[prost(string, tag="1")]
    pub asset: ::prost::alloc::string::String,
    #[prost(string, tag="2")]
    pub amount: ::prost::alloc::string::String,
    /// Trading pair UUID whose isolated risk bucket receives collateral.
    /// Required for isolated risk buckets; omitted for cross risk buckets.
    #[prost(string, optional, tag="3")]
    pub trading_pair_id: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag="4")]
    pub strategy_key: ::core::option::Option<::prost::alloc::string::String>,
    /// Risk bucket mode. Defaults to ISOLATED. Values: ISOLATED, CROSS.
    #[prost(string, optional, tag="5")]
    pub margin_mode: ::core::option::Option<::prost::alloc::string::String>,
    /// Trading pair UUIDs selected into the cross risk bucket. Required when marginMode is CROSS.
    #[prost(string, repeated, tag="6")]
    pub selected_trading_pair_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SimulateRiskBucketOrderRiskRequest {
    #[prost(string, tag="1")]
    pub trading_pair_id: ::prost::alloc::string::String,
    #[prost(string, optional, tag="2")]
    pub strategy_key: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, tag="3")]
    pub side: ::prost::alloc::string::String,
    #[prost(string, tag="4")]
    pub position_side: ::prost::alloc::string::String,
    #[prost(string, tag="5")]
    pub order_type: ::prost::alloc::string::String,
    #[prost(string, optional, tag="6")]
    pub price: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, tag="7")]
    pub quantity: ::prost::alloc::string::String,
    #[prost(string, tag="8")]
    pub leverage: ::prost::alloc::string::String,
    #[prost(bool, optional, tag="9")]
    pub reduce_only: ::core::option::Option<bool>,
    /// Risk bucket mode. Defaults to ISOLATED. Values: ISOLATED, CROSS.
    #[prost(string, optional, tag="10")]
    pub margin_mode: ::core::option::Option<::prost::alloc::string::String>,
    /// Trading pair UUIDs selected into the cross risk bucket. Required when marginMode is CROSS.
    #[prost(string, repeated, tag="11")]
    pub selected_trading_pair_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
include!("monaco.api.margin_accounts.tonic.rs");
// @@protoc_insertion_point(module)