TaggedFlag

Tagged Instruments are used in MarketGrid to distinguish between specific instances of otherwise identical Instruments.

Overview

More correctly, the Tag attribute is used to distinguish one specific Holding from another, whilst still presenting all the Orders for the actual Instrument in a consolidated book.

An example of this is the concept of ProjectId in the Voluntary Carbon market where a specific project is attached to a particular Holding and when a participant places an Order, they place it for a specific project.

In order for the matching algorithm to take these distinguishing attributes into account when matching, the Instruments must have some of the TaggedFlag enum values stored in the Instrument.TaggedFlag attribute. The attribute is implemented as a bitmask of the values in the TaggedFlag enumeration.

Operation

The use of "tagging" has an impact across a number of areas of the system;

Order Validation

The operation of these values when validating an incoming Order is as follows;

  1. if the Order is off market or it is not a quote then
    1. if the Order.Tag is blank and the TaggedFlag value of the Order.Side is set then
      1. the order is invalid - Result::OrderTagBlank
    2. else
      1. the Order.Tag value is valid
  2. else if neither the <Side>QuoteNoTag nor the <Side>QuoteTag values associated with the Order.Side are set then
    1. the order is invalid - Result::OrderTagNoQuote
  3. else if the Order.Tag is blank and the <Side>QuoteNoTag value associated with the Order.Side is not set
    1. the order is invalid - Result::OrderTagBlankQuote
  4. else if the Order.Tag is not blank and the <Side>QuoteTag value associated with the Order.Side is not set
    1. the order is invalid - Result::OrderTagNotBlankQuote
  5. else
    1. the Order.Tag value is valid

Example

The following is the Instrument.TaggedFlag setting for the Voluntary Carbon market.

  • Instrument.TaggedFlag = TaggedFlag.Sell | TaggedFlag.BuyQuoteTag | TaggedFlag.BuyQuoteNoTag
    • hittable Sells that must include a Tag
    • indicative Buys, that may include a Tag if the Buyer wishes

Locating Holdings

Where an Instrument is "tagged" then the Matching Engine will check the Holding.Tag value to ensure that when searching for a specific Tag value that the Holding matches that value.

Matching

The matching algorithm will only match Orders where the Tag values of the otherwise matching Orders are identical.

Metadata

  • Underlying type: u8

Values

KeyValueDescription
Buy1Buy Orders that are off market, or that have a Type that does not include OrderType.Quote, must have a tag
Sell2Sell Orders that are off market, or that have a Type that does not include OrderType.Quote, must have a tag
BuyQuoteTag4Buy Orders with a Type that includes OrderType.Quote are permitted to have a tag
SellQuoteTag8Sell Orders with a Type that includes OrderType.Quote are permitted to have a tag
BuyQuoteNoTag16Buy Orders with a Type that includes OrderType.Quote are permitted to not have a tag
SellQuoteNoTag32Sell Orders with a Type that includes OrderType.Quote are permitted to not have a tag
Firm128Unused
Tagged3Used to detect if a given Instrument is using "tagged" features or not

Referenced by

Tables

TableFieldDescription
InstrumentTaggedFlag