pub struct FundingRate {
pub symbol: String,
pub funding_rate: f64,
pub funding_rate_timestamp: u64,
}Expand description
Represents a single funding rate record.
Each record provides the funding rate and timestamp for a specific funding interval in a perpetual futures contract. Funding rates balance long and short positions by charging a fee, paid every funding interval (typically 8 hours). Bots use this data to analyze historical funding costs, optimize position timing, and estimate profitability, as positive rates mean longs pay shorts, while negative rates mean shorts pay longs.
Fields§
§symbol: StringThe trading pair symbol (e.g., “BTCUSDT”).
Identifies the perpetual futures contract for this funding rate record. Bots should verify this matches the requested symbol to ensure data integrity.
funding_rate: f64The funding rate for the interval.
The rate applied during the funding interval, expressed as a decimal (e.g., 0.0001 for 0.01%). Positive rates indicate longs pay shorts; negative rates indicate shorts pay longs. Bots must parse this to f64 for calculations and use it to estimate funding costs, which can significantly impact long-term position profitability in perpetual futures.
funding_rate_timestamp: u64The timestamp of the funding rate application (Unix timestamp in milliseconds).
Indicates when the funding rate was applied. Bots use this to align funding rate data with other time-series data (e.g., price or position data) and to reconstruct the funding cost history for backtesting or strategy optimization.
Trait Implementations§
Source§impl Clone for FundingRate
impl Clone for FundingRate
Source§fn clone(&self) -> FundingRate
fn clone(&self) -> FundingRate
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more