bybit/models/fee_group_info_response.rs
1use crate::prelude::*;
2
3/// Represents a fee rate structure for a specific level (Pro or Market Maker).
4///
5/// This struct contains the fee rates for a specific level within either the Pro or Market Maker category.
6/// Each level has different taker fee rate, maker fee rate, and maker rebate values.
7#[derive(Debug, Serialize, Deserialize, Clone)]
8#[serde(rename_all = "camelCase")]
9pub struct FeeRateLevel {
10 /// The level name (e.g., "Pro 1", "Pro 2", ..., "Pro 6" or "MM 1", "MM 2", "MM 3").
11 ///
12 /// Identifies the specific fee tier within the category.
13 pub level: String,
14
15 /// The taker fee rate as a string (e.g., "0.00028").
16 ///
17 /// The fee rate charged for taker orders (orders that remove liquidity).
18 /// For Market Maker levels, this field may be empty.
19 pub taker_fee_rate: String,
20
21 /// The maker fee rate as a string (e.g., "0.0001").
22 ///
23 /// The fee rate charged for maker orders (orders that add liquidity).
24 /// For Market Maker levels, this field may be empty.
25 pub maker_fee_rate: String,
26
27 /// The maker rebate fee rate as a string (e.g., "-0.0000075").
28 ///
29 /// The rebate rate for maker orders. Negative values indicate rebates (payments to the trader).
30 /// For Pro levels, this field may be empty.
31 pub maker_rebate: String,
32}
33
34/// Represents the fee rate structures for both Pro and Market Maker categories.
35///
36/// This struct contains arrays of fee rate levels for Pro-level clients and Market Maker clients.
37#[derive(Debug, Serialize, Deserialize, Clone)]
38#[serde(rename_all = "camelCase")]
39pub struct FeeRates {
40 /// Array of fee rate levels for Pro-level clients.
41 ///
42 /// Contains 6 levels: Pro 1 through Pro 6, each with different fee rates.
43 pub pro: Vec<FeeRateLevel>,
44
45 /// Array of fee rate levels for Market Maker clients.
46 ///
47 /// Contains 3 levels: MM 1 through MM 3, each with different rebate rates.
48 pub market_maker: Vec<FeeRateLevel>,
49}
50
51/// Represents a fee group with its associated symbols and fee rates.
52///
53/// Each fee group contains a set of symbols that share the same fee structure
54/// and weighting factor for volume calculations.
55#[derive(Debug, Serialize, Deserialize, Clone)]
56#[serde(rename_all = "camelCase")]
57pub struct FeeGroup {
58 /// The fee group name (e.g., "G1(Major Coins)").
59 ///
60 /// Descriptive name of the fee group.
61 pub group_name: String,
62
63 /// The group weighting factor.
64 ///
65 /// Used in calculating weighted maker volume:
66 /// Weighted maker volume = Σ(Maker volume on pair × Group weighting factor)
67 pub weighting_factor: i32,
68
69 /// The number of symbols in this fee group.
70 ///
71 /// Count of symbols included in the `symbols` array.
72 pub symbols_numbers: i32,
73
74 /// Array of symbol names included in this fee group.
75 ///
76 /// List of trading symbols (e.g., ["BTCUSDT", "ETHUSDT", ...]).
77 pub symbols: Vec<String>,
78
79 /// Fee rate details for different client categories.
80 ///
81 /// Contains fee structures for Pro-level and Market Maker clients.
82 pub fee_rates: FeeRates,
83
84 /// Latest data update timestamp in milliseconds.
85 ///
86 /// Timestamp when the fee group data was last updated.
87 pub update_time: String,
88}
89
90/// Contains the list of fee groups returned by the API.
91///
92/// This struct wraps the array of fee groups in the API response.
93#[derive(Debug, Serialize, Deserialize, Clone)]
94#[serde(rename_all = "camelCase")]
95pub struct FeeGroupList {
96 /// List of fee group objects.
97 ///
98 /// Contains all fee groups (or a specific group if filtered by groupId).
99 pub list: Vec<FeeGroup>,
100}
101
102/// The main response type for the fee group info API endpoint.
103///
104/// This is the top-level response structure returned by the `/v5/market/fee-group-info` endpoint.
105pub type FeeGroupInfoResponse = BybitApiResponse<FeeGroupList>;