Struct InstrumentDefMsg
- Namespace
- DatabentoDotNet.Dbn
- Assembly
- DatabentoDotNet.Dbn.dll
The definition of an instrument. The record of the Definition schema, and the largest record in DBN at 520 bytes.
public readonly struct InstrumentDefMsg : IRecord<InstrumentDefMsg>
- Implements
- Inherited Members
Remarks
This is the DBN v3 layout. Versions 1 and 2 are 360 and 400 bytes and differ in more than size — see InstrumentDefMsgV1 and InstrumentDefMsgV2, and UpgradeTo() for how the gap is closed.
Field order is transcribed from the #[repr(C)] Rust declaration. This struct is where
that matters most: it carries 42 encode_order attributes, all of which control CSV
and JSON column order only and none of which affect memory layout. A field list built from them
would compile, satisfy a size assertion, and decode garbage.
Fields
Activation
The time of instrument activation, in nanoseconds since the UNIX epoch. UndefTimestamp when null, as for equities.
public readonly ulong Activation
Field Value
ApplId
The channel ID assigned at the venue.
public readonly short ApplId
Field Value
Asset
The underlying asset code (product code) of the instrument.
public readonly CStr11 Asset
Field Value
Cfi
The ISO standard instrument categorization code.
public readonly CStr7 Cfi
Field Value
ChannelId
The channel ID assigned by Databento, an integer counting up from zero.
public readonly ushort ChannelId
Field Value
ContractMultiplier
The number of deliverables per instrument, i.e. peak days.
public readonly int ContractMultiplier
Field Value
ContractMultiplierUnit
The type of ContractMultiplier: 1 for hours, 2 for days.
public readonly sbyte ContractMultiplierUnit
Field Value
Currency
The currency used for price fields.
public readonly CStr4 Currency
Field Value
DecayQuantity
The quantity a contract decays by daily once DecayStartDate is reached.
public readonly int DecayQuantity
Field Value
DecayStartDate
The date at which a contract begins to decay.
public readonly ushort DecayStartDate
Field Value
DisplayFactor
The multiplier converting the venue's display price to the conventional price, where every 1 unit corresponds to 1e-9.
public readonly long DisplayFactor
Field Value
Exchange
The exchange used to identify the instrument.
public readonly CStr5 Exchange
Field Value
Expiration
The last eligible trade time, in nanoseconds since the UNIX epoch. UndefTimestamp when null, as for equities.
public readonly ulong Expiration
Field Value
FlowScheduleType
The schedule for delivering electricity.
public readonly sbyte FlowScheduleType
Field Value
Group
The security group code of the instrument.
public readonly CStr21 Group
Field Value
Header
The common header.
public readonly RecordHeader Header
Field Value
HighLimitPrice
The allowable high limit price for the trading day, where every 1 unit corresponds to 1e-9.
public readonly long HighLimitPrice
Field Value
InstAttribValue
Venue-specific instrument attributes.
public readonly int InstAttribValue
Field Value
LegCount
The number of legs in the strategy or spread; 0 for outrights. New in DBN v3.
public readonly ushort LegCount
Field Value
LegDelta
The associated delta of the leg, if any, where every 1 unit corresponds to 1e-9. New in DBN v3.
public readonly long LegDelta
Field Value
LegIndex
The 0-based index of the leg. New in DBN v3.
public readonly ushort LegIndex
Field Value
LegInstrumentId
The numeric ID assigned to the leg instrument. New in DBN v3.
public readonly uint LegInstrumentId
Field Value
LegPrice
The tied price of the leg, if any, where every 1 unit corresponds to 1e-9. New in DBN v3.
public readonly long LegPrice
Field Value
LegRatioPriceDenominator
The denominator of the leg's price ratio within the spread. New in DBN v3.
public readonly int LegRatioPriceDenominator
Field Value
LegRatioPriceNumerator
The numerator of the leg's price ratio within the spread. New in DBN v3.
public readonly int LegRatioPriceNumerator
Field Value
LegRatioQtyDenominator
The denominator of the leg's quantity ratio within the spread. New in DBN v3.
public readonly int LegRatioQtyDenominator
Field Value
LegRatioQtyNumerator
The numerator of the leg's quantity ratio within the spread. New in DBN v3.
public readonly int LegRatioQtyNumerator
Field Value
LegRawSymbol
The leg instrument's raw symbol assigned by the publisher. New in DBN v3.
public readonly CStr71 LegRawSymbol
Field Value
LegUnderlyingId
The numeric ID of the leg instrument's underlying instrument. New in DBN v3.
public readonly uint LegUnderlyingId
Field Value
LowLimitPrice
The allowable low limit price for the trading day, where every 1 unit corresponds to 1e-9.
public readonly long LowLimitPrice
Field Value
MainFraction
The price denominator of the main fraction.
public readonly byte MainFraction
Field Value
MarketDepth
The outright book depth on the price-level data feed.
public readonly int MarketDepth
Field Value
MarketDepthImplied
The implied book depth on the price-level data feed.
public readonly int MarketDepthImplied
Field Value
MarketSegmentId
The market segment of the instrument.
public readonly uint MarketSegmentId
Field Value
MaturityDay
The calendar day reflected in the instrument symbol, or 0.
public readonly byte MaturityDay
Field Value
MaturityMonth
The calendar month reflected in the instrument symbol.
public readonly byte MaturityMonth
Field Value
MaturityWeek
The calendar week reflected in the instrument symbol, or 0.
public readonly byte MaturityWeek
Field Value
MaturityYear
The calendar year reflected in the instrument symbol.
public readonly ushort MaturityYear
Field Value
MaxPriceVariation
The differential value for price banding, where every 1 unit corresponds to 1e-9.
public readonly long MaxPriceVariation
Field Value
MaxTradeVol
The maximum trading volume for the instrument.
public readonly uint MaxTradeVol
Field Value
MinLotSize
The minimum order entry quantity for the instrument.
public readonly int MinLotSize
Field Value
MinLotSizeBlock
The minimum quantity required for a block trade of the instrument.
public readonly int MinLotSizeBlock
Field Value
MinLotSizeRoundLot
The minimum quantity required for a round lot. Multiples of this quantity are round lots too.
public readonly int MinLotSizeRoundLot
Field Value
MinPriceIncrement
The minimum constant tick for the instrument, where every 1 unit corresponds to 1e-9.
public readonly long MinPriceIncrement
Field Value
MinPriceIncrementAmount
The minimum price increment amount disseminated by the venue, where every 1 unit corresponds to 1e-9.
public readonly long MinPriceIncrementAmount
Field Value
MinTradeVol
The minimum trading volume for the instrument.
public readonly uint MinTradeVol
Field Value
OriginalContractSize
The fixed contract value assigned to each instrument.
public readonly int OriginalContractSize
Field Value
PriceDisplayFormat
The number of digits to the right of the tick mark, for displaying fractional prices.
public readonly byte PriceDisplayFormat
Field Value
PriceRatio
The value used for price calculation in spread and leg pricing, where every 1 unit corresponds to 1e-9.
public readonly long PriceRatio
Field Value
RawInstrumentClass
The raw wire byte behind InstrumentClass: the classification of the instrument. Not validated on decode — pass it to TryFromInstrumentClass(byte, out InstrumentClass) for a checked conversion.
public readonly byte RawInstrumentClass
Field Value
RawInstrumentId
The instrument ID assigned by the publisher, which may be the same as InstrumentId.
public readonly ulong RawInstrumentId
Field Value
RawLegInstrumentClass
The raw wire byte behind LegInstrumentClass: the classification of the leg instrument. New in DBN v3. Not validated on decode — pass it to TryFromInstrumentClass(byte, out InstrumentClass) for a checked conversion.
public readonly byte RawLegInstrumentClass
Field Value
RawLegSide
The raw wire byte behind LegSide: the side taken for the leg when purchasing the spread. New in DBN v3. Not validated on decode — pass it to TryFromSide(byte, out Side) for a checked conversion.
public readonly byte RawLegSide
Field Value
RawMatchAlgorithm
The raw wire byte behind MatchAlgorithm: the matching algorithm used for the instrument, typically FIFO. Not validated on decode — pass it to TryFromMatchAlgorithm(byte, out MatchAlgorithm) for a checked conversion.
public readonly byte RawMatchAlgorithm
Field Value
RawSecurityUpdateAction
The raw wire byte behind SecurityUpdateAction: whether the instrument definition was added, modified, or deleted. Not validated on decode — pass it to TryFromSecurityUpdateAction(byte, out SecurityUpdateAction) for a checked conversion.
public readonly byte RawSecurityUpdateAction
Field Value
RawSymbol
The instrument raw symbol assigned by the publisher.
public readonly CStr71 RawSymbol
Field Value
RawUserDefinedInstrument
The raw wire byte behind UserDefinedInstrument: whether the instrument is user defined. Not validated on decode — pass it to TryFromUserDefinedInstrument(byte, out UserDefinedInstrument) for a checked conversion.
public readonly byte RawUserDefinedInstrument
Field Value
SecSubType
The strategy type of the spread.
public readonly CStr6 SecSubType
Field Value
SecurityType
The security type of the instrument, e.g. FUT for a future or future spread.
public readonly CStr7 SecurityType
Field Value
SettlCurrency
The currency used for settlement, if different from Currency.
public readonly CStr4 SettlCurrency
Field Value
StrikePrice
The strike price of the option, where every 1 unit corresponds to 1e-9.
public readonly long StrikePrice
Field Value
StrikePriceCurrency
The currency of StrikePrice.
public readonly CStr4 StrikePriceCurrency
Field Value
SubFraction
The price denominator of the sub fraction.
public readonly byte SubFraction
Field Value
TickRule
The tick rule of the spread.
public readonly byte TickRule
Field Value
TsRecv
The capture-server-received timestamp, in nanoseconds since the UNIX epoch. This, not TsEvent, is the record's index timestamp.
public readonly ulong TsRecv
Field Value
Underlying
The symbol of the first underlying instrument.
public readonly CStr21 Underlying
Field Value
UnderlyingId
The instrument ID of the first underlying instrument.
public readonly uint UnderlyingId
Field Value
UnderlyingProduct
The product complex of the instrument.
public readonly byte UnderlyingProduct
Field Value
UnitOfMeasure
The unit of measure for the instrument's original contract size, e.g. USD or
LBS.
public readonly CStr31 UnitOfMeasure
Field Value
UnitOfMeasureQty
The contract size for each instrument, paired with UnitOfMeasure, where every 1 unit corresponds to 1e-9.
public readonly long UnitOfMeasureQty
Field Value
Properties
IndexTs
The record's index timestamp: the one to sort by, and the one to key a symbol map with. Nanoseconds since the UNIX epoch.
public ulong IndexTs { get; }
Property Value
Remarks
This is usually ts_recv, not TsEvent. Fourteen of
the twenty-one record structs carry a ts_recv and index on it; the rest have no
ts_recv at all and fall back to the header's ts_event. Port of upstream's
Record::raw_index_ts (record/traits.rs:52-54), whose default body is
ts_event and which the #[dbn(index_ts)] field attribute overrides per struct
(record.rs, compat.rs).
The distinction is not cosmetic: ts_event and ts_recv can fall on opposite
sides of UTC midnight, so resolving a symbol by the wrong one silently returns the
previous day's symbol, or nothing, with no error anywhere.
This is a raw timestamp and can be UndefTimestamp. Convert it with ToUtcDate(ulong) or TryToUtcDate(ulong, out LocalDate), which check the sentinel.
InstrumentClass
The classification of the instrument. Undefined wire bytes cast through to an unnamed value rather than throwing; see RawInstrumentClass.
public InstrumentClass InstrumentClass { get; }
Property Value
InstrumentClassChar
The classification of the instrument, as its raw ASCII character.
public char InstrumentClassChar { get; }
Property Value
LegInstrumentClass
The classification of the leg instrument. New in DBN v3. Undefined wire bytes cast through to an unnamed value rather than throwing; see RawLegInstrumentClass.
public InstrumentClass LegInstrumentClass { get; }
Property Value
LegInstrumentClassChar
The classification of the leg instrument, as its raw ASCII character. New in DBN v3.
public char LegInstrumentClassChar { get; }
Property Value
LegSide
The side taken for the leg when purchasing the spread. New in DBN v3. Undefined wire bytes cast through to an unnamed value rather than throwing; see RawLegSide.
public Side LegSide { get; }
Property Value
LegSideChar
The side taken for the leg when purchasing the spread, as its raw ASCII character. New in DBN v3.
public char LegSideChar { get; }
Property Value
MatchAlgorithm
The matching algorithm used for the instrument, typically FIFO. Undefined wire bytes cast through to an unnamed value rather than throwing; see RawMatchAlgorithm.
public MatchAlgorithm MatchAlgorithm { get; }
Property Value
MatchAlgorithmChar
The matching algorithm used for the instrument, typically FIFO, as its raw ASCII character.
public char MatchAlgorithmChar { get; }
Property Value
SecurityUpdateAction
Whether the instrument definition was added, modified, or deleted. Undefined wire bytes cast through to an unnamed value rather than throwing; see RawSecurityUpdateAction.
public SecurityUpdateAction SecurityUpdateAction { get; }
Property Value
SecurityUpdateActionChar
Whether the instrument definition was added, modified, or deleted, as its raw ASCII character.
public char SecurityUpdateActionChar { get; }
Property Value
UserDefinedInstrument
Whether the instrument is user defined. Undefined wire bytes cast through to an unnamed value rather than throwing; see RawUserDefinedInstrument.
public UserDefinedInstrument UserDefinedInstrument { get; }
Property Value
UserDefinedInstrumentChar
Whether the instrument is user defined, as its raw ASCII character.
public char UserDefinedInstrumentChar { get; }
Property Value
WireSize
The struct's exact size on the wire, in bytes, excluding any trailing ts_out.
public static int WireSize { get; }
Property Value
Methods
HasRType(RType)
Reports whether InstrumentDefMsg is the layout for records carrying
rtype.
public static bool HasRType(RType rtype)
Parameters
rtypeRTypeThe record type read from a record header.
Returns
- bool
true if
rtypeis one of the record types this struct decodes. This is necessary but not sufficient to identify the record — see the remarks on IRecord<TSelf>.