Skip to main content

Crate tessera

Crate tessera 

Source
Expand description

§tessera

The official Rust client for Tessera — order-flow-enriched OHLCV, funding-rate, and positioning datasets built from raw Hyperliquid trade data, delivered as Parquet over a REST API.

This crate is the Rust mirror of the tessera-api Python SDK: point it at a (dataset, coin, month) and read straight from object storage into Polars or DuckDB over presigned URLs — with predicate/projection pushdown, no temp files.

§Choosing a client

  • TesseraClient — blocking API. Owns a private tokio runtime, so do not construct it from inside an async runtime.
  • AsyncTesseraClientasync fn surface for tokio applications.

§Data engines

  • Polars (default feature polars): TesseraClient::scan returns a LazyFrame; TesseraClient::read collects a DataFrame.
  • DuckDB (opt-in feature duckdb): TesseraClient::to_duckdb returns an in-memory connection exposing a tessera view.

§Errors

Every failure raises TesseraError, mirroring the Python exception taxonomy (Configuration, NotFound, PresignExpired, …).

§Example

let client = tessera::TesseraClient::new(None)?;
// Pick the newest available month rather than a hardcoded one:
// partitions roll on a 12-month window, so fixed dates go stale.
let latest = client
    .partitions("gold_ohlcv_1m", Some("BTC"), None)?
    .partitions
    .pop()
    .expect("at least one partition");
let frame = client.read("gold_ohlcv_1m", "BTC", &latest.month, None)?;
println!("{} rows for {}", frame.height(), latest.month);

Modules§

readers
Data-engine plumbing: Parquet readers for Polars and DuckDB.
resolver
Concurrent presigned-URL resolution.

Structs§

AsyncTesseraClient
An async client for the Tessera API.
ClientConfig
Resolved configuration shared by the sync and async clients.
DatasetSummary
DatasetSummary.
DatasetsResponse
DatasetsResponse.
DownloadResponse
DownloadResponse.
ErrorBody
The error response body. Every error variant serialises to this shape — a single machine-readable error code. Declared as a real struct (rather than the inline json! below) only so it can be referenced as a response body in the OpenAPI spec; into_response still emits the same JSON.
MonthRange
MonthRange.
MonthSpan
An inclusive range of months, e.g. MonthSpan::new("2025-01", "2025-09")?.
Partition
Partition.
PartitionRef
A fully-qualified reference to a single partition.
PartitionsResponse
PartitionsResponse.
TesseraClient
A synchronous client for the Tessera API.

Enums§

TesseraError
Every error raised by this crate.

Constants§

API_KEY_ENV_VAR
Environment variable consulted when no explicit API key is passed.
DEFAULT_BASE_URL
Production API base URL.
USER_AGENT
Default User-Agent for requests made by this client.
VERSION
The crate version, as published on crates.io.

Traits§

IntoCoins
Accepted shapes for a coin argument: one symbol or any iterable of them.
IntoMonths
Accepted shapes for a month argument: one month, a MonthSpan, or any iterable of months.

Functions§

error_from_response
Build the appropriate TesseraError from an error response.