All Downloads are FREE. Search and download functionalities are using the official Maven repository.

openfeed-client.1.0.16.source-code.openfeed_instrument.proto Maven / Gradle / Ivy

The newest version!
/**
 * Copyright (C) 2011-2017 Barchart, Inc. 
 *
 * All rights reserved. Licensed under the OSI BSD License.
 *
 * http://www.opensource.org/licenses/bsd-license.php
 */

syntax = "proto3";

package org.openfeed;

option java_multiple_files = true;
option java_generate_equals_and_hash = true;
option optimize_for = SPEED;

message InstrumentDefinition {

  /// Unique ID used in the data feed.
  sint64 marketId = 1;

  /// Instrument type as enum...
  InstrumentType instrumentType = 2;

  /// Supported Book Types
  repeated BookType supportBookTypes = 3;

  /// Maximum depth of market-by-price order book
  sint32 bookDepth = 4;

  /// The name of the market data vendor
  string vendorId = 5;

  /// Human readable market symbol, assigned by the exchange or venue.
  // Not necessarily unique as the exchange or vendor could assign the same symbol to different
  // instruments, for example if the instruments trade on different exchanges.
  string symbol = 6;

  /// Human readable market description.
  string description = 7;

  /// Market CFI code: http://en.wikipedia.org/wiki/ISO_10962
  string cfiCode = 8;

  /// Market currency code: http://en.wikipedia.org/wiki/ISO_4217
  string currencyCode = 9;

  // Market exchange code: http://en.wikipedia.org/wiki/ISO_10383
  // For inter-exchange spreads, use the leg MICs separated by a hyphen
  string exchangeCode = 10;

  /// Minimum price increment in market currency.
  float minimumPriceIncrement = 11;

  /// Contract point value in market currency.
  float contractPointValue = 12;

  /// Trading schedule for a typical week
  Schedule schedule = 13;

  /// Trading calendar (expiration, notice days, holidays?, etc)
  Calendar calendar = 14;

  /// UTC Timestamp of creation, nano seconds since Unix epoch
  sint64 recordCreateTime = 15;

  /// UTC Timestamp of update, nano seconds since Unix epoch
  sint64 recordUpdateTime = 16;

  /// Market time zone TZ database name.
  // Permanent. Can be resolved into timeZoneOffset for given date/time.
  // See http://joda-time.sourceforge.net/timezones.html
  // See http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  string timeZoneName = 17;

  /// Identifies a logical grouping of instruments. By product, for example.
  string instrumentGroup = 18;

  /// The Date of expiration for futures and options.
  MaturityDate symbolExpiration = 19;

  /// active: can have market state updates, can have historical data
  // passive: can NOT have market state updates, but can have historical data
  // normally "active" means newly listed or currently non expired markets
  // normally "passive" means expired options, de-listed equities, etc.
  State state = 20;

  /// The channel that updates for this instrument will appear on.
  sint32 channel = 21;

  /// The marketId of the underlying asset.
  // Used by Futures and Options when the underlying instrument is defined by the vendor
  sint64 underlyingMarketId = 22;

  /// Display format
  PriceFormat priceFormat = 23;

  /// Strike price display format
  PriceFormat optionStrikePriceFormat = 24;

  
  // Removed deprecated field 26
  // Removed deprecated field 27

  /// Divide prices by this value to get real price values
  sint32 priceDenominator = 28;
  
  /// Divide trade quantities by this value to get real quantities 
  sint32 quantityDenominator = 29;

   /// true if this is a tradable instrument
   bool isTradable = 30;

  /// UTC timestamp of transaction, nano seconds since Unix epoch
  sint64 transactionTime = 50;

  /// For internal use only.   Ignore
  bytes auxiliaryData = 99;

  /// List of alternate symbols for this instrument.  A single instrument
  // may be provided by many different market data vendors, each with
  // their own unique symbology. Allows this instrument to be tagged
  // with as many vendor symbols as necessary.
  repeated Symbol symbols = 100;

  // #############################################

  /// Option strike price in market currency.  Multiply by
  /// factorOptionsStrike to get actual strike
  sint64 optionStrike = 200;

  // Removed deprecated field 201

  /// Option type: call vs put.
  OptionType optionType = 202;

  /// Option style : American vs European.
  OptionStyle optionStyle = 203;
  
  /// Divide optionStrike by this value to get real strike price
   sint32 optionStrikeDenominator = 204;

  // #############################################

  /// Spread type, can be vendor specific
  string spreadCode = 210;

  /// Ordered list of underlying legs in a spread.
  repeated SpreadLeg spreadLeg = 211;

  /// true if user defined spread
  bool userDefinedSpread = 212;

  /// Listing market classification
  string marketTier = 213;

 /// Current financial status of the issuer
  string financialStatusIndicator = 214;

  /// ISIN: https://en.wikipedia.org/wiki/International_Securities_Identification_Number
  string isin = 215;

  /// Break out of currency pair
  CurrencyPair currencyPair = 216;

  /// true if exchange sends volume.
  bool exchangeSendsVolume = 217;

  /// true if exchange sends high.
  bool exchangeSendsHigh = 218;

  /// true if exchange sends low.
  bool exchangeSendsLow = 219;

  /// true if exchange sends open.
  bool exchangeSendsOpen = 220;

  /// true if this instrument represents consolidated NBBO.
  bool consolidatedFeedInstrument = 221;

  /// true if this instrument represents Pit symbol.
  bool openOutcryInstrument = 222;

  /// true if this instrument generated FX option.
  bool syntheticAmericanOptionInstrument = 223;

  ///
  string barchartExchangeCode = 224;
  /// 
  string barchartBaseCode = 225;
  ///
  sint32 volumeDenominator = 226;
  ///
  sint32 bidOfferQuantityDenominator = 227;
  ///
  string primaryListingMarketParticipantId= 228;
  ///
  string subscriptionSymbol= 229;

  /// The Month/ Day of expiration for futures and options. Corresponds to the expiration month.
  MaturityDate contractMaturity = 230;

  /// Barchart Underlying Symbol
  string underlying = 231;
  string commodity = 232;
  /// Barchart Exchange Id
  sint32 exchangeId = 233;
  /// Barchart Price Scaling Exponent
  sint32 priceScalingExponent = 234;
  /// The Openfeed marketId of the underlying asset.
  sint64 underlyingOpenfeedMarketId = 235;


  // #############################################
  enum InstrumentType {
    UNKNOWN_INSTRUMENT_TYPE = 0;
    FOREX = 1;
    INDEX = 2;
    EQUITY = 3;
    FUTURE = 4;
    OPTION = 5;
    SPREAD = 6;
    MUTUAL_FUND = 7;
    MONEY_MARKET_FUND = 8;
    USER_DEFINED_SPREAD = 9;
    EQUITY_OPTION = 10;
    OTHER = 99;
  }

  /// Market depth implementation type
  enum BookType {
    UNKNOWN_BOOK_TYPE = 0;
    // BBO
    TOP_OF_BOOK = 1;
    // Book uses price level
    PRICE_LEVEL_DEPTH = 2;
    // Book uses order-id
    ORDER_DEPTH = 3;
  }

  /// Option type.
  enum OptionType {
    UNKNOWN_OPTION_TYPE = 0;
    CALL = 1;
    PUT = 2;
  }

  /// Option style.
  enum OptionStyle {
    UNKNOWN_OPTIONS_STYLE = 0;
    DEFAULT = 1;
    AMERICAN = 2;
    EUROPEAN = 3;
  }

  enum State {
    UNKNOWN_STATE = 0;
    ACTIVE = 1;
    PASSIVE = 2;
  }

  /// Typical trading week schedule
  message Schedule {
    repeated TimeSpan sessions = 1;
  }

  /// Trading session
  // Times are in nanos since midnight UTC on the Sunday starting a given trading week
  message TimeSpan {
    sint64 timeStart = 1;
    sint64 timeFinish = 2;
  }

  message Calendar {
    repeated Event events = 1;
  }

  enum EventType {
    UNKNOWN_EVENT_TYPE = 0;
    // All instruments
    FIRST_TRADE_DATE = 1;
    LAST_TRADE_DATE = 2;

    // Futures only
    MATURITY_DATE = 10;
    FIRST_DELIVERY_DATE = 11;
    LAST_DELIVERY_DATE = 12;
    FIRST_NOTICE_DATE = 13;
    LAST_NOTICE_DATE = 14;
    FIRST_HOLDING_DATE = 15;
    LAST_HOLDING_DATE = 16;
    FIRST_POSITION_DATE = 17;
    LAST_POSITION_DATE = 18;

    // Grain Bids
    DELIVERY_START_DATE = 30;
    DELIVERY_END_DATE = 31;
  }

  message Event {
    EventType type = 1;
    /// Epoch time in ms
    sint64 date = 2;
  }

  message SpreadLeg {

    // The marketId of the leg
    sint64 marketId = 1;

    // The ratio of the this leg with respect to the spread.
    // Negative means short the absolute value, positive means long the absolute value.
    // FIXME? Alternatively, we could have separate LONG/SHORT indicator in the message
    // and use this field as only the absolute value
    sint32 ratio = 2;

    string symbol = 3;
    string longSymbol = 4;
    float legOptionDelta = 5;
    float legPrice = 6;
    // Additional information about the leg will be found in the instrument definition
    // for the leg.  It is not included here to reduce duplication.
  }

  /// Date and time with time zone.
  message MaturityDate {
    // Year of century.
    sint32 year = 1;
    // Month of year.
    sint32 month = 2;
    // Day of month.
    sint32 day = 3;
  }

  /// A vendor's symbol for an instrument
  message Symbol {
    // The vendor that provides this symbol.
    string vendor = 1;
    // The symbol assigned by the vendor.
    string symbol = 2;
    // The long symbol assigned by the vendor. Includes 2 char year for futures.
    string longSymbol = 3;
  }

  /// Recommended display format for prices.
  message PriceFormat {
    enum SubFormat {
      FLAT = 0;
      FRACTIONAL = 1;
      DECIMAL = 2;
    }

    bool isFractional = 1;
    sint32 denominator = 2;

    sint32 subDenominator = 4;

    SubFormat subFormat = 6;
  }

  /// Currency Pair
  message CurrencyPair {
  	string currency1 = 1;
  	string currency2 = 2;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy