DatabentoDotNet.Dbn
0.10.0
Prefix Reserved
dotnet add package DatabentoDotNet.Dbn --version 0.10.0
NuGet\Install-Package DatabentoDotNet.Dbn -Version 0.10.0
<PackageReference Include="DatabentoDotNet.Dbn" Version="0.10.0" />
<PackageVersion Include="DatabentoDotNet.Dbn" Version="0.10.0" />
<PackageReference Include="DatabentoDotNet.Dbn" />
paket add DatabentoDotNet.Dbn --version 0.10.0
#r "nuget: DatabentoDotNet.Dbn, 0.10.0"
#:package DatabentoDotNet.Dbn@0.10.0
#addin nuget:?package=DatabentoDotNet.Dbn&version=0.10.0
#tool nuget:?package=DatabentoDotNet.Dbn&version=0.10.0
DatabentoDotNet.Dbn
A zero-copy codec for DBN (Databento Binary Encoding), the wire and file format
Databento uses for market data. Records, metadata, symbol maps, and a
decoder that reads .dbn, .dbn.zst, and .dbn.frag.
This is a third-party client. Databento ships official clients for Python, C++, and Rust — but not
.NET, so this fills that gap, ported from the normative
databento/dbn Rust implementation with struct layouts pinned
against the static_asserts in databento-cpp.
0.10.0is a beta. The code is complete and tested; what is not yet settled is whether the public surface is the right shape. 1.0.0 undertakes not to break it, so the beta is when that undertaking is worth contesting — if something here is awkward to call, an issue now is much cheaper than a major version later.
using DatabentoDotNet.Dbn;
using var decoder = new DbnDecoder(File.OpenRead("data.dbn.zst")); // zstd is detected, not declared
Metadata? metadata = decoder.Metadata;
while (decoder.TryNextRecord(out RecordRef record))
{
if (record.TryGet(out TradeMsg trade))
Console.WriteLine($"{DbnTime.ToInstant(trade.IndexTs)} {trade.Price} x {trade.Size}");
}
IndexTs, not Header.TsEvent. Most schemas — trades included — index on ts_recv, and the two
can fall on opposite sides of UTC midnight, so keying a symbol lookup on ts_event silently returns
the previous day's symbol with nothing looking broken.
What "zero-copy" means here, and what it costs you
Records are reinterpreted in place over the read buffer — nothing is allocated per record, which
is asserted by a test rather than measured by a benchmark. That is why RecordRef is a ref struct
and why TryNextRecord is synchronous: neither can cross an await, which is the boundary that
keeps the reinterpretation sound. A record is valid only until the next call on the decoder.
Prices are long at a fixed 1e-9 scale and timestamps are ulong nanoseconds, both deliberately: a
record field's type is its wire layout, so nothing wider than the eight bytes on the wire can go
there.
Above the codec, dates and times are NodaTime — Instant and LocalDate,
never the BCL's DateTime family, whose 100 ns tick cannot represent a nanosecond timestamp at all.
DbnTime is the single conversion between the two, and it reports DBN's undefined-timestamp
sentinel as absent rather than as a time one nanosecond before the epoch.
Dependencies
NodaTime and ZstdSharp.Port. The latter is pure managed — no P/Invoke, no
native asset, no per-RID build — so the package is trim- and Native-AOT-friendly, verified by
publishing and running an AOT binary rather than by analyzers alone.
Documentation
The API reference is the XML documentation shipped inside this package, so it reaches IntelliSense at the call site. Guides and explanations are at jerbersoft.github.io/databentodotnet — start with Decoding DBN Files, Zero-Copy and Allocation and Timestamps and Prices.
Source, issues, and roadmap: https://github.com/jerbersoft/databentodotnet.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- NodaTime (>= 3.3.3)
- ZstdSharp.Port (>= 0.8.8)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on DatabentoDotNet.Dbn:
| Package | Downloads |
|---|---|
|
DatabentoDotNet.Historical
Databento historical HTTPS market data client for .NET: authenticated transport, JSON and zstd-framed response readers, and structured API error mapping. |
|
|
DatabentoDotNet.Live
Databento real-time and intraday-replay live streaming client for .NET, over the raw TCP gateway protocol. |
|
|
DatabentoDotNet.Extensions.Hosting
Databento for ASP.NET Core and the .NET generic host: IServiceCollection registration for the historical, reference and live clients, IConfiguration binding, and a hosted live-streaming service with bounded reconnection, health checks and metrics. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.10.0 | 135 | 9/1/2026 |
| 0.9.1 | 119 | 8/31/2026 |
| 0.9.0 | 133 | 8/30/2026 |
| 0.1.0-alpha | 122 | 8/29/2026 |