Skip to content

Commit

Permalink
VER: Release 0.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
threecgreen authored Aug 24, 2023
2 parents d82b35b + d50fc39 commit e62d02e
Show file tree
Hide file tree
Showing 9 changed files with 1,236 additions and 6 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 0.12.0 - 2023-08-24

##### Enhancements
- Added the `Publisher`, `Venue`, and `Dataset` enums
- Added `Publisher` getters to `Record` and `RecordHeader` to convert the
`publisher_id` to its enum

## 0.11.0 - 2023-08-10

#### Enhancements
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.14)
# Project details
#

project("databento" VERSION 0.11.0 LANGUAGES CXX)
project("databento" VERSION 0.12.0 LANGUAGES CXX)
string(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPERCASE)

#
Expand Down
2 changes: 2 additions & 0 deletions cmake/SourcesAndHeaders.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ set(headers
include/databento/live_threaded.hpp
include/databento/log.hpp
include/databento/metadata.hpp
include/databento/publishers.hpp
include/databento/record.hpp
include/databento/symbology.hpp
include/databento/timeseries.hpp
Expand Down Expand Up @@ -46,6 +47,7 @@ set(sources
src/live_threaded.cpp
src/log.cpp
src/metadata.cpp
src/publishers.cpp
src/record.cpp
src/symbology.cpp
src/detail/file_stream.cpp
Expand Down
4 changes: 2 additions & 2 deletions include/databento/enums.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include <iosfwd>
#include <string>

#include "databento/publishers.hpp" // Dataset, Publisher, Venue, FromString

namespace databento {
// Represents a historical data center gateway location.
enum class HistoricalGateway : std::uint8_t {
Expand Down Expand Up @@ -286,8 +288,6 @@ std::ostream& operator<<(std::ostream& out, StatType stat_type);
std::ostream& operator<<(std::ostream& out,
StatUpdateAction stat_update_action);

template <typename T>
T FromString(const std::string& str);
template <>
Schema FromString(const std::string& str);
template <>
Expand Down
244 changes: 244 additions & 0 deletions include/databento/publishers.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,244 @@
#pragma once

#include <cstdint>
#include <iosfwd>
#include <string>

namespace databento {
// A trading execution venue.
enum class Venue : std::uint16_t {
// CME GLOBEX
Glbx = 1,
// NASDAQ
Xnas = 2,
// NASDAQ OMX BX
Xbos = 3,
// NASDAQ OMX PSX
Xpsx = 4,
// CBOE BZX U.S. EQUITIES EXCHANGE
Bats = 5,
// CBOE BYX U.S. EQUITIES EXCHANGE
Baty = 6,
// CBOE EDGA U.S. EQUITIES EXCHANGE
Edga = 7,
// CBOE EDGX U.S. EQUITIES EXCHANGE
Edgx = 8,
// New York Stock Exchange
Xnys = 9,
// NYSE NATIONAL, INC.
Xcis = 10,
// NYSE AMERICAN
Xase = 11,
// NYSE ARCA
Arcx = 12,
// NYSE CHICAGO, INC.
Xchi = 13,
// INVESTORS EXCHANGE
Iexg = 14,
// FINRA/NASDAQ TRF CARTERET
Finn = 15,
// FINRA/NASDAQ TRF CHICAGO
Finc = 16,
// FINRA/NYSE TRF
Finy = 17,
// MEMX LLC EQUITIES
Memx = 18,
// MIAX PEARL EQUITIES
Eprl = 19,
// NYSE AMERICAN OPTIONS
Amxo = 20,
// BOX OPTIONS EXCHANGE
Xbox = 21,
// CBOE OPTIONS EXCHANGE
Xcbo = 22,
// MIAX EMERALD
Emld = 23,
// Cboe EDGX Options Exchange
Edgo = 24,
// NASDAQ GEMX
Gmni = 25,
// NASDAQ ISE
Xisx = 26,
// NASDAQ MRX
Mcry = 27,
// MIAX INTERNATIONAL SECURITIES
Xmio = 28,
// NYSE ARCA OPTIONS
Arco = 29,
// OPRA
Opra = 30,
// MIAX PEARL
Mprl = 31,
// NASDAQ OPTIONS MARKET
Xndq = 32,
// NASDAQ BX OPTIONS
Xbxo = 33,
// CBOE C2 OPTIONS EXCHANGE
C2Ox = 34,
// NASDAQ PHLX
Xphl = 35,
// CBOE BZX Options Exchange
Bato = 36,
// MEMX Options Exchange
Mxop = 37,
};

// A source of data.
enum class Dataset : std::uint16_t {
// CME MDP 3.0 Market Data
GlbxMdp3 = 1,
// Nasdaq XNAS TotalView-ITCH
XnasItch = 2,
// Nasdaq XBOS TotalView-ITCH
XbosItch = 3,
// Nasdaq XPSX TotalView-ITCH
XpsxItch = 4,
// CBOE BZX
BatsPitch = 5,
// CBOE BYX
BatyPitch = 6,
// CBOE EDGA
EdgaPitch = 7,
// CBOE EDGX
EdgxPitch = 8,
// NYSE
XnysPillar = 9,
// NYSE National
XcisPillar = 10,
// NYSE American
XasePillar = 11,
// NYSE Chicago
XchiPillar = 12,
// NYSE National BBO
XcisBbo = 13,
// NYSE National TRADES
XcisTrades = 14,
// MEMX Memoir Depth
MemxMemoir = 15,
// MIAX Pearl Depth
EprlDom = 16,
// Finra/Nasdaq TRF
FinnNls = 17,
// Finra/NYSE TRF
FinyTrades = 18,
// OPRA Binary Recipient
OpraPillar = 19,
// Databento Equities Basic
DbeqBasic = 20,
// NYSE Arca
ArcxPillar = 21,
// Investors Exchange TOPS
IexgTops = 22,
};

// A specific Venue from a specific data source.
enum class Publisher : std::uint16_t {
// CME Globex MDP 3.0
GlbxMdp3Glbx = 1,
// Nasdaq TotalView ITCH
XnasItchXnas = 2,
// Nasdaq XBOS TotalView ITCH
XbosItchXbos = 3,
// Nasdaq XPSX TotalView ITCH
XpsxItchXpsx = 4,
// CBOE BZX
BatsPitchBats = 5,
// CBOE BYX
BatyPitchBats = 6,
// CBOE EDGA
EdgaPitchEdga = 7,
// CBOE EDGX
EdgxPitchEdgx = 8,
// NYSE
XnysPillarXnys = 9,
// NYSE National
XcisPillarXcis = 10,
// NYSE American
XasePillarXase = 11,
// NYSE Chicago
XchiPillarXchi = 12,
// NYSE National BBO
XcisBboXcis = 13,
// NYSE National Trades
XcisTradesXcis = 14,
// MEMX Memoir Depth
MemxMemoirMemx = 15,
// MIAX Pearl Depth
EprlDomEprl = 16,
// FINRA/NASDAQ TRF CARTERET
FinnNlsFinn = 17,
// FINRA/NASDAQ TRF CHICAGO
FinnNlsFinc = 18,
// FINRA/NYSE TRF
FinyTradesFiny = 19,
// OPRA - NYSE AMERICAN OPTIONS
OpraPillarAmxo = 20,
// OPRA - BOX OPTIONS EXCHANGE
OpraPillarXbox = 21,
// OPRA - CBOE OPTIONS EXCHANGE
OpraPillarXcbo = 22,
// OPRA - MIAX EMERALD
OpraPillarEmld = 23,
// OPRA - Cboe EDGX Options Exchange
OpraPillarEdgo = 24,
// OPRA - NASDAQ GEMX
OpraPillarGmni = 25,
// OPRA - NASDAQ ISE
OpraPillarXisx = 26,
// OPRA - NASDAQ MRX
OpraPillarMcry = 27,
// OPRA - MIAX INTERNATIONAL SECURITIES
OpraPillarXmio = 28,
// OPRA - NYSE ARCA OPTIONS
OpraPillarArco = 29,
// OPRA - OPRA
OpraPillarOpra = 30,
// OPRA - MIAX PEARL
OpraPillarMprl = 31,
// OPRA - NASDAQ OPTIONS MARKET
OpraPillarXndq = 32,
// OPRA - NASDAQ BX OPTIONS
OpraPillarXbxo = 33,
// OPRA - CBOE C2 OPTIONS EXCHANGE
OpraPillarC2Ox = 34,
// OPRA - NASDAQ PHLX
OpraPillarXphl = 35,
// OPRA - CBOE BZX Options Exchange
OpraPillarBato = 36,
// OPRA - MEMX OPTIONS EXCHANGE
OpraPillarMxop = 37,
// Investors Exchange TOPS
IexgTopsIexg = 38,
// DBEQ Basic - Nyse Chicago
DbeqBasicXchi = 39,
// DBEQ Basic - Nyse National
DbeqBasicXcis = 40,
// DBEQ Basic - Investors Exchange
DbeqBasicIexg = 41,
// DBEQ Basic - MIAX Pearl
DbeqBasicEprl = 42,
};

// Get a Publisher's Venue.
Venue PublisherVenue(Publisher publisher);

// Get a Publisher's Dataset.
Dataset PublisherDataset(Publisher publisher);

template <typename T>
T FromString(const std::string& str);
const char* ToString(Venue venue);
std::ostream& operator<<(std::ostream& out, Venue venue);
template <>
Venue FromString(const std::string& str);

const char* ToString(Dataset dataset);
std::ostream& operator<<(std::ostream& out, Dataset dataset);
template <>
Dataset FromString(const std::string& str);

const char* ToString(Publisher publisher);
std::ostream& operator<<(std::ostream& out, Publisher publisher);
template <>
Publisher FromString(const std::string& str);
} // namespace databento
11 changes: 9 additions & 2 deletions include/databento/record.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

#include "databento/datetime.hpp" // UnixNanos
#include "databento/enums.hpp"
#include "databento/flag_set.hpp" // FlagSet
#include "databento/flag_set.hpp" // FlagSet
#include "databento/publishers.hpp" // Publisher

namespace databento {
// Common data for all Databento Records.
Expand All @@ -21,14 +22,19 @@ struct RecordHeader {
std::uint8_t length;
// The record type.
RType rtype;
// The publisher ID assigned by Databento.
// The publisher ID assigned by Databento, which denotes the dataset and
// venue.
std::uint16_t publisher_id;
// The numeric ID assigned to the instrument.
std::uint32_t instrument_id;
// The exchange timestamp in UNIX epoch nanoseconds.
UnixNanos ts_event;

std::size_t Size() const;
// Retrieve the publisher based on the publisher ID.
enum Publisher Publisher() const {
return static_cast<enum Publisher>(publisher_id);
}
};

class Record {
Expand All @@ -37,6 +43,7 @@ class Record {

const RecordHeader& Header() const { return *record_; }
::databento::RType RType() const { return record_->rtype; }
enum Publisher Publisher() const { return Header().Publisher(); }

template <typename T>
bool Holds() const {
Expand Down
2 changes: 1 addition & 1 deletion pkg/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Maintainer: Databento <[email protected]>
_pkgname=databento-cpp
pkgname=databento-cpp-git
pkgver=0.11.0
pkgver=0.12.0
pkgrel=1
pkgdesc="Official C++ client for Databento"
arch=('any')
Expand Down
Loading

0 comments on commit e62d02e

Please sign in to comment.