deribit_http/model/request/trade.rs
1/******************************************************************************
2 Author: Joaquín Béjar García
3 Email: jb@taunais.com
4 Date: 15/9/25
5******************************************************************************/
6use crate::model::{Currency, InstrumentKind, SortDirection};
7use serde::{Deserialize, Serialize};
8
9/// Parameters for requesting user trades
10#[derive(Debug, Clone, Serialize, Deserialize)]
11pub struct TradesRequest {
12 /// The currency symbol (required)
13 pub currency: Currency,
14 /// Instrument kind filter (optional)
15 pub kind: Option<InstrumentKind>,
16 /// The ID of the first trade to be returned (optional)
17 pub start_id: Option<String>,
18 /// The ID of the last trade to be returned (optional)
19 pub end_id: Option<String>,
20 /// Number of requested items, default - 10, maximum - 1000 (optional)
21 pub count: Option<u32>,
22 /// The earliest timestamp to return result from (milliseconds since UNIX epoch) (optional)
23 pub start_timestamp: Option<u64>,
24 /// The most recent timestamp to return result from (milliseconds since UNIX epoch) (optional)
25 pub end_timestamp: Option<u64>,
26 /// Direction of results sorting (optional)
27 pub sorting: Option<SortDirection>,
28 /// Determines whether historical trade records should be retrieved (optional)
29 pub historical: Option<bool>,
30 /// The user id for the subaccount (optional)
31 pub subaccount_id: Option<u32>,
32}