Record Class FundingRate
java.lang.Object
java.lang.Record
com.wualabs.qtsurfer.engine.core.FundingRate
public record FundingRate(Instrument instrument, BigDecimal rate1h, BigDecimal rate8h, long effectiveMinutes, long timestamp)
extends Record
Engine-owned, exchange-agnostic funding rate (perpetual-swap funding). Canonical precision model
mirroring the fields the engine consumes: the 1h-normalized rate, the base (8h) rate, minutes
until the next funding event, and the observation timestamp.
Pure domain record with no XChange dependency. Conversion to/from XChange DTOs lives in the
exchange-adapter boundary (XChangeConvert in qtsurfer-engine-exchange). Rates may be
null when the source does not report them.
-
Constructor Summary
ConstructorsConstructorDescriptionFundingRate(Instrument instrument, BigDecimal rate1h, BigDecimal rate8h, long effectiveMinutes, long timestamp) Creates an instance of aFundingRaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of theeffectiveMinutesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theinstrumentrecord component.rate1h()Returns the value of therate1hrecord component.rate8h()Returns the value of therate8hrecord component.longReturns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
FundingRate
public FundingRate(Instrument instrument, BigDecimal rate1h, BigDecimal rate8h, long effectiveMinutes, long timestamp) Creates an instance of aFundingRaterecord class.- Parameters:
instrument- the value for theinstrumentrecord componentrate1h- the value for therate1hrecord componentrate8h- the value for therate8hrecord componenteffectiveMinutes- the value for theeffectiveMinutesrecord componenttimestamp- the value for thetimestamprecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
instrument
Returns the value of theinstrumentrecord component.- Returns:
- the value of the
instrumentrecord component
-
rate1h
Returns the value of therate1hrecord component.- Returns:
- the value of the
rate1hrecord component
-
rate8h
Returns the value of therate8hrecord component.- Returns:
- the value of the
rate8hrecord component
-
effectiveMinutes
public long effectiveMinutes()Returns the value of theeffectiveMinutesrecord component.- Returns:
- the value of the
effectiveMinutesrecord component
-
timestamp
public long timestamp()Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-