Skip to content

Commit cf9a2a7

Browse files
authored
VER: Release 0.23.0
2 parents 9b72db6 + 71697a5 commit cf9a2a7

21 files changed

+205
-38
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## 0.23.0 - 2024-09-24
4+
5+
### Enhancements
6+
- Added new `Cmbp1Msg`
7+
- Added new consolidated publisher values for `XNAS.BASIC` and `DBEQ.MAX`
8+
9+
### Breaking changes
10+
- Changed the layout of `CbboMsg` to better match `BboMsg`
11+
- Renamed `Schema::Cbbo` to `Schema::Cmbp1`
12+
13+
### Deprecations
14+
- Deprecated `Packing::Tar` and renamed it to `TarDeprecated`. This variant will be
15+
removed in a future version when it is no longer supported by the API
16+
317
## 0.22.0 - 2024-08-27
418

519
### Enhancements

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.14)
44
# Project details
55
#
66

7-
project("databento" VERSION 0.22.0 LANGUAGES CXX)
7+
project("databento" VERSION 0.23.0 LANGUAGES CXX)
88
string(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPERCASE)
99

1010
#

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![test](https://github.com/databento/databento-cpp/actions/workflows/build.yaml/badge.svg?branch=main)](https://github.com/databento/databento-cpp/actions/workflows/build.yaml)
44
[![license](https://img.shields.io/github/license/databento/databento-cpp?color=blue)](./LICENSE)
5-
[![Slack](https://img.shields.io/badge/join_Slack-community-darkblue.svg?logo=slack)](http://to.dbn.to/slack)
5+
[![Slack](https://img.shields.io/badge/join_Slack-community-darkblue.svg?logo=slack)](https://to.dbn.to/slack)
66

77
The official C++ client library for [Databento](https://databento.com).
88
The client supports both streaming real-time and historical market data through similar interfaces.

include/databento/dbn.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ struct MappingInterval {
2020
date::year_month_day start_date;
2121
// The end date of the interval (exclusive).
2222
date::year_month_day end_date;
23+
// The resolved symbol for this interval (in `stype_out`).
2324
std::string symbol;
2425
};
2526

2627
struct SymbolMapping {
27-
// The raw symbol from the publisher.
28+
// The `stype_in` symbol.
2829
std::string raw_symbol;
29-
// The mappings of `native` for different date ranges.
30+
// The mappings of `raw_symbol` to `stype_out` for different date ranges.
3031
std::vector<MappingInterval> intervals;
3132
};
3233

include/databento/enums.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ enum class Schema : std::uint16_t {
3434
Statistics = 10,
3535
Status = 11,
3636
Imbalance = 12,
37-
Cbbo = 14,
37+
Cmbp1 = 14,
3838
Cbbo1S = 15,
3939
Cbbo1M = 16,
4040
Tcbbo = 17,
@@ -89,7 +89,7 @@ enum class SplitDuration : std::uint8_t {
8989
enum class Packaging : std::uint8_t {
9090
None = 0,
9191
Zip,
92-
Tar,
92+
TarDeprecated,
9393
};
9494

9595
// Represents how a batch job will be delivered.
@@ -139,7 +139,7 @@ enum RType : std::uint8_t {
139139
System = 0x17,
140140
Statistics = 0x18,
141141
Mbo = 0xA0,
142-
Cbbo = 0xB1,
142+
Cmbp1 = 0xB1,
143143
Cbbo1S = 0xC0,
144144
Cbbo1M = 0xC1,
145145
Tcbbo = 0xC2,

include/databento/publishers.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,10 @@ enum class Publisher : std::uint16_t {
353353
XcisBbotradesXcis = 91,
354354
// NYSE BBO and Trades
355355
XnysBbotradesXnys = 92,
356+
// Nasdaq Basic - Consolidated
357+
XnasBasicDbeq = 93,
358+
// DBEQ Max - Consolidated
359+
DbeqMaxDbeq = 94,
356360
};
357361

358362
// Get a Publisher's Venue.

include/databento/record.hpp

Lines changed: 50 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -254,36 +254,68 @@ using Bbo1MMsg = BboMsg;
254254
static_assert(alignof(BboMsg) == 8, "Must have 8-byte alignment");
255255
static_assert(sizeof(BboMsg) == sizeof(Mbp1Msg), "BboMsg size must match Rust");
256256

257+
struct Cmbp1Msg {
258+
static bool HasRType(RType rtype) {
259+
switch (rtype) {
260+
case RType::Cmbp1: // fallthrough
261+
case RType::Tcbbo:
262+
return true;
263+
default:
264+
return false;
265+
};
266+
}
267+
268+
UnixNanos IndexTs() const { return ts_recv; }
269+
270+
RecordHeader hd;
271+
std::int64_t price;
272+
std::uint32_t size;
273+
char action;
274+
Side side;
275+
FlagSet flags;
276+
char reserved1;
277+
UnixNanos ts_recv;
278+
TimeDeltaNanos ts_in_delta;
279+
std::array<char, 4> reserved2;
280+
std::array<ConsolidatedBidAskPair, 1> levels;
281+
};
282+
using TcbboMsg = Cmbp1Msg;
283+
static_assert(alignof(Cmbp1Msg) == 8, "Must have 8-byte alignment");
284+
static_assert(sizeof(Cmbp1Msg) ==
285+
sizeof(TradeMsg) + sizeof(ConsolidatedBidAskPair),
286+
"Cmbp1Msg size must match Rust");
287+
257288
struct CbboMsg {
258289
static bool HasRType(RType rtype) {
259290
switch (rtype) {
260-
case RType::Cbbo: // fallthrough
261291
case RType::Cbbo1S: // fallthrough
262292
case RType::Cbbo1M: // fallthrough
263-
case RType::Tcbbo:
264293
return true;
265294
default:
266295
return false;
267296
};
268297
}
298+
static_assert(alignof(Cmbp1Msg) == 8, "Must have 8-byte alignment");
299+
static_assert(sizeof(Cmbp1Msg) ==
300+
sizeof(TradeMsg) + sizeof(ConsolidatedBidAskPair),
301+
"Cmbp1Msg size must match Rust");
269302

270303
UnixNanos IndexTs() const { return ts_recv; }
271304

272305
RecordHeader hd;
273306
std::int64_t price;
274307
std::uint32_t size;
275-
Action action;
308+
char reserved1;
276309
Side side;
277310
FlagSet flags;
278-
char reserved;
311+
char reserved2;
279312
UnixNanos ts_recv;
280-
TimeDeltaNanos ts_in_delta;
281-
std::uint32_t sequence;
313+
std::array<char, 4> reserved3;
314+
std::array<char, 4> reserved4;
282315
std::array<ConsolidatedBidAskPair, 1> levels;
283316
};
284317
using Cbbo1SMsg = CbboMsg;
285318
using Cbbo1MMsg = CbboMsg;
286-
using TcbboMsg = CbboMsg;
287319
static_assert(alignof(CbboMsg) == 8, "Must have 8-byte alignment");
288320
static_assert(sizeof(CbboMsg) ==
289321
sizeof(TradeMsg) + sizeof(ConsolidatedBidAskPair),
@@ -604,12 +636,20 @@ inline bool operator!=(const BboMsg& lhs, const BboMsg& rhs) {
604636
return !(lhs == rhs);
605637
}
606638

607-
inline bool operator==(const CbboMsg& lhs, const CbboMsg& rhs) {
639+
inline bool operator==(const Cmbp1Msg& lhs, const Cmbp1Msg& rhs) {
608640
return lhs.hd == rhs.hd && lhs.price == rhs.price && lhs.size == rhs.size &&
609641
lhs.action == rhs.action && lhs.side == rhs.side &&
610642
lhs.flags == rhs.flags && lhs.ts_recv == rhs.ts_recv &&
611-
lhs.ts_in_delta == rhs.ts_in_delta && lhs.sequence == rhs.sequence &&
612-
lhs.levels == rhs.levels;
643+
lhs.ts_in_delta == rhs.ts_in_delta && lhs.levels == rhs.levels;
644+
}
645+
inline bool operator!=(const Cmbp1Msg& lhs, const Cmbp1Msg& rhs) {
646+
return !(lhs == rhs);
647+
}
648+
649+
inline bool operator==(const CbboMsg& lhs, const CbboMsg& rhs) {
650+
return lhs.hd == rhs.hd && lhs.price == rhs.price && lhs.size == rhs.size &&
651+
lhs.side == rhs.side && lhs.flags == rhs.flags &&
652+
lhs.ts_recv == rhs.ts_recv && lhs.levels == rhs.levels;
613653
}
614654
inline bool operator!=(const CbboMsg& lhs, const CbboMsg& rhs) {
615655
return !(lhs == rhs);

pkg/PKGBUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Maintainer: Databento <support@databento.com>
22
_pkgname=databento-cpp
33
pkgname=databento-cpp-git
4-
pkgver=0.22.0
4+
pkgver=0.23.0
55
pkgrel=1
66
pkgdesc="Official C++ client for Databento"
77
arch=('any')

src/enums.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ const char* ToString(Schema schema) {
6262
case Schema::Imbalance: {
6363
return "imbalance";
6464
}
65-
case Schema::Cbbo: {
66-
return "cbbo";
65+
case Schema::Cmbp1: {
66+
return "cmbp-1";
6767
}
6868
case Schema::Cbbo1S: {
6969
return "cbbo-1s";
@@ -188,7 +188,7 @@ const char* ToString(Packaging packaging) {
188188
case Packaging::Zip: {
189189
return "zip";
190190
}
191-
case Packaging::Tar: {
191+
case Packaging::TarDeprecated: {
192192
return "tar";
193193
}
194194
default: {
@@ -310,8 +310,8 @@ const char* ToString(RType rtype) {
310310
case RType::Mbo: {
311311
return "Mbo";
312312
}
313-
case RType::Cbbo: {
314-
return "Cbbo";
313+
case RType::Cmbp1: {
314+
return "Cmbp1";
315315
}
316316
case RType::Cbbo1S: {
317317
return "Cbbo1S";
@@ -933,8 +933,8 @@ Schema FromString(const std::string& str) {
933933
if (str == "imbalance") {
934934
return Schema::Imbalance;
935935
}
936-
if (str == "cbbo") {
937-
return Schema::Cbbo;
936+
if (str == "cmbp-1") {
937+
return Schema::Cmbp1;
938938
}
939939
if (str == "cbbo-1s") {
940940
return Schema::Cbbo1S;
@@ -1048,7 +1048,7 @@ Packaging FromString(const std::string& str) {
10481048
return Packaging::Zip;
10491049
}
10501050
if (str == "tar") {
1051-
return Packaging::Tar;
1051+
return Packaging::TarDeprecated;
10521052
}
10531053
throw InvalidArgumentError{"FromString<Packaging>", "str",
10541054
"unknown value '" + str + '\''};

src/publishers.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,12 @@ Venue PublisherVenue(Publisher publisher) {
787787
case Publisher::XnysBbotradesXnys: {
788788
return Venue::Xnys;
789789
}
790+
case Publisher::XnasBasicDbeq: {
791+
return Venue::Dbeq;
792+
}
793+
case Publisher::DbeqMaxDbeq: {
794+
return Venue::Dbeq;
795+
}
790796
default: {
791797
throw InvalidArgumentError{
792798
"PublisherVenue", "publisher",
@@ -1073,6 +1079,12 @@ Dataset PublisherDataset(Publisher publisher) {
10731079
case Publisher::XnysBbotradesXnys: {
10741080
return Dataset::XnysBbotrades;
10751081
}
1082+
case Publisher::XnasBasicDbeq: {
1083+
return Dataset::XnasBasic;
1084+
}
1085+
case Publisher::DbeqMaxDbeq: {
1086+
return Dataset::DbeqMax;
1087+
}
10761088
default: {
10771089
throw InvalidArgumentError{
10781090
"PublisherDataset", "publisher",
@@ -1360,6 +1372,12 @@ const char* ToString(Publisher publisher) {
13601372
case Publisher::XnysBbotradesXnys: {
13611373
return "XNYS.BBOTRADES.XNYS";
13621374
}
1375+
case Publisher::XnasBasicDbeq: {
1376+
return "XNAS.BASIC.DBEQ";
1377+
}
1378+
case Publisher::DbeqMaxDbeq: {
1379+
return "DBEQ.MAX.DBEQ";
1380+
}
13631381
default: {
13641382
return "Unknown";
13651383
}
@@ -1649,6 +1667,12 @@ Publisher FromString(const std::string& str) {
16491667
if (str == "XNYS.BBOTRADES.XNYS") {
16501668
return Publisher::XnysBbotradesXnys;
16511669
}
1670+
if (str == "XNAS.BASIC.DBEQ") {
1671+
return Publisher::XnasBasicDbeq;
1672+
}
1673+
if (str == "DBEQ.MAX.DBEQ") {
1674+
return Publisher::DbeqMaxDbeq;
1675+
}
16521676
throw InvalidArgumentError{"FromString<Publisher>", "str",
16531677
"unknown value '" + str + '\''};
16541678
}

0 commit comments

Comments
 (0)