DEV-6443 - Implement ECB ESTR support in MarketDataProviders#8
Draft
lbrame-fairmat wants to merge 15 commits intofairmat:masterfrom
Draft
DEV-6443 - Implement ECB ESTR support in MarketDataProviders#8lbrame-fairmat wants to merge 15 commits intofairmat:masterfrom
lbrame-fairmat wants to merge 15 commits intofairmat:masterfrom
Conversation
…le due to internal contraints
…on, at least to some extent (some redundancy is still left between blocking and async versions)
lbrame-fairmat
commented
Mar 17, 2026
|
|
||
| namespace EuropeanCentralBankIntegration.Estr | ||
| { | ||
| [Mono.Addins.Extension("/Fairmat/MarketDataProvider")] |
Author
There was a problem hiding this comment.
This class might be redundant because it maps itself to the same Mono plugin as EuropeanCentralBankExchangeIntegration/EuropeanCentralBankIntegration.cs, maybe on second thought it might be a better idea to integrate this logic on the pre-exeisting one
…rs.Tests/EuropeanCentralBankIntegration/IntegrationTests/EstrApiClientIntegrationTest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This Merge Request adds support for downloading €STR (Euro short-term Rate) data from the European Central Bank REST API endpoints.
Organization
The new logic is available in the
EuropeanCentralBankIntegration.Estrnamespace. The choice was made not to extend the pre-existing classes because there were next to no re-usable components there, and the code had not been touched for over 10 years. The old APIs dealt with SOAP/XML APIs, while the new Estr integration consumes RESTful APIs set to directly return a CSV payload.Classes
EuropeanCentralBankExchangeIntegration/Estr/EuropeanCentralBankEstrIntegration.csis the entry point for the data ingestion process. This class implements the usualDVPLIinterfaces and it should be compatible with Fairmat's existing pipeline (WIP: Needs to be confirmed still). For external users,DVPLIis not free software, so you probably don't really care about this class beyond seeing what methods of the API client it calls. AssumeDVPLIjust exposes some simple types you can probably quickly re-implement yourself in this case. Technically, this is a Mono plugin.EuropeanCentralBankExchangeIntegration/Estr/Api/EuropeanCentralBankEstrApiClient.csis the API client. This class is needed to request the ESTR data from the correct endpoint. It consumes the parser to parse the CSV into an intermediate representation.EuropeanCentralBankExchangeIntegration/Estr/Constants/DataPortal.csincludes constants containing all the different data portals one might want to download data from using the ECB REST API. For now, only one (the main one for this data type) is implemented, but this class should make it easier to refactor and extend this development in the future, although it is a bit redundant in its current state.EuropeanCentralBankExchangeIntegration/Estr/Dto/EstrQuoteDto.csis a strongly-typed intermediate representation that corresponds to one line of the CSV requested from the API. It gets returned by the parser, and objects of this type get used as input to construct the specific FairmatDVPLIobjects for data ingestion.EuropeanCentralBankExchangeIntegration/Estr/Enums/SupportedCurrencies.csis an enumerator enumerating all supported currencies. Only EUR is supported in this state. Same rationale as the constants class above - it should be here for future extensibility.EuropeanCentralBankExchangeIntegration/Estr/Exceptions/CsvParsingException.cs- Simple exception to signal that something has gone wrong with the CSV parsing process in particular.EuropeanCentralBankExchangeIntegration/Estr/Parsing/EstrParser.cs- Collection of methods that are used to parse the CSV intoEstrQuoteDtointermediate objects, and filter API requests by date to obtain a time series result.Tests
Some tests have been added to help development, debugging and to help catch regressions. They are mostly integration tests, but there are some unit tests for those methods of the Integration class that should just return a static result:
MarketDataProviders.Tests/EuropeanCentralBankIntegration/Estr/UnitTests/EstrIntegrationUnitTest.cs.It should prove useful, in future developments, to add a mocking library suck as
NSubstituteto the solution to allow testing the API client in a less flaky way, mocking the API response instead of relying on a value that is there in the response today but that might not be there tomorrow.Currently available tests are:
MarketDataProviders.Tests/EuropeanCentralBankIntegration/Estr/IntegrationTests/EstrApiClientIntegrationTest.cs- Integration tests for the API clientMarketDataProviders.Tests/EuropeanCentralBankIntegration/Estr/IntegrationTests/EstrIntegrationIntegrationTest.cs- Integration tests for the DVPLI pluginMarketDataProviders.Tests/EuropeanCentralBankIntegration/Estr/IntegrationTests/EstrParserFilterIntegrationTest.cs- Specifically tests the parser method to extract one or more DTOs from a parsed response within a certain time periodMarketDataProviders.Tests/EuropeanCentralBankIntegration/Estr/UnitTests/EstrIntegrationUnitTest.cs- Tests for the DVPLI Integration plugin class that could not reasonably be considered integration testsNext steps
Before moving on, I still need to solve the following todos: