bybit/models/move_history_entry.rs
1use crate::prelude::*;
2
3/// Represents a single position move history record.
4///
5/// Details a specific position transfer between accounts, including trade parameters and status. Bots use this to audit individual transfers and diagnose issues.
6#[derive(Serialize, Deserialize, Clone, Debug)]
7#[serde(rename_all = "camelCase")]
8pub struct MoveHistoryEntry {
9 /// The block trade ID for the transfer.
10 ///
11 /// A unique identifier for the position move, treated as a block trade. Bots use this to track specific transfer events.
12 pub block_trade_id: String,
13
14 /// The product category (e.g., "linear").
15 ///
16 /// Indicates the instrument type of the transferred position. Bots should verify this matches the requested category.
17 pub category: String,
18
19 /// The unique order ID.
20 ///
21 /// Identifies the order associated with the transfer. Bots use this to correlate transfers with specific orders.
22 pub order_id: String,
23
24 /// The user ID of the account involved.
25 ///
26 /// Indicates the account (source or destination) associated with the transfer. Bots use this to verify the correct accounts were involved.
27 #[serde(rename = "userId")]
28 pub user_id: u64,
29
30 /// The trading pair symbol (e.g., "BTCUSDT").
31 ///
32 /// Identifies the perpetual futures contract for the transferred position. Bots should confirm this matches the requested symbol.
33 pub symbol: String,
34
35 /// The trade side ("Buy" or "Sell").
36 ///
37 /// Indicates whether the transferred position was long (Buy) or short (Sell). Bots use this to verify position direction.
38 pub side: String,
39
40 /// The transfer price.
41 ///
42 /// The price at which the position was transferred, used for valuation. Bots use this to verify the fairness of the transfer price.
43 #[serde(with = "string_to_float")]
44 pub price: f64,
45
46 /// The quantity of the transferred position.
47 ///
48 /// The amount of the base asset transferred. Bots use this to verify the correct position size was moved.
49 #[serde(with = "string_to_float")]
50 pub qty: f64,
51
52 /// The execution fee for the transfer.
53 ///
54 /// The fee charged for the transfer, in the settlement currency. Bots use this to calculate the net cost of the transfer.
55 #[serde(with = "string_to_float")]
56 pub exec_fee: f64,
57
58 /// The status of the transfer (e.g., "Filled", "Rejected").
59 ///
60 /// Indicates whether the transfer was successful or encountered issues. Bots should check this to confirm transfer completion.
61 pub status: String,
62
63 /// The unique execution ID.
64 ///
65 /// A unique identifier for the transfer execution on Bybit’s exchange. Bots use this to track specific transfer events and avoid duplicates.
66 pub exec_id: String,
67
68 /// The result code for the transfer.
69 ///
70 /// A code indicating the outcome of the transfer (e.g., `0` for success). Bots should check this to identify issues with specific transfers.
71 pub result_code: i16,
72
73 /// A message describing the transfer result.
74 ///
75 /// Provides details about the transfer’s status, such as success or error reasons. Bots should log this for debugging and error handling.
76 pub result_message: String,
77
78 /// The timestamp when the transfer was created.
79 ///
80 /// Indicates when the transfer request was initiated. Bots use this to align transfer data with other time-series data.
81 pub created_at: u64,
82
83 /// The timestamp when the transfer was last updated.
84 ///
85 /// Indicates when the transfer status was last modified (e.g., completed or rejected). Bots use this to track transfer progress.
86 pub updated_at: u64,
87
88 /// The party that rejected the transfer, if applicable.
89 ///
90 /// Identifies the account (source or destination) that caused a rejection. Bots use this to diagnose transfer failures.
91 pub reject_party: String,
92}