deribit_http/model/
fee.rs

1/******************************************************************************
2   Author: Joaquín Béjar García
3   Email: jb@taunais.com
4   Date: 15/9/25
5******************************************************************************/
6use pretty_simple_display::{DebugPretty, DisplaySimple};
7use serde::{Deserialize, Serialize};
8
9/// Fee structure for different trading types
10#[derive(DebugPretty, DisplaySimple, Clone, Serialize, Deserialize)]
11pub struct FeeStructure {
12    /// The currency pair this fee applies to
13    pub index_name: String,
14    /// Instrument type (e.g., future, perpetual, option)
15    pub kind: String,
16    /// Fee values
17    pub value: FeeValue,
18}
19
20/// Fee values for different fee types
21#[derive(DebugPretty, DisplaySimple, Clone, Serialize, Deserialize)]
22pub struct FeeValue {
23    /// Default fee structure
24    pub default: DefaultFee,
25    /// Block trade fee (if applicable)
26    pub block_trade: Option<f64>,
27    /// Settlement fee
28    pub settlement: Option<f64>,
29}
30
31/// Default fee structure
32#[derive(DebugPretty, DisplaySimple, Clone, Serialize, Deserialize)]
33pub struct DefaultFee {
34    /// Fee calculation type (e.g., fixed, relative)
35    #[serde(rename = "type")]
36    pub fee_type: String,
37    /// Taker fee
38    pub taker: f64,
39    /// Maker fee
40    pub maker: f64,
41}