JayBeams  0.1
Another project to have fun coding.
Classes | Public Attributes | Static Public Attributes | List of all members
jb::mktdata::inside_levels_update< N > Struct Template Reference

A message representing the top N levels of a market. More...

#include <inside_levels_update.hpp>

Classes

struct  annotations_type
 Annotations. More...
 

Public Attributes

boost::endian::little_uint16_buf_t message_type
 The message type, each message in JayBeams receives a unique identifier. More...
 
boost::endian::little_uint16_buf_t message_size
 The message size. More...
 
boost::endian::little_uint32_buf_t sequence_number
 The sequence number created by the feed handler. More...
 
market_id market
 The market this data refers to. More...
 
feed_id feed
 The name of the feed handler used to parse and generate this data. More...
 
timestamp feedhandler_ts
 The feedhandler (the software system that processes the feed and generated this message), timestamps the message just before sending it out. More...
 
feed_id source
 The source of the data within that feed, some feeds arbitrage between multiple sources for the same data. More...
 
timestamp exchange_ts
 Typically exchange feeds provide a timestamp (with feed-specific semantics) for the event in the exchange that generated a message. More...
 
timestamp feed_ts
 Typically each feed provides a timestamp (with feed-specific semantics) for the message, this may be different from the exchange timestamp. More...
 
security_id security
 The id of the security. More...
 
boost::endian::little_uint32_buf_t bid_qty [N]
 The bid quantities, in shares, can be 0 if the level does not exist or is not provided by the exchange. More...
 
boost::endian::little_uint32_buf_t bid_px [N]
 Bid prices, in descending order. More...
 
boost::endian::little_uint32_buf_t offer_qty [N]
 Offer quantities, in ascending order of prices. More...
 
boost::endian::little_uint32_buf_t offer_px [N]
 Offer prices, in ascending order. More...
 
annotations_type annotations
 The annotations field. More...
 

Static Public Attributes

static constexpr std::uint16_t mtype
 

Detailed Description

template<std::size_t N>
struct jb::mktdata::inside_levels_update< N >

A message representing the top N levels of a market.

Many applications need more information than is provided in a Level I (aka top of book) feed, but are easier to implement and support if they do not have the complexity of a Level II or Level III feed, where one needs to deal with stateful message streams.

This feed is a compromise, it is stateless, so simple to process, but it provides only the top N levels (typically 1, 4 or 8), so less information rich than a Level II or Level III feed. The assumption is that most of the information is in the top N levels anyway, so the loss is minimal.

It also tradesoff simplicity for heavier message payloads, which might be a problem in some applications.

Template Parameters
Nthe number of levels to support.

Definition at line 33 of file inside_levels_update.hpp.


Class Documentation

◆ jb::mktdata::inside_levels_update::annotations_type

struct jb::mktdata::inside_levels_update::annotations_type

template<std::size_t N>
struct jb::mktdata::inside_levels_update< N >::annotations_type

Annotations.

These annotations are optional, they may not appear in a production feed to minimize message size and processing time. On a development instance these will be populated with the human readable representation of several fields. The receiver can detect whether these fields are present using the message_size field at the beginning.

Definition at line 129 of file inside_levels_update.hpp.

Class Members
little_uint8_buf_t feed_name[feed_id::feed_name_size] The name of the feed.
little_uint8_buf_t mic[market_id::mic_size] The ISO-10383 market code.
little_uint8_buf_t security_feed[security_id::feed_size] The ticker as it appears in the feed.
little_uint8_buf_t security_normalized[security_id::normalized_size] The JayBeams normalized ticker for the security.
little_uint8_buf_t source_name[feed_id::feed_name_size] The name of the data source.

Member Data Documentation

◆ annotations

template<std::size_t N>
annotations_type jb::mktdata::inside_levels_update< N >::annotations

The annotations field.

Definition at line 143 of file inside_levels_update.hpp.

◆ bid_px

template<std::size_t N>
boost::endian::little_uint32_buf_t jb::mktdata::inside_levels_update< N >::bid_px[N]

Bid prices, in descending order.

For the US markets, JayBeams uses prices in multiples of $0.0001. Since the US markets do not allow quotes in smaller intervals this is has no loss of accuracy. The maximum quote value in the US markets is $200,000, so at the prescribed granularity this fits in a 32-bit integer. TODO() - we need to define how this works in other markets, it is likely that this would require 64-bit integers for Japan for example.

Definition at line 98 of file inside_levels_update.hpp.

◆ bid_qty

template<std::size_t N>
boost::endian::little_uint32_buf_t jb::mktdata::inside_levels_update< N >::bid_qty[N]

The bid quantities, in shares, can be 0 if the level does not exist or is not provided by the exchange.

The bid levels are in descending order of price.

Definition at line 84 of file inside_levels_update.hpp.

◆ exchange_ts

template<std::size_t N>
timestamp jb::mktdata::inside_levels_update< N >::exchange_ts

Typically exchange feeds provide a timestamp (with feed-specific semantics) for the event in the exchange that generated a message.

This field contains that timestamp.

Definition at line 71 of file inside_levels_update.hpp.

◆ feed

template<std::size_t N>
feed_id jb::mktdata::inside_levels_update< N >::feed

The name of the feed handler used to parse and generate this data.

Definition at line 57 of file inside_levels_update.hpp.

◆ feed_ts

template<std::size_t N>
timestamp jb::mktdata::inside_levels_update< N >::feed_ts

Typically each feed provides a timestamp (with feed-specific semantics) for the message, this may be different from the exchange timestamp.

Definition at line 76 of file inside_levels_update.hpp.

◆ feedhandler_ts

template<std::size_t N>
timestamp jb::mktdata::inside_levels_update< N >::feedhandler_ts

The feedhandler (the software system that processes the feed and generated this message), timestamps the message just before sending it out.

Definition at line 62 of file inside_levels_update.hpp.

◆ market

template<std::size_t N>
market_id jb::mktdata::inside_levels_update< N >::market

The market this data refers to.

Definition at line 53 of file inside_levels_update.hpp.

◆ message_size

template<std::size_t N>
boost::endian::little_uint16_buf_t jb::mktdata::inside_levels_update< N >::message_size

The message size.

While the size of the message is implicit in the C++ structure used to represent them, we include the message size

Definition at line 47 of file inside_levels_update.hpp.

◆ message_type

template<std::size_t N>
boost::endian::little_uint16_buf_t jb::mktdata::inside_levels_update< N >::message_type

The message type, each message in JayBeams receives a unique identifier.

Definition at line 39 of file inside_levels_update.hpp.

◆ mtype

template<std::size_t N>
constexpr std::uint16_t jb::mktdata::inside_levels_update< N >::mtype
static
Initial value:
=
u'I' << 8 | detail::levels_name<N>::name

Definition at line 34 of file inside_levels_update.hpp.

◆ offer_px

template<std::size_t N>
boost::endian::little_uint32_buf_t jb::mktdata::inside_levels_update< N >::offer_px[N]

Offer prices, in ascending order.

For the US markets, JayBeams uses prices in multiples of $0.0001. Since the US markets do not allow quotes in smaller intervals this is has no loss of accuracy. The maximum quote value in the US markets is $200,000, so at the prescribed granularity this fits in a 32-bit integer. TODO() - we need to define how this works in other markets, it is likely that this would require 64-bit integers for Japan for example. TODO() - likely this should be a message, like jb::mktdata::timestamp.

Definition at line 116 of file inside_levels_update.hpp.

◆ offer_qty

template<std::size_t N>
boost::endian::little_uint32_buf_t jb::mktdata::inside_levels_update< N >::offer_qty[N]

Offer quantities, in ascending order of prices.

Definition at line 101 of file inside_levels_update.hpp.

◆ security

template<std::size_t N>
security_id jb::mktdata::inside_levels_update< N >::security

The id of the security.

Definition at line 79 of file inside_levels_update.hpp.

◆ sequence_number

template<std::size_t N>
boost::endian::little_uint32_buf_t jb::mktdata::inside_levels_update< N >::sequence_number

The sequence number created by the feed handler.

Definition at line 50 of file inside_levels_update.hpp.

◆ source

template<std::size_t N>
feed_id jb::mktdata::inside_levels_update< N >::source

The source of the data within that feed, some feeds arbitrage between multiple sources for the same data.

Definition at line 66 of file inside_levels_update.hpp.


The documentation for this struct was generated from the following file: