Skip to content

Commit 4b51f62

Browse files
authored
VER: Release 0.19.0
2 parents 6ced9b0 + 58cd635 commit 4b51f62

22 files changed

+411
-159
lines changed

.github/workflows/build.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ jobs:
2424
sudo apt-get install libpcre3 libpcre3-dev libzstd-dev ninja-build
2525
- name: Install cppcheck
2626
run: |
27-
git clone https://github.com/danmar/cppcheck.git
27+
git clone https://github.com/danmar/cppcheck.git --branch 2.14.1
2828
cd cppcheck
2929
cmake -S. -B build \
3030
-DCMAKE_BUILD_TYPE=Release \
31-
-DUSE_MATCHCOMPILER=On \
31+
-DUSE_MATCHCOMPILER=ON \
3232
-DHAVE_RULES=ON
33-
cmake --build build --config Release
33+
cmake --build build --config Release --parallel
3434
sudo cmake --install build --prefix /usr
3535
- name: Install gtest
3636
uses: MarkusJx/googletest-installer@v1.1
@@ -94,6 +94,6 @@ jobs:
9494
-DVCPKG_BUILD_TYPE=debug `
9595
-DDATABENTO_USE_EXTERNAL_GTEST=0
9696
- name: CMake build
97-
run: cmake --build build --parallel 10
97+
run: cmake --build build --parallel
9898
- name: Unit tests
9999
run: cd build && ctest --verbose --exclude-regex cmake

CHANGELOG.md

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

3+
## 0.19.0 - 2024-06-04
4+
5+
### Enhancements
6+
- Added configurable `heartbeat_interval` parameter for live clients that determines the
7+
timeout before heartbeat `SystemMsg` records will be sent. It can be configured via
8+
the `SetHeartbeatInterval` method of the `LiveBuilder`
9+
- Added `SetAddress` method to `LiveBuilder` for configuring a custom gateway address
10+
without using the constructor directly
11+
- Added new `UncrossingPrice` `StatType` variant
12+
- Added new publisher values for `XNAS.BASIC`
13+
- Added `SetDataset(Dataset)` overload to `LiveBuilder`
14+
- Added new off-market publisher values for `IFEU.IMPACT` and `NDEX.IMPACT`
15+
16+
### Breaking changes
17+
- Added `heartbeat_interval` parameter to the `Live` constructors
18+
- Removed `start_date` and `end_date` fields from `DatasetRange` struct
19+
in favor of `start` and `end`
20+
- Removed live `Subscribe` method overloads with `use_snapshot`
21+
parameter in favor of separate `SubscribeWithSnapshot` method
22+
23+
### Bug fixes
24+
- Fixed overloading of live `Subscribe` methods
25+
- Fixed live subscribing with default-constructed `UnixNanos`
26+
- Fixed descriptions for `FINN` and `FINY` publishers.
27+
328
## 0.18.1 - 2024-05-22
429

530
### 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.18.1 LANGUAGES CXX)
7+
project("databento" VERSION 0.19.0 LANGUAGES CXX)
88
string(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPERCASE)
99

1010
#

include/databento/enums.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ namespace stat_type {
232232
// The type of statistic contained in a StatMsg.
233233
enum StatType : std::uint16_t {
234234
// The price of the first trade of an instrument. `price` will be set.
235+
// `quantity` will be set when provided by the venue.
235236
OpeningPrice = 1,
236237
// The probable price of the first trade of an instrument published during
237238
// pre-open. Both `price` and `quantity` will be set.
@@ -265,6 +266,7 @@ enum StatType : std::uint16_t {
265266
// be set.
266267
FixingPrice = 10,
267268
// The last trade price during a trading session. `price` will be set.
269+
// `quantity` will be set when provided by the venue.
268270
ClosePrice = 11,
269271
// The change in price from the close price of the previous trading session to
270272
// the most recent trading session. `price` will be set.
@@ -279,6 +281,12 @@ enum StatType : std::uint16_t {
279281
// The option delta associated with the settlement price. `price` will be set
280282
// with the standard precision.
281283
Delta = 15,
284+
// The auction uncrossing price. This is used for auctions that are neither
285+
// the
286+
// official opening auction nor the official closing auction. `price` will be
287+
// set. `quantity` will be set when provided by the venue.
288+
UncrossingPrice = 16,
289+
282290
};
283291
} // namespace stat_type
284292
using stat_type::StatType;

include/databento/live.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#pragma once
22

3+
#include <chrono>
34
#include <string>
45

56
#include "databento/enums.hpp" // VersionUpgradePolicy
67
#include "databento/live_blocking.hpp"
78
#include "databento/live_threaded.hpp"
9+
#include "databento/publishers.hpp"
810

911
namespace databento {
1012
class ILogReceiver;
@@ -22,13 +24,18 @@ class LiveBuilder {
2224
LiveBuilder& SetKeyFromEnv();
2325
LiveBuilder& SetKey(std::string key);
2426
LiveBuilder& SetDataset(std::string dataset);
27+
LiveBuilder& SetDataset(Dataset dataset);
2528
// Whether to append the gateway send timestamp after each DBN message.
2629
LiveBuilder& SetSendTsOut(bool send_ts_out);
2730
// Set the version upgrade policy for when receiving DBN data from a prior
2831
// version. Defaults to upgrading to DBNv2 (if not already).
2932
LiveBuilder& SetUpgradePolicy(VersionUpgradePolicy upgrade_policy);
3033
// Sets the receiver of the logs to be used by the client.
3134
LiveBuilder& SetLogReceiver(ILogReceiver* log_receiver);
35+
// Overrides the heartbeat interval.
36+
LiveBuilder& SetHeartbeatInterval(std::chrono::seconds heartbeat_interval);
37+
// Overrides the gateway and port. This is an advanced method.
38+
LiveBuilder& SetAddress(std::string gateway, std::uint16_t port);
3239
// Attempts to construct an instance of a blocking live client or throws an
3340
// exception.
3441
LiveBlocking BuildBlocking();
@@ -40,9 +47,12 @@ class LiveBuilder {
4047
void Validate();
4148

4249
ILogReceiver* log_receiver_{};
50+
std::string gateway_{};
51+
std::uint16_t port_{};
4352
std::string key_;
4453
std::string dataset_;
4554
bool send_ts_out_{false};
4655
VersionUpgradePolicy upgrade_policy_{VersionUpgradePolicy::Upgrade};
56+
std::chrono::seconds heartbeat_interval_{};
4757
};
4858
} // namespace databento

include/databento/live_blocking.hpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <chrono> // milliseconds
55
#include <cstdint>
66
#include <string>
7+
#include <utility> // pair
78
#include <vector>
89

910
#include "databento/datetime.hpp" // UnixNanos
@@ -22,10 +23,12 @@ class ILogReceiver;
2223
class LiveBlocking {
2324
public:
2425
LiveBlocking(ILogReceiver* log_receiver, std::string key, std::string dataset,
25-
bool send_ts_out, VersionUpgradePolicy upgrade_policy);
26+
bool send_ts_out, VersionUpgradePolicy upgrade_policy,
27+
std::chrono::seconds heartbeat_interval);
2628
LiveBlocking(ILogReceiver* log_receiver, std::string key, std::string dataset,
2729
std::string gateway, std::uint16_t port, bool send_ts_out,
28-
VersionUpgradePolicy upgrade_policy);
30+
VersionUpgradePolicy upgrade_policy,
31+
std::chrono::seconds heartbeat_interval);
2932
/*
3033
* Getters
3134
*/
@@ -36,6 +39,11 @@ class LiveBlocking {
3639
std::uint16_t Port() const { return port_; }
3740
bool SendTsOut() const { return send_ts_out_; }
3841
VersionUpgradePolicy UpgradePolicy() const { return upgrade_policy_; }
42+
// The the first member of the pair will be true, when the heartbeat interval
43+
// was overridden.
44+
std::pair<bool, std::chrono::seconds> HeartbeatInterval() const {
45+
return {heartbeat_interval_.count() > 0, heartbeat_interval_};
46+
}
3947

4048
/*
4149
* Methods
@@ -50,8 +58,8 @@ class LiveBlocking {
5058
SType stype_in, UnixNanos start);
5159
void Subscribe(const std::vector<std::string>& symbols, Schema schema,
5260
SType stype_in, const std::string& start);
53-
void Subscribe(const std::vector<std::string>& symbols, Schema schema,
54-
SType stype_in, bool use_snapshot);
61+
void SubscribeWithSnapshot(const std::vector<std::string>& symbols,
62+
Schema schema, SType stype_in);
5563
// Notifies the gateway to start sending messages for all subscriptions.
5664
//
5765
// This method should only be called once per instance.
@@ -95,6 +103,7 @@ class LiveBlocking {
95103
bool send_ts_out_;
96104
std::uint8_t version_{};
97105
VersionUpgradePolicy upgrade_policy_;
106+
std::chrono::seconds heartbeat_interval_;
98107
detail::TcpClient client_;
99108
// Must be 8-byte aligned for records
100109
alignas(RecordHeader) std::array<char, kMaxStrLen> read_buffer_{};

include/databento/live_threaded.hpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <functional> // function
55
#include <memory> // unique_ptr
66
#include <string>
7+
#include <utility> // pair
78
#include <vector>
89

910
#include "databento/datetime.hpp" // UnixNanos
@@ -31,10 +32,12 @@ class LiveThreaded {
3132
std::function<ExceptionAction(const std::exception&)>;
3233

3334
LiveThreaded(ILogReceiver* log_receiver, std::string key, std::string dataset,
34-
bool send_ts_out, VersionUpgradePolicy upgrade_policy);
35+
bool send_ts_out, VersionUpgradePolicy upgrade_policy,
36+
std::chrono::seconds heartbeat_interval);
3537
LiveThreaded(ILogReceiver* log_receiver, std::string key, std::string dataset,
3638
std::string gateway, std::uint16_t port, bool send_ts_out,
37-
VersionUpgradePolicy upgrade_policy);
39+
VersionUpgradePolicy upgrade_policy,
40+
std::chrono::seconds heartbeat_interval);
3841
LiveThreaded(const LiveThreaded&) = delete;
3942
LiveThreaded& operator=(const LiveThreaded&) = delete;
4043
LiveThreaded(LiveThreaded&& other) noexcept;
@@ -51,6 +54,9 @@ class LiveThreaded {
5154
std::uint16_t Port() const;
5255
bool SendTsOut() const;
5356
VersionUpgradePolicy UpgradePolicy() const;
57+
// The the first member of the pair will be true, when the heartbeat interval
58+
// was overridden.
59+
std::pair<bool, std::chrono::seconds> HeartbeatInterval() const;
5460

5561
/*
5662
* Methods
@@ -65,8 +71,8 @@ class LiveThreaded {
6571
SType stype_in, UnixNanos start);
6672
void Subscribe(const std::vector<std::string>& symbols, Schema schema,
6773
SType stype_in, const std::string& start);
68-
void Subscribe(const std::vector<std::string>& symbols, Schema schema,
69-
SType stype_in, bool use_snapshot);
74+
void SubscribeWithSnapshot(const std::vector<std::string>& symbols,
75+
Schema schema, SType stype_in);
7076
// Notifies the gateway to start sending messages for all subscriptions.
7177
// `metadata_callback` will be called exactly once, before any calls to
7278
// `record_callback`. `record_callback` will be called for records from all

include/databento/metadata.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ struct DatasetConditionDetail {
3232
};
3333

3434
struct DatasetRange {
35-
std::string start_date;
36-
std::string end_date;
35+
std::string start;
36+
std::string end;
3737
};
3838

3939
inline bool operator==(const PublisherDetail& lhs, const PublisherDetail& rhs) {
@@ -71,7 +71,7 @@ inline bool operator!=(const DatasetConditionDetail& lhs,
7171
}
7272

7373
inline bool operator==(const DatasetRange& lhs, const DatasetRange& rhs) {
74-
return lhs.start_date == rhs.start_date && lhs.end_date == rhs.end_date;
74+
return lhs.start == rhs.start && lhs.end == rhs.end;
7575
}
7676
inline bool operator!=(const DatasetRange& lhs, const DatasetRange& rhs) {
7777
return !(lhs == rhs);

include/databento/publishers.hpp

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ enum class Venue : std::uint16_t {
9191
Sphr = 41,
9292
// Long-Term Stock Exchange, Inc.
9393
Ltse = 42,
94+
// Off-Exchange Transactions - Listed Instruments
95+
Xoff = 43,
9496
};
9597

9698
// A source of data.
@@ -155,6 +157,8 @@ enum class Dataset : std::uint16_t {
155157
NdexImpact = 29,
156158
// Databento Equities Max
157159
DbeqMax = 30,
160+
// Nasdaq Basic (NLS+QBBO)
161+
XnasBasic = 31,
158162
};
159163

160164
// A specific Venue from a specific data source.
@@ -265,9 +269,9 @@ enum class Publisher : std::uint16_t {
265269
DbeqPlusXnas = 52,
266270
// DBEQ Plus - NYSE
267271
DbeqPlusXnys = 53,
268-
// DBEQ Plus - FINRA/NYSE TRF
269-
DbeqPlusFinn = 54,
270272
// DBEQ Plus - FINRA/Nasdaq TRF Carteret
273+
DbeqPlusFinn = 54,
274+
// DBEQ Plus - FINRA/NYSE TRF
271275
DbeqPlusFiny = 55,
272276
// DBEQ Plus - FINRA/Nasdaq TRF Chicago
273277
DbeqPlusFinc = 56,
@@ -293,9 +297,9 @@ enum class Publisher : std::uint16_t {
293297
DbeqMaxXnas = 66,
294298
// DBEQ Max - NYSE
295299
DbeqMaxXnys = 67,
296-
// DBEQ Max - FINRA/NYSE TRF
297-
DbeqMaxFinn = 68,
298300
// DBEQ Max - FINRA/Nasdaq TRF Carteret
301+
DbeqMaxFinn = 68,
302+
// DBEQ Max - FINRA/NYSE TRF
299303
DbeqMaxFiny = 69,
300304
// DBEQ Max - FINRA/Nasdaq TRF Chicago
301305
DbeqMaxFinc = 70,
@@ -319,6 +323,16 @@ enum class Publisher : std::uint16_t {
319323
DbeqMaxArcx = 79,
320324
// DBEQ Max - Long-Term Stock Exchange
321325
DbeqMaxLtse = 80,
326+
// Nasdaq Basic - Nasdaq
327+
XnasBasicXnas = 81,
328+
// Nasdaq Basic - FINRA/Nasdaq TRF Carteret
329+
XnasBasicFinn = 82,
330+
// Nasdaq Basic - FINRA/Nasdaq TRF Chicago
331+
XnasBasicFinc = 83,
332+
// ICE Futures Europe - Off-Market Trades
333+
IfeuImpactXoff = 84,
334+
// ICE Endex - Off-Market Trades
335+
NdexImpactXoff = 85,
322336
};
323337

324338
// Get a Publisher's Venue.

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.18.1
4+
pkgver=0.19.0
55
pkgrel=1
66
pkgdesc="Official C++ client for Databento"
77
arch=('any')

0 commit comments

Comments
 (0)