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

openfeed-client.1.0.16.source-code.openfeed.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;

import "openfeed_instrument.proto";

// /////////////////////////////////////////////////////////////////
// Enums
// /////////////////////////////////////////////////////////////////

/// Book side
enum BookSide {
  UNKNOWN_BOOK_SIDE = 0;
  BID = 1;
  OFFER = 2;
}

enum InstrumentTradingStatus {
  UNKNOWN_TRADING_STATUS = 0;
  TRADING_RESUME = 1;
  PRE_OPEN = 2;
  OPEN = 3;
  PRE_CLOSE = 4;
  CLOSE = 5;
  TRADING_HALT = 6;
  QUOTATION_RESUME = 7;
  OPEN_DELAY = 8;
  NO_OPEN_NO_RESUME = 9;
  FAST_MARKET = 10;
  FAST_MARKET_END = 11;
  LATE_MARKET = 12;
  LATE_MARKET_END = 13;
  POST_SESSION = 14;
  POST_SESSION_END = 15;
  NEW_PRICE_INDICATION = 16;
  NOT_AVAILABLE_FOR_TRADING = 17;
  PRE_CROSS = 18;
  CROSS = 19;
  POST_CLOSE = 20;
  NO_CHANGE = 21;
  NAFT = 22; // Not available for trading.
  TRADING_RANGE_INDICATION = 23;
  MARKET_IMBALANCE_BUY = 24;
  MARKET_IMBALANCE_SELL = 25;
  MOC_IMBALANCE_BUY = 26; // Market On Close Imbalance Buy
  MOC_IMBALANCE_SELL = 27;
  NO_MARKET_IMBALANCE = 28;
  NO_MOC_IMBALANCE = 29;
  SHORT_SELL_RESTRICTION = 30;
  LIMIT_UP_LIMIT_DOWN = 31;
}

enum RegulationSHOShortSalePriceTest {
  UNKNOWN_PRICE_TEST = 0;
  PRICE_TEST_NONE = 1;
  PRICE_TEST_IN_EFFECT = 2;
  PRICE_TEST_REMAINS_IN_EFFECT = 3;
}

enum SettlementTerms {
  UNKNOWN_SETTLEMENT_TERMS = 0;
  CASH = 1;
  NON_NET = 2;
  CONTINGENT_TRADE = 3;
  CASH_TODAY = 4;
  DATE = 5;
}

enum CrossType {
  UNKNOWN_CROSS_TYPE = 0;
  DEFAULT = 1;
  INTERNAL = 2;
  BASIS = 3;
  CONTINGENT = 4;
  SPECIAL = 5;
  VWAP = 6;
  REGULAR = 7;
}

enum OpenCloseSettlementFlag {
  UNKNOWN = 0;
  DAILY_OPEN = 1;
  INDICATIVE_OPEN_PRICE = 2;
}

enum SettlementSource {
  UNKNOWN_SETTLEMENT_SOURCE = 0;
  GLOBEX = 1;
  ITC = 2;
  MANUAL = 3;
}

enum Service {
  UNKNOWN_SERVICE = 0;
  REAL_TIME = 1;
  DELAYED = 2;
  REAL_TIME_SNAPSHOT = 3;
  DELAYED_SNAPSHOT = 4;
  END_OF_DAY = 5;
}

enum MarketWideStatus {
   STATUS_UNKNOWN = 0;
   STATUS_START_OF_DAY = 1;
   STATUS_END_OF_DAY = 2;
   STATUS_OPEN = 3;
   STATUS_CLOSE = 4;
}

// /////////////////////////////////////////////////////////////////
// Messages
// /////////////////////////////////////////////////////////////////

/// A wrapper for Openfeed data.  Will contain exactly one of the supported
// message types
message OpenfeedMessage {
  /// Nano second unix epoch at time of message transmission (UTC)
  sint64 sendingTime = 1;
  /// The total number of markets available on this channel
  // at the time the message was sent.  For UDP snapshot and definition feeds.
  sint32 totalCount = 2;
  /// The most recent packet sequence number sent on the incremental feed
  // at the time this message was sent.  For UDP snapshot and definition feeds.
  int64 syncSequence  = 3;
  // Feed specific context data
  Context context = 4;
  oneof data {
    ChannelReset channelReset = 10;
    HeartBeat heartBeat = 11;
    AdminMessage adminMessage = 12;
    InstrumentDefinition instrumentDefinition = 13;
    InstrumentGroupStatus instrumentGroupStatus = 14;
    MarketSnapshot marketSnapshot = 15;
    MarketUpdate marketUpdate = 16;
    MarketStatus marketStatus = 17;
    EODCommoditySummary eodCommoditySummary = 18;
    InstrumentAction instrumentAction = 19;
  }
}

// Channel Reset
message ChannelReset {
  sint32 channel = 1;
  sint64 transactionTime = 2;
}

/// Heart Beat
message HeartBeat {
  /// UTC timestamp of transaction, nano seconds since Unix epoch
  sint64 transactionTime = 1;
  string status = 2;
  bool exchange = 3;
  sint32 channel = 4;
  
}

// Administrative Message
message AdminMessage {
  // Origination time = UTC timestamp nano seconds since Unix epoch
  sint64 originationTime = 1;
  string source = 2;
  string languageCode = 3;
  string headLine = 4;
  string text = 5;
  enum Status {
     OK = 0;
  }
  Status status = 6;
  sint32 channel = 7;
}

/// Instrument Group Status
message InstrumentGroupStatus {
  /// UTC Timestamp of transaction, nano seconds since Unix epoch
  sint64 transactionTime = 1;
  string instrumentGroupId = 2;
  InstrumentTradingStatus tradingStatus = 3;
  sint32 tradeDate = 4;
  sint32 channel = 5;
}

/// Market Status
message MarketStatus {
  /// UTC Timestamp of transaction, nano seconds since Unix epoch
  sint64 transactionTime = 1;
  sint32 channel = 2;
  MarketWideStatus marketWideStatus = 3;
}

/// EOD commodity summary. Used to represent consolidated total values for the group of contracts. Total volume for
/// all ES futures, for example.
message EODCommoditySummary {
  /// Trade date in the format YYYYMMDD
  sint32 tradeDate = 1;
  /// Contract root, for example ES.
  string contractRoot = 2;
  /// Consolidated volume.
  sint64 consolidatedVolume = 3;
  // Consolidated open interest.
  sint64 consolidatedOpenInterest = 4;
  /// For internal use only.   Ignore
  bytes auxiliaryData = 99;
}

/// Session used in snapshot.
message MarketSession {
  /// Date only, format 2012-07-04 -> 20120704
  sint32 tradeDate = 4;
  /// Most recent opening price
  Open open = 30;
  /// High price for the trading session
  High high = 31;
  /// Low price for the trading session
  Low low = 32;
  /// Most recent traded price and quantity
  Last last = 35;
  /// Total traded volume
  Volume volume = 38;
  /// Most recent settlement price
  Settlement settlement = 39;
  /// Most recent settlement price
  Settlement prevSettlement = 44;
  /// Most recent open interest
  OpenInterest openInterest = 40;
  /// Number of trades
  NumberOfTrades numberOfTrades = 41;
  /// Monetary value
  MonetaryValue monetaryValue = 42;
  // UTC Timestamp, nano seconds since Unix epoch
  sint64 transactionTime = 43;
}

/// Snapshot for a market
message MarketSnapshot {
  /// Unique id identifying the market
  sint64 marketId = 1;
  // UTC Timestamp of transaction, nano seconds since Unix epoch
  sint64 transactionTime = 2;
  // Instrument level sequence number
  int64 marketSequence  = 3;
  /// Date only, format 2012-07-04 -> 20120704
  sint32 tradeDate = 4;
  /// A snapshot with market depth may exceed the maximum message size.
  //  In that case, the snapshot will be broken up across multiple
  //  snapshot messages.
  sint32 totalChunks = 5;
  sint32 currentChunk = 6;
  // Optional symbol identifier
  string symbol = 7;
  /// Divide prices by this value to get real price values.  Optional, use value
  /// from InstrumentDefinition if not set.
  sint32 priceDenominator = 8;
  // 
  Service service = 9;
  // 
  InstrumentStatus instrumentStatus = 10;
  // Best Bid Offer
  BestBidOffer bbo = 11;
  // Index Value
  IndexValue index = 12;
  // Price Level Book
  repeated AddPriceLevel priceLevels = 13;
  // Order Book
  repeated AddOrder orders = 14;
  News news = 15;
  /// Most recent opening price
  Open open = 30;
  /// High price for the trading session
  High high = 31;
  /// Low price for the trading session
  Low low = 32;
  /// Most recent closing price
  Close close = 33;
  /// Previous closing price
  PrevClose prevClose = 34;
  /// Most recent traded price and quantity
  Last last = 35;
  /// Year high price
  YearHigh yearHigh = 36;
  /// Year low price
  YearLow yearLow = 37;
  /// Total traded volume
  Volume volume = 38;
  /// Most recent settlement price
  Settlement settlement = 39;
  /// Most recent open interest
  OpenInterest openInterest = 40;
  /// Most recent volume weighted average price
  Vwap vwap = 41;
  DividendsIncomeDistributions dividendsIncomeDistributions = 42;
  NumberOfTrades numberOfTrades = 43;
  MonetaryValue monetaryValue = 44;
  CapitalDistributions capitalDistributions = 45;
  SharesOutstanding sharesOutstanding = 46;
  NetAssetValue netAssetValue = 47;
  /// Previous session.
  MarketSession previousSession = 48;
  /// 'T' session.
  MarketSession tSession = 49;
  /// Volume at price. Used by the market state/ JERQ.
  VolumeAtPrice volumeAtPrice = 50;
  HighRolling highRolling = 51;
  LowRolling lowRolling = 52;
  /// 'Z' session. Includes all trades, even the ones that do not update Last.
  MarketSession zSession = 53;
}

enum SnapshotRequestResult {
  SNAPSHOT_REQUEST_UNKNOWN_RESULT = 0;
  SNAPSHOT_REQUEST_SUCCESS = 1;
  SNAPSHOT_REQUEST_NOT_FOUND = 2;
  SNAPSHOT_REQUEST_SERVICE_NOT_AVAILABLE = 3;
  SNAPSHOT_REQUEST_GENERIC_FAILURE = 4;
}

// Used by market state to return snapshot.
message MarketSnapshotResponse {
  SnapshotRequestResult result = 1;
  string message = 2;
  MarketSnapshot marketSnapshot = 3;
}

//
// Market Update for an instrument
//
message MarketUpdate {
  /// Unique id identifying the market
  sint64 marketId = 1;
  // Optional symbol identifier
  string symbol = 2;
  /// UTC Timestamp of transaction, nano seconds since Unix epoch
  /// This is usually the execution venue timestamp.
  sint64 transactionTime = 3;
  /// Distribution time in nano seconds since epoch.
  sint64 distributionTime = 4;
  /// Market level sequencing number
  sint64 marketSequence = 5;
  /// Data source sequence number
  sint64 sourceSequence = 6;
  // Market participant/originator
  bytes originatorId = 7;
  /// The consolidated messages are the default.  Regional exchanges will have regional = true
  /// deprecated bool consolidated = 8;
  reserved 8;
  /// Divide prices by this value to get real price values.  Optional, use value
  /// from InstrumentDefinition if not set.
  sint32 priceDenominator = 9;
  // Feed specific context data set as required.
  Context context = 10;
  /// Current session. This is used to 'enhance' updates from the translator in the Market State
  MarketSession session = 11;
  /// 'T' session. This is used to 'enhance' updates from the translator in the Market State
  MarketSession tSession = 12;
  /// Previous session. This is used to 'enhance' updates from the translator in the Market State
  MarketSession previousSession = 13;
  /// True if message applies to regional/participant member
  bool regional = 14;
  /// 'Z' session. Includes all trades, even the ones that do not update Last.
  MarketSession zSession = 15;

  oneof data {
      News news = 20;
      ClearBook clearBook = 21;
      InstrumentStatus instrumentStatus = 22;
      BestBidOffer bbo = 23;
      DepthPriceLevel depthPriceLevel = 24;
      DepthOrder depthOrder = 25;
      IndexValue index = 26;
      Trades trades = 27;
      Open open = 28;
      High high = 29;
      Low low = 30;
      Close close = 31;
      PrevClose prevClose = 32;
      Last last = 33;
      YearHigh yearHigh = 34;
      YearLow yearLow = 35;
      Volume volume = 36;
      Settlement settlement = 37;
      OpenInterest openInterest = 38;
      Vwap vwap = 39;
      DividendsIncomeDistributions dividendsIncomeDistributions = 40;
      NumberOfTrades numberOfTrades = 41;
      MonetaryValue monetaryValue = 42;
      CapitalDistributions capitalDistributions = 43;
      SharesOutstanding sharesOutstanding = 44;
      NetAssetValue netAssetValue = 45;
      MarketSummary marketSummary = 46;
      HighRolling highRolling = 47;
      LowRolling lowRolling = 48;
      RequestForQuote requestForQuote = 49;
  }
}

/// Depth Price Level
message DepthPriceLevel {
	repeated Entry levels = 1;
	message Entry {
		oneof data {
			AddPriceLevel addPriceLevel = 1;
			DeletePriceLevel deletePriceLevel = 2;
			ModifyPriceLevel modifyPriceLevel = 3;
		}
	}
}

/// Depth By Order
message DepthOrder {
	repeated Entry orders = 1;
	message Entry {
		oneof data {
			AddOrder addOrder = 1;
			DeleteOrder deleteOrder = 2;
			ModifyOrder modifyOrder = 3;
		}
	}
}

/// News or informational message
message News {
  // Origination time = UTC timestamp nano seconds since Unix epoch
  sint64 originationTime = 1;
  string source = 2;
  string languageCode = 3;
  string headLine = 4;
  string text = 5;
  repeated string symbols = 6;
}

/// Clear all data from the order books that are configured for this market.
message ClearBook {
  sint32 reserved = 1;
  sint64 transactionTime = 2;
}

//
// Instrument Status
//
message InstrumentStatus {
  // UTC Timestamp, nano seconds since Unix epoch
  sint64 transactionTime = 9;
  InstrumentTradingStatus tradingStatus = 10;
  // UTC Timestamp, nano seconds since Unix epoch
  sint64 openingTime = 11;
  string note = 12;
  /// Date only, format 2012-07-04 -> 20120704
  sint32 tradeDate = 13;
  RegulationSHOShortSalePriceTest regulationSHOShortSalePriceTest = 14;
}

/// Best Bid and Offer.
/// If a side is not present, then that side has been deleted.
/// By default this value is the NBBO, if regional/participant quote then regional = true
message BestBidOffer {
  // UTC Timestamp, nano seconds since Unix epoch
  sint64 transactionTime = 9;
  /// Divide by priceDenominator
  sint64 bidPrice = 10;
  /// Divide by quantityDenominator
  sint64 bidQuantity = 11;
  sint32 bidOrderCount = 12;
  /// Liquidity provider information
  // For Forex: BANK:CITY
  // For Equities: EXCHANGE_MIC
  bytes bidOriginator = 13;
  bytes bidQuoteCondition = 14;
  /// Divide by priceDenominator
  sint64 offerPrice = 20;
  /// Divide by quantityDenominator
  sint64 offerQuantity = 21;
  sint32 offerOrderCount = 22;
  /// Liquidity provider information
  // For Forex: BANK:CITY
  // For Equities: EXCHANGE_MIC
  bytes offerOriginator = 23;
  bytes offerQuoteCondition = 24;
  bytes quoteCondition = 30;
  /// By default this BBO is the NBBO
  /// Deprecated bool nationalBboUpdated = 31;
  reserved 31;
  /// True if regional/participant member quote
  bool regional = 32;
  /// True if not persisted in the EOD database.
  bool transient = 33;
}

/// Insert a new price level, pushing existing levels down
message AddPriceLevel {
  // UTC Timestamp, nano seconds since Unix epoch
  sint64 transactionTime = 9;
  /// price level index, starting at 1
  sint32 level = 10;
  BookSide side = 11;
  /// Divide by priceDenominator
  sint64 price = 12;
  /// Divide by quantityDenominator
  sint64 quantity = 13;
  sint32 orderCount = 14;
  sint64 impliedQuantity = 15;
}

/// Delete an existing price level, pulling existing levels up
message DeletePriceLevel {
  // UTC Timestamp, nano seconds since Unix epoch
  sint64 transactionTime = 9;
  /// price level index, starting at 1
  sint32 level = 10;
  BookSide side = 11;
}

/// Modify the quantity or orderCount of an existing price level.
/// The price itself will not change.
message ModifyPriceLevel {
  // UTC Timestamp, nano seconds since Unix epoch
  sint64 transactionTime = 9;
  /// price level index, starting at 1
  sint32 level = 10;
  BookSide side = 11;
  /// Divide by priceDenominator
  sint64 price = 12;
  /// Divide by quantityDenominator
  sint64 quantity = 13;
  sint32 orderCount = 14;
  sint64 impliedQuantity = 15;
}

// Add an order to the order book.  Indexed by orderId, which is unique per channel
message AddOrder {
  sint64 transactionTime = 9;
  sint64 orderId = 10;
  BookSide side = 11;
  sint64 price = 12;
  sint64 quantity = 13;
  bool isImplied = 14;
  sint64 priority = 15;
}

/// Delete an order from the order book. Indexed by orderId, which is unique per channel
message DeleteOrder {
  sint64 transactionTime = 9;
  sint64 orderId = 10;
  BookSide side = 11;
}

/// Modify the price or quantity of an order.  The side and implied flag cannot change 
message ModifyOrder {
  sint64 transactionTime = 9;
  sint64 orderId = 10;
  BookSide side = 11;
  sint64 price = 12;
  sint64 quantity = 13;
  bool isImplied = 14;
  sint64 priority = 15;
}

/// For non-tradable index products
message IndexValue {
  // UTC Timestamp, nano seconds since Unix epoch
  sint64 transactionTime = 9;
  // Date only, format 2012-07-04 -> 20120704
  sint32 tradeDate = 10;
  sint64 last = 11;
  sint64 volume = 12;
  sint64 open = 13;
  sint64 settlementOpen = 14;
  sint64 specialOpen = 15;
  sint64 high = 16;
  sint64 low = 17;
  sint64 close = 18;
  sint64 bid = 19;
  sint64 offer = 20;
}

/// Trades
message Trades {
	repeated Entry trades = 1;
	message Entry {
		oneof data {
			Trade trade = 1;
			TradeCorrection tradeCorrection = 2;
			TradeCancel tradeCancel = 3;
		}
	}
}

/// A live trade.  When received, update the "last" field
message Trade {
  // Market participant/originator
  bytes originatorId = 8;
  // UTC Timestamp, nano seconds since Unix epoch
  sint64 transactionTime = 9;
  /// Divide by priceDenominator
  sint64 price = 10;
  /// Divide by quantityDenominator
  sint64 quantity = 11;
  bytes tradeId = 12;
  /// The side of the aggressing order that caused the trade
  BookSide side = 13;
  /// Date only, format 2012-07-04 -> 20120704
  sint32 tradeDate = 14;
  bytes buyerId = 15;
  bytes sellerId = 16;
  bool openingTrade = 17;
  bool systemPriced = 18;
  bool marketOnClose = 19;
  bool oddLot = 20;
  SettlementTerms settlementTerms = 21;
  CrossType crossType = 22;
  bool byPass = 23;
  sint64 lastPrice = 24;
  bytes saleCondition = 25;
  string currency = 26;
  // Does not update Last
  bool doesNotUpdateLast = 27;
  // Does not update Volume
  bool doesNotUpdateVolume = 28;
  string session = 30;
  // Is this a block trade.
  bool blockTrade = 31;
  /// Distribution time in nano seconds since epoch.
  sint64 distributionTime = 32;
  /// time in nano seconds since epoch.
  sint64 transactionTime2 = 33;
  string consolidatedPriceIndicator = 34;
  /// True if not persisted in the EOD database.
  bool transient = 35;
  /// Index short name used to identify index.
  string indexShortName = 36;
}

///  Trade Correction
message TradeCorrection {
  // Market participant/originator
  bytes originatorId = 8;
  sint64 transactionTime = 9;
  // Corrected Price
  sint64 price = 10;
  // Corrected Quantity
  sint64 quantity = 11;
  bytes tradeId = 12;
  BookSide side = 13;
  // Date only, format 2012-07-04 -> 20120704
  sint32 tradeDate = 14;
  bytes buyerId = 15;
  bytes sellerId = 16;
  bool openingTrade = 17;
  bool systemPriced = 18;
  bool marketOnClose = 19;
  bool oddLot = 20;
  SettlementTerms settlementTerms = 21;
  CrossType crossType = 22;
  bool byPass = 23;
  bytes originalTradeId = 24;
  bytes saleCondition = 25;
  string currency = 26;
   /// Distribution time in nano seconds since epoch.
  sint64 distributionTime = 27;
  /// time in nano seconds since epoch.
  sint64 transactionTime2 = 28;
  // Original Price
  sint64 originalTradePrice = 29;
  // Original Quantity
  sint64 originalTradeQuantity = 30;
}

//
// Trade Cancel/Break
//
message TradeCancel {
  // Market participant/originator
  bytes originatorId = 8;
  sint64 transactionTime = 9;
  sint64 correctedTradePrice = 10;
  sint64 correctedTradeQuantity = 11;
  bytes tradeId = 12;
  bytes saleCondition = 13;
  string currency = 14;
   /// Distribution time in nano seconds since epoch.
  sint64 distributionTime = 15;
  /// time in nano seconds since epoch.
  sint64 transactionTime2 = 16;
}

message Open {
  sint64 transactionTime = 9;
  /// Date only, format 2012-07-04 -> 20120704
  sint32 tradeDate = 10;
  /// Divide by priceDenominator
  sint64 price = 11;
  OpenCloseSettlementFlag OpenCloseSettlementFlag = 12;
  string currency = 13;
}

message High {
  sint64 transactionTime = 9;
  /// Date only, format 2012-07-04 -> 20120704
  sint32 tradeDate = 10;
  /// Divide by priceDenominator
  sint64 price = 11;
  string currency = 12;
}

// 24 hour rolling window
message HighRolling {
  sint64 transactionTime = 9;
  /// Date only, format 2012-07-04 -> 20120704
  sint32 tradeDate = 10;
  /// Divide by priceDenominator
  sint64 price = 11;
  string currency = 12;
}

message Low {
  sint64 transactionTime = 9;
  /// Date only, format 2012-07-04 -> 20120704
  sint32 tradeDate = 10;
  /// Divide by priceDenominator
  sint64 price = 11;
  string currency = 12;
}

// 24 hour rolling window
message LowRolling {
  sint64 transactionTime = 9;
  /// Date only, format 2012-07-04 -> 20120704
  sint32 tradeDate = 10;
  /// Divide by priceDenominator
  sint64 price = 11;
  string currency = 12;
}

message Close {
  sint64 transactionTime = 9;
  /// Date only, format 2012-07-04 -> 20120704
  sint32 tradeDate = 10;
  /// Divide by priceDenominator
  sint64 price = 11;
  string currency = 12;
}
message PrevClose {
  sint64 transactionTime = 9;
  /// Date only, format 2012-07-04 -> 20120704
  sint32 tradeDate = 10;
  /// Divide by priceDenominator
  sint64 price = 11;
  string currency = 12;
}

message Last {
  sint64 transactionTime = 9;
  /// Date only, format 2012-07-04 -> 20120704
  sint32 tradeDate = 10;
  /// Divide by priceDenominator
  sint64 price = 11;
  /// Divide by quantityDenominator
  sint64 quantity = 12;
  string currency = 13;
  string session = 30;
}

/// 52 week
message YearHigh {
  sint64 transactionTime = 9;
  /// Divide by priceDenominator
  sint64 price = 10;
  string currency = 11;
}

/// 52 week
message YearLow {
  sint64 transactionTime = 9;
  /// Divide by priceDenominator
  sint64 price = 10;
  string currency = 11;
}

/// Total volume traded
message Volume {
  sint64 transactionTime = 9;
  /// Date only, format 2012-07-04 -> 20120704
  sint32 tradeDate = 10;
  // Total volume traded.
  sint64 volume = 11;
}

/// Total number of trades
message NumberOfTrades {
  sint64 transactionTime = 9;
  /// Date only, format 2012-07-04 -> 20120704
  sint32 tradeDate = 10;
  sint64 numberTrades = 11;
}

/// Total monetary value of trades
message MonetaryValue {
  sint64 transactionTime = 9;
  /// Date only, format 2012-07-04 -> 20120704
  sint32 tradeDate = 10;
  /// 2 decimals of precision
  sint64 value = 11;
  string valueCurrencyCode = 12;
}

//// Settlement value for futures and options markets.
message Settlement {
  sint64 transactionTime = 9;
  /// Date only, format 2012-07-04 -> 20120704
  sint32 tradeDate = 10;
  /// Divide by priceDenominator
  sint64 price = 11;
  bool preliminarySettle = 12;
  string currency = 13;
  SettlementSource settlementSource = 14;
  /// Used by CME ITC.
  string session = 15;
  /// True if not persisted in the EOD database.
  bool transient = 16;
  /// Reserved
  bool reserved = 127;
}

/// Open interest
message OpenInterest {
  sint64 transactionTime = 9;
  // Date only, format 2012-07-04 -> 20120704
  sint32 tradeDate = 10;
  sint64 volume = 11;
}

/// Volume Weighted Average Price
message Vwap {
  sint64 transactionTime = 9;
  // Date only, format 2012-07-04 -> 20120704
  sint32 tradeDate = 10;
  sint64 vwap = 11;
}

/// Dividends and Income Distributions
message DividendsIncomeDistributions {
  sint64 transactionTime = 6;
  string instrumentType = 7;
  // Corporate Action
  string corporateAction = 8;
  // Distribution Type
  string distributionType = 9;
  // Date only, format 2012-07-04 -> 20120704
  sint32 payableDate = 10;
  sint32 recordDate = 11;
  sint32 exDividendDate = 12;
  // Cash amount of distribution
  sint64 amount = 13;
  string currencyCode = 14;
  repeated string notes = 15;
  //
  sint64 totalCashDistribution = 16;
  sint64 nonQualifiedCashDistribution = 17;
  sint64 qualifiedCashDistribution = 18;
  sint64 taxFreeCashDistribution = 19;
  sint64 ordinaryForeignTaxCredit = 20;
  sint64 qualifiedForeignTaxCredit = 21;
  sint64 stockDividendRatio = 22;
  //
  sint32 reinvestDate = 23;
}

/// Capital Distributions
message CapitalDistributions {
  sint64 transactionTime = 8;
  string instrumentType = 9;
  // Corporate Action
  string corporateAction = 10;
  // Date only, format 2012-07-04 -> 20120704
  sint32 payableDate = 11;
  sint32 recordDate = 12;
  sint32 exDate = 13;
  // Distributions
  sint64 shortTermCapitalGain = 14;
  sint64 longTermCapitalGain = 15;
  sint64 unallocatedDistributions = 16;
  sint64 returnOfCapital = 17;
  string currencyCode = 18;
  repeated string notes = 19;
  //
  sint32 reinvestDate = 20;
}

//
message SharesOutstanding {
  sint64 sharesOutstanding = 1;
  sint64 transactionTime = 2;
}

//
message NetAssetValue {
  sint64 netAssetValue = 1;
  sint64 transactionTime = 2;
}


/// Intra and EOD Market Summary
message MarketSummary {
  sint64 transactionTime = 1;
  /// Date only, format 2012-07-04 -> 20120704
  sint32 tradingDate = 2;
  bool startOfDay = 3;
  bool endOfDay = 4;
  ClearSet clear = 5;
  //
  InstrumentStatus instrumentStatus = 9;
  BestBidOffer bbo = 10;
  Open open = 11;
  High high = 12;
  Low low = 13;
  Close close = 14;
  PrevClose prevClose = 15;
  Last last = 16;
  Volume volume = 17;
  Settlement settlement = 18;
  OpenInterest openInterest = 19;
  Vwap vwap = 20;
  // Clears sets of fields
  enum ClearSet {
  	  NONE = 0;
	  ALL = 1;
	  BA = 2;
	  CUSTOM_1 = 3;
  }
  /// Used by CME ITC.
  string session = 21;

  /// Used to differentiate various ddf messages.
  enum SummaryType {
    // DDF 2/1 Exchange refresh
    EXCHANGE_REFRESH = 0;
    // DDF 2/6 Live Prices refresh
    REFRESH_LIVE_PRICE = 1;
    // DDF 3/C end-of-day commodity prices
    EOD_COMMODITY_PRICES = 2;
    // DDF 3/S end-of-day stock and forex prices and volume
    EOD_STOCK_FOREX_PRICES = 3;
    // DDF 3/I end-of-day commodity volume and open interest message
    EOD_COMMODITY_STATS = 4;
  }
  SummaryType summaryType = 22;
  /// Total traded volume for the prior day.
  Volume prevVolume = 23;
  /// True if not persisted in the EOD database.
  bool transient = 24;
}


message Context {
  repeated ContextData data = 1;
  repeated TracePoint tracePoints = 2;
}
message ContextData {
  string id = 1;
  oneof data {
	  string vstring = 5;
	  bytes  vbytes = 6;
	  bool   vbool = 7;
	  sint32 vsint32 = 8;
	  sint64 vsint64 = 9;
	  float  vfloat = 10;
	  double vdouble = 11;
  }
}
// Tracing
message TracePoint {
  string id = 1;
  string componentId = 2;
  sint64 timestampNs = 3;
  int32  componentLatencyNs = 4;
}

// TCP replay request.
message TCPHistoricalReplayRequest {
  int32 channel = 1;
  int32 resetNumber = 2;
  
  int64 sequence  = 3;
  int32 count  = 4;
  string requestId = 5;
}

/// Request for the snapshot to the Market state.
message SnapshotRequest {
  int32 channel = 1;
  int32 resetNumber = 2;
  string requestId = 3;
  enum SnapshotRequestType {
    ALL = 0;
    QUOTE = 1;
    DEPTH = 2;
    VOLUME_AT_PRICE = 3;
  }
  repeated SnapshotRequestType snapshotRequestTypes = 4;
}

/// The VolumeAtPrice class encapsulates all of the trades throughout the day,
/// and organizes a table of volume at prices.
message VolumeAtPrice {
  sint64 marketId = 1;
  string symbol = 2;
  /// UTC Timestamp of transaction, nano seconds since Unix epoch
  sint64 transactionTime = 3;
  sint64 lastPrice = 4;
  sint64 lastQuantity = 5;
  sint64 lastCumulativeVolume = 6;
  /// Date only, format 2012-07-04 -> 20120704
  sint32 tradeDate = 7;
  repeated PriceLevelVolume priceVolumes = 8;
  
  message PriceLevelVolume {
    sint64 price = 1;
    sint64 volume = 2;
  }
}

/// Open,High,Low,Close
message Ohlc {
  sint64 marketId = 1;
  string symbol = 2;
  Open open = 3;
  High high = 4;
  Low low = 5;
  Close close = 6;
  /// Sum of volume
  sint64 volume = 7;
  /// Sum of price volume using normalized price
  double priceVolume = 8;
  sint64 numberTrades = 9;
  sint32 tradeDate = 10;
  /// UTC Timestamp, nano seconds since Unix epoch
  sint64 transactionTime = 11;
  /// Trade Ids used in this OHLC
  repeated string tradeIds = 12;
  sint64 openStartTime = 13;
  sint64 closeEndTime = 14;
}

/// Instrument Actions
enum ActionType {
   UNKNOWN_ACTION = 0;
   LISTING = 1;
   DELISTING = 2;
   EXCHANGE_MOVE = 3;
   ALIAS_CHANGED = 4;
}
/// Instrument Action
message InstrumentAction {
  sint64 transactionTime = 1;
  sint32 tradeDate = 2;
  ActionType action = 3;
  string message = 4;
  string oldAlias = 5;
  InstrumentDefinition instrument = 10;
  InstrumentDefinition newInstrument = 11;
}

/// Request For Quote
message RequestForQuote {
  string quoteRequestId = 1;
  string symbol = 2;
  sint64 securityId = 3;
  sint32 orderQuantity = 4;
  sint32 quoteType = 5;
  sint32 side = 6;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy