Skip to main content

parse_ws_funding_rate_update

Function parse_ws_funding_rate_update 

Source
pub fn parse_ws_funding_rate_update(
    stats: &LighterMarketStats,
    instrument: &InstrumentAny,
    timestamp_ms: u64,
    ts_init: UnixNanos,
) -> Result<FundingRateUpdate>
Expand description

Parses a Lighter perpetual market-stat update into a funding-rate update.

Lighter exposes current_funding_rate as the estimate for the upcoming payment. The funding_rate field is the last completed payment, so it is not used for the streaming Nautilus update. The accompanying funding_timestamp identifies that completed payment; market stats do not provide the next settlement time.

ยงErrors

Returns an error if the event timestamp cannot be converted.