Table of Contents

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

ulong

ApplId

The channel ID assigned at the venue.

public readonly short ApplId

Field Value

short

Asset

The underlying asset code (product code) of the instrument.

public readonly CStr7 Asset

Field Value

CStr7

Cfi

The ISO standard instrument categorization code.

public readonly CStr7 Cfi

Field Value

CStr7

ChannelId

The channel ID assigned by Databento, an integer counting up from zero.

public readonly ushort ChannelId

Field Value

ushort

ContractMultiplier

The number of deliverables per instrument, i.e. peak days.

public readonly int ContractMultiplier

Field Value

int

ContractMultiplierUnit

The type of ContractMultiplier: 1 for hours, 2 for days.

public readonly sbyte ContractMultiplierUnit

Field Value

sbyte

Currency

The currency used for price fields.

public readonly CStr4 Currency

Field Value

CStr4

DecayQuantity

The quantity a contract decays by daily once DecayStartDate is reached.

public readonly int DecayQuantity

Field Value

int

DecayStartDate

The date at which a contract begins to decay.

public readonly ushort DecayStartDate

Field Value

ushort

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

long

Exchange

The exchange used to identify the instrument.

public readonly CStr5 Exchange

Field Value

CStr5

Expiration

The last eligible trade time, in nanoseconds since the UNIX epoch. UndefTimestamp when null, as for equities.

public readonly ulong Expiration

Field Value

ulong

FlowScheduleType

The schedule for delivering electricity.

public readonly sbyte FlowScheduleType

Field Value

sbyte

Group

The security group code of the instrument.

public readonly CStr21 Group

Field Value

CStr21

Header

The common header.

public readonly RecordHeader Header

Field Value

RecordHeader

HighLimitPrice

The allowable high limit price for the trading day, where every 1 unit corresponds to 1e-9.

public readonly long HighLimitPrice

Field Value

long

InstAttribValue

Venue-specific instrument attributes.

public readonly int InstAttribValue

Field Value

int

LowLimitPrice

The allowable low limit price for the trading day, where every 1 unit corresponds to 1e-9.

public readonly long LowLimitPrice

Field Value

long

MainFraction

The price denominator of the main fraction.

public readonly byte MainFraction

Field Value

byte

MarketDepth

The outright book depth on the price-level data feed.

public readonly int MarketDepth

Field Value

int

MarketDepthImplied

The implied book depth on the price-level data feed.

public readonly int MarketDepthImplied

Field Value

int

MarketSegmentId

The market segment of the instrument.

public readonly uint MarketSegmentId

Field Value

uint

MaturityDay

The calendar day reflected in the instrument symbol, or 0.

public readonly byte MaturityDay

Field Value

byte

MaturityMonth

The calendar month reflected in the instrument symbol.

public readonly byte MaturityMonth

Field Value

byte

MaturityWeek

The calendar week reflected in the instrument symbol, or 0.

public readonly byte MaturityWeek

Field Value

byte

MaturityYear

The calendar year reflected in the instrument symbol.

public readonly ushort MaturityYear

Field Value

ushort

MaxPriceVariation

The differential value for price banding, where every 1 unit corresponds to 1e-9.

public readonly long MaxPriceVariation

Field Value

long

MaxTradeVol

The maximum trading volume for the instrument.

public readonly uint MaxTradeVol

Field Value

uint

MdSecurityTradingStatus

The venue's security trading status. Removed in DBN v3.

public readonly byte MdSecurityTradingStatus

Field Value

byte

MinLotSize

The minimum order entry quantity for the instrument.

public readonly int MinLotSize

Field Value

int

MinLotSizeBlock

The minimum quantity required for a block trade of the instrument.

public readonly int MinLotSizeBlock

Field Value

int

MinLotSizeRoundLot

The minimum quantity required for a round lot. Multiples of this quantity are round lots too.

public readonly int MinLotSizeRoundLot

Field Value

int

MinPriceIncrement

The minimum constant tick for the instrument, where every 1 unit corresponds to 1e-9.

public readonly long MinPriceIncrement

Field Value

long

MinPriceIncrementAmount

The minimum price increment amount disseminated by the venue, where every 1 unit corresponds to 1e-9.

public readonly long MinPriceIncrementAmount

Field Value

long

MinTradeVol

The minimum trading volume for the instrument.

public readonly uint MinTradeVol

Field Value

uint

OriginalContractSize

The fixed contract value assigned to each instrument.

public readonly int OriginalContractSize

Field Value

int

PriceDisplayFormat

The number of digits to the right of the tick mark, for displaying fractional prices.

public readonly byte PriceDisplayFormat

Field Value

byte

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

long

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

byte

RawInstrumentId

The instrument ID assigned by the publisher, which may be the same as InstrumentId.

public readonly uint RawInstrumentId

Field Value

uint

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

byte

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

byte

RawSymbol

The instrument raw symbol assigned by the publisher.

public readonly CStr22 RawSymbol

Field Value

CStr22

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

byte

SecSubType

The strategy type of the spread.

public readonly CStr6 SecSubType

Field Value

CStr6

SecurityType

The security type of the instrument, e.g. FUT for a future or future spread.

public readonly CStr7 SecurityType

Field Value

CStr7

SettlCurrency

The currency used for settlement, if different from Currency.

public readonly CStr4 SettlCurrency

Field Value

CStr4

SettlPriceType

A bit field indicating how the settlement price was calculated. Removed in DBN v3.

public readonly byte SettlPriceType

Field Value

byte

StrikePrice

The strike price of the option, where every 1 unit corresponds to 1e-9.

public readonly long StrikePrice

Field Value

long

StrikePriceCurrency

The currency of StrikePrice.

public readonly CStr4 StrikePriceCurrency

Field Value

CStr4

SubFraction

The price denominator of the sub fraction.

public readonly byte SubFraction

Field Value

byte

TickRule

The tick rule of the spread.

public readonly byte TickRule

Field Value

byte

TradingReferenceDate

The date the TradingReferencePrice is for, as days since the UNIX epoch. Removed in DBN v3.

public readonly ushort TradingReferenceDate

Field Value

ushort

TradingReferencePrice

The trading session close price, where every 1 unit corresponds to 1e-9. Removed in DBN v3.

public readonly long TradingReferencePrice

Field Value

long

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

ulong

Underlying

The symbol of the first underlying instrument.

public readonly CStr21 Underlying

Field Value

CStr21

UnderlyingId

The instrument ID of the first underlying instrument.

public readonly uint UnderlyingId

Field Value

uint

UnderlyingProduct

The product complex of the instrument.

public readonly byte UnderlyingProduct

Field Value

byte

UnitOfMeasure

The unit of measure for the instrument's original contract size, e.g. USD or LBS.

public readonly CStr31 UnitOfMeasure

Field Value

CStr31

UnitOfMeasureQty

The contract size for each instrument, paired with UnitOfMeasure, where every 1 unit corresponds to 1e-9.

public readonly long UnitOfMeasureQty

Field Value

long

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

ulong

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

InstrumentClass

InstrumentClassChar

The classification of the instrument, as its raw ASCII character.

public char InstrumentClassChar { get; }

Property Value

char

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

MatchAlgorithm

MatchAlgorithmChar

The matching algorithm used for the instrument, typically FIFO, as its raw ASCII character.

public char MatchAlgorithmChar { get; }

Property Value

char

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

SecurityUpdateAction

SecurityUpdateActionChar

Whether the instrument definition was added, modified, or deleted, as its raw ASCII character.

public char SecurityUpdateActionChar { get; }

Property Value

char

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

UserDefinedInstrument

UserDefinedInstrumentChar

Whether the instrument is user defined, as its raw ASCII character.

public char UserDefinedInstrumentChar { get; }

Property Value

char

WireSize

The struct's exact size on the wire, in bytes, excluding any trailing ts_out.

public static int WireSize { get; }

Property Value

int

Methods

HasRType(RType)

Reports whether InstrumentDefMsgV1 is the layout for records carrying rtype.

public static bool HasRType(RType rtype)

Parameters

rtype RType

The record type read from a record header.

Returns

bool

true if rtype is 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.