Record Class PerpetualInstrument
java.lang.Object
java.lang.Record
com.wualabs.qtsurfer.engine.core.instrument.PerpetualInstrument
- Record Components:
base- base currency, e.g."BTC"quote- quote currency, e.g."USDT"settle- settlement currency — an asset code, never a compound token
- All Implemented Interfaces:
Instrument
public record PerpetualInstrument(@NonNull String base, @NonNull String quote, @NonNull String settle)
extends Record
implements Instrument
A perpetual contract — a derivative with no expiry:
BTC/USDT:USDT when margined in the
quote currency, BTC/USD:BTC when margined in the base.
Prefer Instrument.of(String, String, String) over this constructor. Neither accepts a
null or blank component: a perpetual without a settlement currency is a spot pair, and the caller
has to say which one it means.
-
Constructor Summary
ConstructorsConstructorDescriptionPerpetualInstrument(@NonNull String base, @NonNull String quote, @NonNull String settle) Creates an instance of aPerpetualInstrumentrecord class. -
Method Summary
Modifier and TypeMethodDescription@NonNull Stringbase()Returns the value of thebaserecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleantruefor any contract settled in a currency — perpetual or dated.@NonNull Stringquote()Returns the value of thequoterecord component.@NonNull Stringsettle()Returns the value of thesettlerecord component.symbol()CCXT-style canonical string.toString()Returns a string representation of this record class.Methods inherited from interface Instrument
isDated
-
Constructor Details
-
PerpetualInstrument
-
-
Method Details
-
isDerivative
public boolean isDerivative()Description copied from interface:Instrumenttruefor any contract settled in a currency — perpetual or dated.- Specified by:
isDerivativein interfaceInstrument
-
symbol
Description copied from interface:InstrumentCCXT-style canonical string. Inverse ofInstrument.parse(String).- Specified by:
symbolin interfaceInstrument
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
base
Returns the value of thebaserecord component.- Specified by:
basein interfaceInstrument- Returns:
- the value of the
baserecord component
-
quote
Returns the value of thequoterecord component.- Specified by:
quotein interfaceInstrument- Returns:
- the value of the
quoterecord component
-
settle
-