Struct InstrumentDefMsgV1
- Namespace
- DatabentoDotNet.Dbn
- Assembly
- DatabentoDotNet.Dbn.dll
The DBN v1 layout of InstrumentDefMsg, 360 bytes.
public readonly struct InstrumentDefMsgV1 : IRecord<InstrumentDefMsgV1>
- Implements
- Inherited Members
Remarks
Version 1 differs from v3 by more than its size. It carries four fields v3 dropped (TradingReferencePrice, TradingReferenceDate, MdSecurityTradingStatus and SettlPriceType) and none of the thirteen leg and spread fields v3 added; RawInstrumentId is 32-bit rather than 64-bit; RawSymbol is 22 bytes rather than 71 and Asset 7 rather than 11; and StrikePrice sits near the tail of the record rather than among the other price fields at the front.
The five reserved blocks are v1's own: _reserved4 is what 8-byte-aligns
StrikePrice at its unusual position, and v2 removed all of them once the field
moved.
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 CStr7 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
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
MdSecurityTradingStatus
The venue's security trading status. Removed in DBN v3.
public readonly byte MdSecurityTradingStatus
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 uint RawInstrumentId
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 CStr22 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
SettlPriceType
A bit field indicating how the settlement price was calculated. Removed in DBN v3.
public readonly byte SettlPriceType
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
TradingReferenceDate
The date the TradingReferencePrice is for, as days since the UNIX epoch. Removed in
DBN v3.
public readonly ushort TradingReferenceDate
Field Value
TradingReferencePrice
The trading session close price, where every 1 unit corresponds to 1e-9. Removed in DBN v3.
public readonly long TradingReferencePrice
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
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 InstrumentDefMsgV1 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>.
UpgradeTo()
Converts this record to the current-version InstrumentDefMsg.
public InstrumentDefMsg UpgradeTo()
Returns
- InstrumentDefMsg
The equivalent v3 record.
Remarks
A value-level conversion into larger storage, never an in-place reinterpret: the target is
520 bytes to this record's 360 and almost nothing after price_ratio is at the same
offset. Length is recomputed for the new size, the four fields
v3 dropped are discarded, and the thirteen fields v3 added take upstream's defaults for
them — which for a price field is UndefPrice, not zero.
UpgradeToV2()
Converts this record to InstrumentDefMsgV2, for UpgradeToV2.
public InstrumentDefMsgV2 UpgradeToV2()
Returns
- InstrumentDefMsgV2
The equivalent v2 record.
Remarks
A value-level conversion into larger storage, never an in-place reinterpret: the target is 400 bytes to this record's 360. Length is recomputed for the new size. Unlike UpgradeTo(), nothing here takes a default: every field v2 has is already present in v1, so this is a relocation and a widening, not an invention.