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
/******************************************************************************
Author: Joaquín Béjar García
Email: jb@taunais.com
Date: 15/9/25
******************************************************************************/
use pretty_simple_display::{DebugPretty, DisplaySimple};
use serde::{Deserialize, Serialize};
/// Fee structure for different trading types
#[derive(DebugPretty, DisplaySimple, Clone, Serialize, Deserialize)]
pub struct FeeStructure {
/// The currency pair this fee applies to
pub index_name: String,
/// Instrument type (e.g., future, perpetual, option)
pub kind: String,
/// Fee values
pub value: FeeValue,
}
/// Fee values for different fee types
#[derive(DebugPretty, DisplaySimple, Clone, Serialize, Deserialize)]
pub struct FeeValue {
/// Default fee structure
pub default: DefaultFee,
/// Block trade fee (if applicable)
pub block_trade: Option<f64>,
/// Settlement fee
pub settlement: Option<f64>,
}
/// Default fee structure
#[derive(DebugPretty, DisplaySimple, Clone, Serialize, Deserialize)]
pub struct DefaultFee {
/// Fee calculation type (e.g., fixed, relative)
#[serde(rename = "type")]
pub fee_type: String,
/// Taker fee
pub taker: f64,
/// Maker fee
pub maker: f64,
}