Skip to main content

parse_funding_rate_update

Function parse_funding_rate_update 

Source
pub fn parse_funding_rate_update(
    funding: &LighterFunding,
    instrument_id: InstrumentId,
    interval: Option<u16>,
    ts_init: UnixNanos,
) -> Result<FundingRateUpdate>
Expand description

Parses a Lighter historical funding row into a Nautilus [FundingRateUpdate].

Lighter returns rate as a magnitude and direction as the side paying the funding. Nautilus uses the conventional signed rate: positive when longs pay shorts and negative when shorts pay longs.

ยงErrors

Returns an error if the timestamp cannot be converted.