Skip to content

Commit

Permalink
ADD: Add OPRA participant MIAX Sapphire
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack Culhane committed Dec 12, 2023
1 parent f339be9 commit 7fe6d99
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Enhancements
- Added `PitSymbolMap` helper for keeping track of symbology mappings in Live
- Added new publisher value for OPRA MIAX Sapphire

### Bug fixes
- Fixed misaligned read undefined behavior when decoding records
Expand Down
4 changes: 4 additions & 0 deletions include/databento/publishers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ enum class Venue : std::uint16_t {
Ndex = 39,
// Databento Equities - Consolidated
Dbeq = 40,
// MIAX Sapphire
Sphr = 41,
};

// A source of data.
Expand Down Expand Up @@ -273,6 +275,8 @@ enum class Publisher : std::uint16_t {
DbeqBasicDbeq = 59,
// DBEQ Plus - Consolidated
DbeqPlusDbeq = 60,
// OPRA - MIAX Sapphire
OpraPillarSphr = 61,
};

// Get a Publisher's Venue.
Expand Down
18 changes: 18 additions & 0 deletions src/publishers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ const char* ToString(Venue venue) {
case Venue::Dbeq: {
return "DBEQ";
}
case Venue::Sphr: {
return "SPHR";
}
default: {
return "Unknown";
}
Expand Down Expand Up @@ -264,6 +267,9 @@ Venue FromString(const std::string& str) {
if (str == "DBEQ") {
return Venue::Dbeq;
}
if (str == "SPHR") {
return Venue::Sphr;
}
throw InvalidArgumentError{"FromString<Venue>", "str",
"unknown value '" + str + '\''};
}
Expand Down Expand Up @@ -643,6 +649,9 @@ Venue PublisherVenue(Publisher publisher) {
case Publisher::DbeqPlusDbeq: {
return Venue::Dbeq;
}
case Publisher::OpraPillarSphr: {
return Venue::Sphr;
}
default: {
throw InvalidArgumentError{
"PublisherVenue", "publisher",
Expand Down Expand Up @@ -833,6 +842,9 @@ Dataset PublisherDataset(Publisher publisher) {
case Publisher::DbeqPlusDbeq: {
return Dataset::DbeqPlus;
}
case Publisher::OpraPillarSphr: {
return Dataset::OpraPillar;
}
default: {
throw InvalidArgumentError{
"PublisherDataset", "publisher",
Expand Down Expand Up @@ -1024,6 +1036,9 @@ const char* ToString(Publisher publisher) {
case Publisher::DbeqPlusDbeq: {
return "DBEQ.PLUS.DBEQ";
}
case Publisher::OpraPillarSphr: {
return "OPRA.PILLAR.SPHR";
}
default: {
return "Unknown";
}
Expand Down Expand Up @@ -1217,6 +1232,9 @@ Publisher FromString(const std::string& str) {
if (str == "DBEQ.PLUS.DBEQ") {
return Publisher::DbeqPlusDbeq;
}
if (str == "OPRA.PILLAR.SPHR") {
return Publisher::OpraPillarSphr;
}
throw InvalidArgumentError{"FromString<Publisher>", "str",
"unknown value '" + str + '\''};
}
Expand Down

0 comments on commit 7fe6d99

Please sign in to comment.