hyperliquid_rust_sdk_abrkn/info/
sub_structs.rs

1use ethers::types::H160;
2use serde::Deserialize;
3
4#[derive(Deserialize, Debug)]
5#[serde(rename_all = "camelCase")]
6pub struct Leverage {
7    #[serde(rename = "type")]
8    pub type_string: String,
9    pub value: u32,
10    pub raw_usd: Option<String>,
11}
12
13#[derive(Deserialize, Debug)]
14#[serde(rename_all = "camelCase")]
15pub struct PositionData {
16    pub coin: String,
17    pub entry_px: Option<String>,
18    pub leverage: Leverage,
19    pub liquidation_px: Option<String>,
20    pub margin_used: String,
21    pub position_value: String,
22    pub return_on_equity: String,
23    pub szi: String,
24    pub unrealized_pnl: String,
25}
26
27#[derive(Deserialize, Debug)]
28pub struct AssetPosition {
29    pub position: PositionData,
30    #[serde(rename = "type")]
31    pub type_string: String,
32}
33
34#[derive(Deserialize, Debug)]
35#[serde(rename_all = "camelCase")]
36pub struct MarginSummary {
37    pub account_value: String,
38    pub total_margin_used: String,
39    pub total_ntl_pos: String,
40    pub total_raw_usd: String,
41}
42
43#[derive(Deserialize, Debug)]
44#[serde(rename_all = "camelCase")]
45pub struct Level {
46    pub n: u64,
47    pub px: String,
48    pub sz: String,
49}
50
51#[derive(Deserialize, Debug)]
52#[serde(rename_all = "camelCase")]
53pub struct Delta {
54    #[serde(rename = "type")]
55    pub type_string: String,
56    pub coin: String,
57    pub usdc: String,
58    pub szi: String,
59    pub funding_rate: String,
60}
61
62#[derive(Deserialize, Debug)]
63#[serde(rename_all = "camelCase")]
64pub struct DailyUserVlm {
65    pub date: String,
66    pub exchange: String,
67    pub user_add: String,
68    pub user_cross: String,
69}
70
71#[derive(Deserialize, Debug)]
72#[serde(rename_all = "camelCase")]
73pub struct FeeSchedule {
74    pub add: String,
75    pub cross: String,
76    pub referral_discount: String,
77    pub tiers: Tiers,
78}
79
80#[derive(Deserialize, Debug)]
81pub struct Tiers {
82    pub mm: Vec<Mm>,
83    pub vip: Vec<Vip>,
84}
85
86#[derive(Deserialize, Debug)]
87#[serde(rename_all = "camelCase")]
88pub struct Mm {
89    pub add: String,
90    pub maker_fraction_cutoff: String,
91}
92
93#[derive(Deserialize, Debug)]
94#[serde(rename_all = "camelCase")]
95pub struct Vip {
96    pub add: String,
97    pub cross: String,
98    pub ntl_cutoff: String,
99}
100
101#[derive(Deserialize, Debug)]
102pub struct UserTokenBalance {
103    pub coin: String,
104    pub hold: String,
105    pub total: String,
106}
107
108#[derive(Deserialize, Clone, Debug)]
109#[serde(rename_all = "camelCase")]
110pub struct OrderInfo {
111    pub order: BasicOrderInfo,
112    pub status: String,
113    pub status_timestamp: u64,
114}
115
116#[derive(Deserialize, Clone, Debug)]
117#[serde(rename_all = "camelCase")]
118pub struct BasicOrderInfo {
119    pub coin: String,
120    pub side: String,
121    pub limit_px: String,
122    pub sz: String,
123    pub oid: u64,
124    pub timestamp: u64,
125    pub trigger_condition: String,
126    pub is_trigger: bool,
127    pub trigger_px: String,
128    pub is_position_tpsl: bool,
129    pub reduce_only: bool,
130    pub order_type: String,
131    pub orig_sz: String,
132    pub tif: String,
133    pub cloid: Option<String>,
134}
135
136#[derive(Deserialize, Debug)]
137#[serde(rename_all = "camelCase")]
138pub struct Referrer {
139    pub referrer: H160,
140    pub code: String,
141}
142
143#[derive(Deserialize, Debug)]
144#[serde(rename_all = "camelCase")]
145pub struct ReferrerState {
146    pub stage: String,
147    pub data: ReferrerData,
148}
149
150#[derive(Deserialize, Debug)]
151#[serde(rename_all = "camelCase")]
152pub struct ReferrerData {
153    pub required: String,
154}