tokenised_fund.asseto.offchain_metadata

Documentation for eth_defi.tokenised_fund.asseto.offchain_metadata Python module.

Persist Asseto’s public product registry for scheduled vault scans.

Asseto exposes its registry through an undocumented web-application endpoint. The registry is nevertheless adapter-critical because it supplies the product identifier used for public daily NAV history. This module keeps HTTP parsing in eth_defi.tokenised_fund.asseto.offchain_api and owns only cache and freshness policy.

Module Attributes

ASSETO_REGISTRY_CACHE_VERSION

Current normalised JSON envelope version.

DEFAULT_MAX_STALE_AGE

Longest safe age for a cached registry used to construct existing adapters.

Functions

fetch_asseto_registry(*[, cache_path, now_, ...])

Fetch Asseto's registry with a safe persisted stale fallback.

Classes

AssetoOffchainRegistryResult

One fresh or stale Asseto registry read.

DEFAULT_ASSETO_REGISTRY_CACHE_PATH = PosixPath('/home/runner/.tradingstrategy/cache/asseto/registry-cache.json')

Persistent cache shared by the scanner containers through DEFAULT_CACHE_ROOT.

ASSETO_REGISTRY_CACHE_VERSION = 1

Current normalised JSON envelope version.

DEFAULT_MAX_STALE_AGE = datetime.timedelta(days=7)

Longest safe age for a cached registry used to construct existing adapters.

class AssetoOffchainRegistryResult

Bases: object

One fresh or stale Asseto registry read.

Parameters
  • status – Whether products came from a new API response or a retained cache.

  • products – Normalised EVM registry products keyed by Asseto’s API.

  • source_timestamp – UTC timestamp at which the source snapshot was fetched.

  • diagnostics – Safe operator-facing explanation of a stale or failed read.

property is_usable: bool

Return whether the result can construct known runtime adapters.

__init__(status, products, source_timestamp, diagnostics=None)
Parameters
Return type

None

fetch_asseto_registry(*, cache_path=PosixPath('/home/runner/.tradingstrategy/cache/asseto/registry-cache.json'), now_=None, max_stale_age=datetime.timedelta(days=7))

Fetch Asseto’s registry with a safe persisted stale fallback.

The daily scheduler always calls this helper once per due Asseto item. A malformed, empty or duplicate snapshot cannot replace an existing cache. On failure, the cache can only rebuild existing adapters and callers must not use it for metadata writes.

Parameters
  • cache_path (pathlib.Path) – JSON cache path. Override in tests or isolated operator runs.

  • now – Naive UTC timestamp override for deterministic tests.

  • max_stale_age (datetime.timedelta) – Maximum cache age eligible for degraded adapter construction.

  • now_ (Optional[datetime.datetime]) –

Returns

Fresh, stale or failed registry result.

Return type

eth_defi.tokenised_fund.asseto.offchain_metadata.AssetoOffchainRegistryResult