Artesian.SDK 7.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package Artesian.SDK --version 7.0.2
                    
NuGet\Install-Package Artesian.SDK -Version 7.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Artesian.SDK" Version="7.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Artesian.SDK" Version="7.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Artesian.SDK" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Artesian.SDK --version 7.0.2
                    
#r "nuget: Artesian.SDK, 7.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=Artesian.SDK&version=7.0.2
                    
Install Artesian.SDK as a Cake Addin
#tool nuget:?package=Artesian.SDK&version=7.0.2
                    
Install Artesian.SDK as a Cake Tool

image

Artesian.SDK

This Library provides read access to the Artesian API

Getting Started

Installation

This library is provided in NuGet.

Support for .NET Standard 2.0 and NET 8.

In the Package Manager Console -

Install-Package Artesian.SDK

or download directly from NuGet.

How to use

The Artesian.SDK instance can be configured using either Client credentials or API-Key authentication

//API-Key
ArtesianServiceConfig cfg = new ArtesianServiceConfig(
   new Uri("https://fake-artesian-env/"),
   "5418B0DB-7AB9-4875-81BA-6EE609E073B6"
   );

//Client credentials
ArtesianServiceConfig cfg = new ArtesianServiceConfig(
		new Uri("https://fake-artesian-env/"),
		"audience",
		"domain",
		"client_id",
		"client_secret"
		);

BREAKING CHANGES: Upgrade v4->v5

The following breaking changes has been introduced in v5 respect to v4.

Update of GME PublicOffer to V2.0

With the introduction of the MI-XBID market on the GME Public Offers data has been increased the api version With a version before v5 of the SDK it will be not possible to download the MI-XBID data

The new market in the class GME_Enums --> Market is MIXBID

Changes on fields

The following fields are now nullable. It will be always valorized for Makret except MIXBID

        //Can be NULL for XBID, never NULL otherwise
        public string Unit { get; set; }
		
        //Can be NULL for XBID, never NULL otherwise
        public decimal? MeritOrder { get; set; }

        //Can be NULL for XBID, never NULL otherwise
        public bool? PartialQuantityAccepted { get; set; }

        //Can be NULL for XBID, never NULL otherwise
        public decimal? ADJQuantity { get; set; }

        //Can be NULL for XBID, never NULL otherwise
        public decimal? ADJEnergyPrice { get; set; }

        //Can be NULL for XBID, never NULL otherwise
        public int? Quarter { get; set; }

        //Can be NULL for XBID, never NULL otherwise
        public decimal? AwardedPrice { get; set; }

The following fields are new.

        //Added for XBID, NULL otherwise
        public LocalDateTime? Timestamp { get; set; }

        //Added for XBID, NULL otherwise
        public decimal? PrezzoUnitario { get; set; }

QueryService

Using the ArtesianServiceConfig we create an instance of the QueryService which is used to create Actual, Versioned and Market Assessment time series queries

Policy configuration

Optionally a custom policy can be introduced to configure policy constraints within the QueryService otherwise default policy is implemented

ArtesianPolicyConfig policy = new ArtesianPolicyConfig();
	policy
	    .RetryPolicyConfig(retryCount: 3, retryWaitTime: 200)
	    .CircuitBreakerPolicyConfig(maxExceptions: 2, durationOfBreak: 3)
	    .BulkheadPolicyConfig(maxParallelism: 10, maxQueuingActions: 15);

var qs = new QueryService(cfg, policy);

<table> <tr><th>Policies</th><th>Description</th></tr> <tr><td>Wait & Retry Policy</td><td>Retry, waiting a specified duration between each retry</td></tr> <tr><td>Circuit Breaker Policy</td><td>The CircuitBreakerPolicy instance maintains internal state across calls to track failures</td></tr> <tr><td>Bulkhead Policy</td><td>The bulkhead isolation policy assigns operations to constrained resource pools, such that one faulting channel of actions cannot swamp all resource</td></tr> </table>

Partition Strategy

Requests are partitioned by an IPartitionStrategy, optionally an IPartitionStrategy can be passed to use a certain partition
strategy. A partition strategy by ID is implemented by default

PartitionByIDStrategy idStrategy = new PartitionByIDStrategy();
var act = qs.CreateActual(idStrategy)
       .ForMarketData(new int[] { 100000001 })
       .InGranularity(Granularity.Day)
       .InRelativeInterval(RelativeInterval.RollingMonth)
       .ExecuteAsync().Result;

<table> <tr><th>Partition Strategies</th><th>Description</th></tr> <tr><td>Partition by ID</td><td>Requests are partitioned into groups of ID's by a defined partition size </td></tr> </table>

Actual Time Series

var actualTimeSeries = await qs.CreateActual()
                .ForMarketData(new int[] { 100000001, 100000002, 100000003 })
                .InGranularity(Granularity.Day)
                .InAbsoluteDateRange(new LocalDate(2018,08,01),new LocalDate(2018,08,10))
                .ExecuteAsync();

To construct an Actual Time Series the following must be provided.

<table> <tr><th>Actual Query</th><th>Description</th></tr> <tr><td>Market Data ID</td><td>Provide a market data id or set of market data id's to query</td></tr> <tr><td>Time Granularity</td><td>Specify the granularity type</td></tr> <tr><td>Time Extraction Window</td><td>An extraction time window for data to be queried</td></tr> </table>

Go to Time Extraction window section

Market Assessment Time Series

var marketAssesmentSeries = await qs.CreateMarketAssessment()
                       .ForMarketData(new int[] { 100000001 })
                       .ForProducts(new string[] { "M+1", "GY+1" })
                       .InRelativeInterval(RelativeInterval.RollingMonth)
                       .ExecuteAsync();

To construct a Market Assessment Time Series the following must be provided.

<table> <tr><th>Market Assessment Query</th><th>Description</th></tr> <tr><td>Market Data ID</td><td>Provide a market data id or set of market data id's to query</td></tr> <tr><td>Product</td><td>Provide a product or set of products</td></tr> <tr><td>Time Extraction Window</td><td>An extraction time window for data to be queried </td></tr> </table>

Go to Time Extraction window section

Auction Time Series

var marketAssesmentSeries = await qs.CreateAuction()
                       .ForMarketData(new int[] { 100000001 })
                       .InAbsoluteDateRange(new LocalDate(2018,08,01),new LocalDate(2018,08,10))
                       .ExecuteAsync();

To construct an Auction Time Series the following must be provided.

Auction Query Description
Market Data ID Provide a market data id or set of market data id's to query
Time Extraction Window An extraction time window for data to be queried

Go to Time Extraction window section

Versioned Time Series

 var versionedSeries = await qs.CreateVersioned()
		.ForMarketData(new int[] { 100000001 })
		.InGranularity(Granularity.Day)
		.ForLastOfMonths(Period.FromMonths(-4))
		.InRelativeInterval(RelativeInterval.RollingMonth)
		.ExecuteAsync();

To construct a Versioned Time Series the following must be provided.

<table> <tr><th>Versioned Query</th><th>Description</th></tr> <tr><td>Market Data ID</td><td>Provide a market data id or set of market data id's to query</td></tr> <tr><td>Time Granularity</td><td>Specify the granularity type</td></tr> <tr><td>Versioned Time Extraction Window</td><td>Versioned extraction time window</td></tr> <tr><td>Time Extraction Window</td><td>An extraction time window for data to be queried</td></tr> </table>

Go to Versioned Time Extraction window section
Go to Time Extraction window section

Versioned Time Extraction Windows

<table> <tr><th>Versioned Time Extraction Windows</th><th>Description</th></tr> <tr><td>Version</td><td>Gets the specified version of a versioned timeseries</td></tr> <tr><td>Last Days</td><td>Gets the latest version of a versioned timeseries of each day in a time window</td></tr> <tr><td>Last N</td><td>Gets the latest N timeseries versions that have at least a not-null value</td></tr> <tr><td>Most Recent</td><td>Gets the most recent version of a versioned timeseries in a time window</td></tr> <tr><td>Most Updated Version</td><td>Gets the timeseries of the most updated version of each timepoint of a versioned timeseries</td></tr> </table>

Versioned Time Extraction window types for queries.

Version

 .ForVersion(new LocalDateTime(2018, 07, 19, 12, 0, 0, 123))

Last Days

 .ForLastOfDays(new LocalDate(2018, 6, 22), new LocalDate(2018, 7, 23))

Last N

 .ForLastNVersions(3)

Most Recent

 .ForMostRecent(Period.FromMonths(-1), Period.FromDays(20))

Most Updated Version

 .ForMUV()
 /// optional paramater to limit version
 .ForMUV(new LocalDateTime(2019, 05, 01, 2, 0, 0))

Bid Ask Time Series

var bidAskSeries = await qs.CreateBidAsk()
                       .ForMarketData(new int[] { 100000001 })
                       .ForProducts(new string[] { "M+1", "GY+1" })
                       .InRelativeInterval(RelativeInterval.RollingMonth)
                       .ExecuteAsync();

To construct a Bid Ask Time Series the following must be provided.

<table> <tr><th>Bid Ask Query</th><th>Description</th></tr> <tr><td>Market Data ID</td><td>Provide a market data id or set of market data id's to query</td></tr> <tr><td>Product</td><td>Provide a product or set of products</td></tr> <tr><td>Time Extraction Window</td><td>An extraction time window for data to be queried </td></tr> </table>

Go to Time Extraction window section

Artesian SDK Extraction Windows

Extraction window types for queries.

Date Range

 .InAbsoluteDateRange(new LocalDate(2018,08,01),new LocalDate(2018,08,10)

Relative Interval

 .InRelativeInterval(RelativeInterval.RollingMonth)

Period

 .InRelativePeriod(Period.FromDays(5))

Period Range

 .InRelativePeriodRange(Period.FromWeeks(2), Period.FromDays(20))

Filler Strategy

All extraction types (Actual,Versioned and Market Assessment) have an optional filler strategy.

var versionedSeries = await qs.CreateVersioned()
    .ForMarketData(new int[] { 100000001 })
	.InGranularity(Granularity.Day)
	.ForMostRecent()
	.InAbsoluteDateRange(new LocalDate(2018, 6, 22), new LocalDate(2018, 7, 23))
	.WithFillLatestValue(Period.FromDays(7))

Null

 .WithFillNull()

None

 .WithFillNone()

Custom Value

 //Timeseries
 .WithFillCustomValue(123)
 // Market Assessment
 ..WithFillCustomValue(new MarketAssessmentValue { Settlement = 123, Open = 456, Close = 789, High = 321, Low = 654, VolumePaid = 987, VolumeGiven = 213, Volume = 435 })

Latest Value

 .WithLFillLatestValue(Period.FromDays(7))

MarketData Service

Using the ArtesianServiceConfig cfg we create an instance of the MarketDataService which is used to retrieve, edit or delete MarketData references. GetMarketReference will read the marketdata entity by MarketDataIdentifier and returns an istance of IMarketData if it exists.

//reference market data entity
var marketDataEntity = new MarketDataEntity.Input(){
    ProviderName = "TestProviderName",
    MarketDataName = "TestMarketDataName",
    OriginalGranularity = Granularity.Day,
    OriginalTimezone = "CET",
    AggregationRule = AggregationRule.Undefined,
    Type = MarketDataType.VersionedTimeSerie,
    MarketDataId = 1
}

var marketDataService = new MarketDataService(cfg);

var marketData = await marketDataService.GetMarketDataReference(new MarketDataIdentifier(
        marketDataEntity.ProviderName,
        marketDataEntity.MarketDataName)
    );

To Check MarketData for IsRegistered status, returns true if present or false if not found.

var isRegistered = await marketData.IsRegistered();

To Register MarketData , it will first verify that it has not all ready been registered then proceed to register the given MarketData entity.

await marketData.Register(marketDataEntity);

Calling Update will update the current MarketData metadata with changed values. Calling Load, retrieves the current metadata of a MarketData.

marketData.Metadata.AggregationRule = AggregationRule.SumAndDivide;
marketData.Metadata.Transform = SystemTimeTransforms.GASDAY66;

await marketData.Update();

await marketData.Load();

Using Write mode to edit MarketData and Save to save the data of the current MarketData providing an instant. Can be used Delete specifying a range to delete a specific range of the time serie.

Actual Time Series

EditActual starts the write mode for an Actual Time serie. Checks are done to verify registration and MarketDataType to verify it is an Actual Time Serie. Using AddData to be written. When data is saved with Save, can be deleted with Delete function specifying the start and the end range.

var writeMarketData = marketdata.EditActual();

writeMarketData.AddData(new LocalDate(2018, 10, 03), 10);
writeMarketData.AddData(new LocalDate(2018, 10, 04), 15);

await writeMarketData.Save(Instant.FromDateTimeUtc(DateTime.Now.ToUniversalTime()));

await writeMarketData.Delete(new LocalDateTime(2018, 10, 04), new LocalDateTime(2018, 10, 05));

To delete the whole range of the Actual Time serie, the Delete command can be used without specifying any start and end range.

var writeMarketData = marketdata.EditActual();

await writeMarketData.Delete();

Versioned Time Series

EditVersioned starts the write mode for a Versioned Time serie. Checks are done to verify registration and MarketDataType to verify it is a Versioned Time Serie. Using AddData to be written. When data is saved with Save, can be deleted with Delete function specifying the start and the end range.

var writeMarketData = marketData.EditVersioned(new LocalDateTime(2018, 10, 18, 00, 00));

writeMarketData.AddData(new LocalDate(2018, 10, 03), 10);
writeMarketData.AddData(new LocalDate(2018, 10, 04), 15);

await writeMarketData.Save(Instant.FromDateTimeUtc(DateTime.Now.ToUniversalTime()));

await writeMarketData.Delete(new LocalDateTime(2018, 10, 04), new LocalDateTime(2018, 10, 05), version);

To delete the whole range of the Versioned Time serie, the Delete command can be used without specifying any start and end range.

var writeMarketData = marketdata.EditVersioned(new LocalDateTime(2018, 10, 18, 00, 00));

await writeMarketData.Delete();

Market Assessment Time Series

EditMarketAssessment starts the write mode for a Market Assessment. Checks are done to verify registration and MarketDataType to verify it is a Market Assessment. Using AddData to provide a local date time and a MarketAssessmentValue to be written. When data is saved with Save, can be deleted with Delete function specifying the start and the end range.

var writeMarketData = marketData.EditMarketAssessment();

var marketAssessmentValue = new MarketAssessmentValue()
{
    High = 47,
    Close = 20,
    Low = 18,
    Open = 33,
    Settlement = 22,
    VolumePaid = 34,
    VolumeGiven = 23,
    Volume = 16

};

writeMarketData.AddData(new LocalDate(2018, 11, 28), "Dec-18", marketAssessmentValue);

await writeMarketData.Save(Instant.FromDateTimeUtc(DateTime.Now.ToUniversalTime()));

var product = new List<string>(){"Dec-18"};

await writeMarketData.Delete(new LocalDateTime(2018, 10, 04), new LocalDateTime(2018, 10, 05), product);

To delete the whole range of the Market Assessment Time serie, the Delete command can be used without specifying any start and end range.

var writeMarketData = marketdata.EditMarketAssessment();

await writeMarketData.Delete();

Auction Time Series

EditAuction starts the write mode for an Auction entity. Checks are done to verify registration and MarketDataType to verify it is an Auction entity. Using AddData to provide a local date time and Auction bid and offer arrays to be written. When data is saved with Save, can be deleted with Delete function specifying the start and the end range.

var writeMarketData = marketData.EditAuction();

var localDateTime = new LocalDateTime(2018, 09, 24, 00, 00);
var bid = new List<AuctionBidValue>();
var offer = new List<AuctionBidValue>();
bid.Add(new AuctionBidValue(100, 10));
offer.Add(new AuctionBidValue(120, 12));

writeMarketData.Add(localDateTime, new AuctionBids(localDateTime, bid.ToArray(), offer.ToArray()));
await writeMarketData.Save(Instant.FromDateTimeUtc(DateTime.Now.ToUniversalTime()));

await writeMarketData.Delete(new LocalDateTime(2018, 10, 04), new LocalDateTime(2018, 10, 05));

To delete the whole range of the Auction Time serie, the Delete command can be used without specifying any start and end range.

var writeMarketData = marketdata.EditAuction();

await writeMarketData.Delete();

Bid Ask Time Series

EditBidAsk starts the write mode for a Bid Ask. Checks are done to verify registration and MarketDataType to verify it is a Bid Ask. Using AddData to provide a local date time and a BidAskValue to be written. When data is saved with Save, can be deleted with Delete function specifying the start and the end range.

var writeMarketData = marketData.EditBidAsk();

var bidAskValue = new BidAskValue()
{
    BestBidPrice = 47,
    BestBidQuantity = 18,
    BestAskPrice = 20,
    BestAskQuantity = 33,
    LastPrice = 22,
    LastQuantity = 13
};

writeMarketData.AddData(new LocalDate(2018, 11, 28), "Dec-18", bidAskValue);

await writeMarketData.Save(Instant.FromDateTimeUtc(DateTime.Now.ToUniversalTime()));

var product = new List<string>(){"Dec-18"};

await writeMarketData.Delete(new LocalDateTime(2018, 10, 04), new LocalDateTime(2018, 10, 05), product);

To delete the whole range of the Bid Ask Time serie, the Delete command can be used without specifying any start and end range.

var writeMarketData = marketdata.EditBidAsk();

await writeMarketData.Delete();

Acknowledgments

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
7.4.1 162 2/21/2025
7.4.0 134 2/14/2025
7.4.0-beta01 88 2/6/2025
7.3.1 143 1/15/2025
7.3.0 79 1/15/2025
7.2.0 98 1/9/2025
7.1.0 185 12/10/2024
7.0.3 97 12/10/2024
7.0.2 278 10/17/2024
7.0.1 468 8/22/2024
7.0.0 127 8/22/2024
7.0.0-beta02 239 8/13/2024
7.0.0-beta01 166 8/13/2024
6.1.0 158 8/21/2024
6.0.1 162 7/1/2024
6.0.0 147 5/28/2024
5.0.2 111 5/28/2024
5.0.1 381 10/30/2023
5.0.0 214 8/11/2023
4.3.4-beta01 164 8/10/2023
4.3.3 183 8/4/2023
4.3.2 202 7/28/2023
4.3.1 359 5/11/2023
4.3.0 805 3/28/2023
4.2.0 498 1/2/2023
4.1.0 1,270 6/23/2022
4.1.0-beta2 203 6/22/2022
4.1.0-beta1 181 5/25/2022
4.0.0 1,622 5/16/2022
4.0.0-beta2 208 6/22/2022
3.2.1 1,706 10/14/2021
3.2.0 537 10/12/2021
3.1.2 443 9/30/2021
3.1.1 1,268 3/18/2021
3.1.0 596 3/5/2021
3.0.0 602 1/21/2021
2.2.5 509 1/11/2021
2.2.4 528 12/23/2020
2.2.1 894 10/7/2020
2.2.0 637 9/2/2020
2.1.0 619 9/1/2020
2.1.0-beta01 480 7/7/2020
2.0.1 1,128 5/20/2020
2.0.0 2,328 4/6/2020
2.0.0-beta04 543 3/16/2020
2.0.0-beta03 555 3/9/2020
2.0.0-beta02 472 3/3/2020
2.0.0-beta01 470 3/2/2020
1.9.1-beta01 571 1/24/2020
1.9.0-beta01 558 1/16/2020
1.8.0 858 11/20/2019
1.8.0-beta01 480 11/19/2019
1.7.2 848 11/14/2019
1.7.0 719 10/14/2019
1.6.0 783 5/22/2019
1.5.2 757 5/20/2019
1.5.1 761 5/16/2019
1.5.0 701 5/10/2019
1.4.3 748 5/9/2019
1.4.2 800 5/6/2019
1.4.1 891 4/3/2019
1.4.0 925 3/20/2019
1.3.2 875 2/18/2019
1.3.1 850 2/18/2019
1.3.0 926 11/28/2018
1.2.2-beta01 640 11/28/2018
1.2.1 903 11/7/2018
1.2.0 925 10/23/2018
1.2.0-beta07 701 10/23/2018
1.2.0-beta06 674 10/22/2018
1.2.0-beta05 700 10/19/2018
1.2.0-beta04 734 10/18/2018
1.2.0-beta03 685 10/18/2018
1.2.0-beta02 695 10/18/2018
1.2.0-beta01 686 10/18/2018
1.1.2-beta05 748 10/3/2018
1.1.2-beta04 714 10/3/2018
1.1.2-beta03 713 10/3/2018
1.1.2-beta02 761 10/3/2018
1.1.2-beta-01 723 10/3/2018
1.1.1 910 9/28/2018
1.1.0 942 9/27/2018
1.1.0-beta04 736 9/26/2018
1.1.0-beta03 708 9/26/2018
1.1.0-beta02 674 9/25/2018
1.1.0-beta01 700 9/25/2018
1.0.0 1,606 8/17/2018
0.2.7-alpha02 825 8/14/2018
0.2.6-alpha02 832 8/14/2018
0.2.5-alpha02 798 8/13/2018
0.2.4-alpha02 795 8/13/2018
0.2.3-alpha02 781 8/10/2018
0.2.2-alpha02 815 8/8/2018
0.2.1-alpha02 831 8/8/2018
0.2.0-alpha02 835 7/25/2018
0.1.0-alpha02 938 7/19/2018
0.1.0-alpha01 912 7/19/2018

Breaking: remove support for .NET6 (EOL) in favor of .NET8