Source code for mlthon.instruments.perpetual

from mlthon.instruments.instrument import Instrument


[docs]class Perpetual(Instrument): def __init__(self, underlying_ins_id: int = None, funding_rate_settlement_interval_ms: int = None, **kwargs): """ Construct a new Perpetual object. Parameters ---------- underlying_ins_id: int underlying instrument ID. funding_rate_settlement_interval_ms: int interval at which funding rate is settled, meaning either shorts pay longs or vice versa kwargs: dict the arguments for base class Instrument """ super(Perpetual, self).__init__(**kwargs) # initialize its base class with the other named arguments self.underlying_ins_id_ = underlying_ins_id self.funding_rate_settlement_interval_ms_ = funding_rate_settlement_interval_ms
[docs] def get_underlying_ins_id(self): return self.underlying_ins_id_
[docs] def get_funding_rate_settlement_interval_ms(self): return self.funding_rate_settlement_interval_ms_