erc_4626.vault_protocol.nest.offchain_metadata

Documentation for eth_defi.erc_4626.vault_protocol.nest.offchain_metadata Python module.

First-party Nest vault metadata.

Nest publishes the canonical contract deployment catalogue through its public API and richer product information through its public CMS API. The contract catalogue maps every Nest share token to its chain-specific NestVault deposit and redemption entrypoints; the CMS supplements that mapping with the strategy description, redemption estimate and yield-source partners.

Module Attributes

DEFAULT_API_BASE_URL

Public contract and live-statistics API used by the Nest web application.

DEFAULT_CMS_API_BASE_URL

Public Payload CMS endpoint used by the Nest web application.

DEFAULT_CACHE_DURATION

The cache is deliberately short because vault routes and their CMS metadata evolve.

NEST_ARC_CHAIN_ID

Arc mainnet chain ID used by Nest's current application.

NEST_CHAIN_NAMES

Nest's API uses these chain names in its product chain object.

NEST_REVIEWED_MANAGERS

Reviewed Nest product managers.

NEST_CURATOR_SLUG

Nest identifies Nest DAO LLC as the primary curator of its vaults.

Functions

fetch_nest_vault_metadata(web3, vault_address)

Look up first-party metadata for one NestVault deployment.

fetch_nest_vaults([cache_path, ...])

Fetch and cache the first-party catalogue of Nest vault entrypoints.

select_nest_manager_name(slug, ...)

Select the best available partner name for a Nest manager label.

Classes

NestVaultMetadata

First-party data for a chain-specific Nest vault entrypoint.

DEFAULT_CACHE_PATH = PosixPath('/home/runner/.tradingstrategy/cache/nest')

Where cached first-party Nest API responses are stored.

DEFAULT_API_BASE_URL = 'https://api.nest.credit/v1'

Public contract and live-statistics API used by the Nest web application.

DEFAULT_CMS_API_BASE_URL = 'https://cms.nest.credit/api'

Public Payload CMS endpoint used by the Nest web application.

DEFAULT_CACHE_DURATION = datetime.timedelta(days=2)

The cache is deliberately short because vault routes and their CMS metadata evolve.

NEST_ARC_CHAIN_ID = 5042

Arc mainnet chain ID used by Nest’s current application.

NEST_CHAIN_NAMES: dict[int, str] = {1: 'mainnet', 56: 'bsc', 143: 'monad', 480: 'worldchain', 2818: 'morph', 4663: 'robinhood', 5042: 'arc', 8453: 'base', 9745: 'plasma', 43114: 'avalanche', 98866: 'plume'}

Nest’s API uses these chain names in its product chain object.

NEST_REVIEWED_MANAGERS: dict[str, str] = {'nest-acrdx-vault': 'Apollo', 'nest-basis-vault': 'Bitwise', 'nest-falconx-clo': 'M11 Credit', 'nest-onre-vault': 'OnRe', 'nest-opal-vault': 'BlackOpal', 'nest-wisdom-vault': 'WisdomTree', 'nprime': 'Hastra', 'plume-factor-vault': 'Plume'}

Reviewed Nest product managers. These are strategy or asset managers, not necessarily curators of the Nest vault contracts. https://www.plume.org/blog/plume-and-bybit-expand-access-to-3-trillion-brazilian-credit-card-financing-market-through-nopal https://app.nest.credit/vaults/nest-falconx-clo https://app.nest.credit/vaults/plume-factor-vault https://www.plume.org/blog/plume-vaults-expands-access-to-figures-30b-home-equity-ecosystem-through-nprime https://bitwiseinvestments.com/crypto-funds/uscc

NEST_CURATOR_SLUG = 'nest-dao'

Nest identifies Nest DAO LLC as the primary curator of its vaults. https://nest.credit/

select_nest_manager_name(slug, yield_source_partners)

Select the best available partner name for a Nest manager label.

Nest’s CMS lists yield-source partners without roles. Prefer a reviewed manager where one is documented; otherwise retain the first published partner as an indicative label. FACTOR’s curator is stated in its product description although its partner list is empty.

Parameters
  • slug (str) – Stable Nest product slug.

  • yield_source_partners (list[str]) – Partner names in the order published by Nest’s CMS.

Returns

Reviewed manager, first available partner, or None.

Return type

Optional[str]

class NestVaultMetadata

Bases: TypedDict

First-party data for a chain-specific Nest vault entrypoint.

name: str

Nest product name, for example Nest BlackOpal LiquidStone II Vault.

display_name: Optional[str]

Current product display name from Nest’s CMS, if published.

slug: str

Stable Nest web-application product slug.

symbol: str

Share token symbol, for example nOPAL.

display_symbol: Optional[str]

Marketing symbol from Nest’s CMS; the onchain token symbol remains authoritative.

share_token_address: eth_typing.evm.HexAddress

ERC-20 share token shared by the product’s EVM routes.

vault_address: eth_typing.evm.HexAddress

Chain-specific NestVault entrypoint address.

chain_id: int

EVM chain ID of vault_address.

asset_symbol: str

Deposit/redemption denomination symbol, for example USDC.

asset_address: eth_typing.evm.HexAddress

Deposit/redemption denomination token address on chain_id.

start_block: Optional[int]

Block where Nest reports the product as deployed on this chain. A historical lower bound, not proof of an entrypoint’s bytecode at this block.

category: Optional[str]

Product category shown by Nest, if supplied by the CMS.

short_description: Optional[str]

Short user-facing strategy summary from the Nest CMS.

description: Optional[str]

Full user-facing strategy explanation from the Nest CMS.

yield_origin: Optional[str]

CMS explanation of how the strategy earns its yield.

risk_summary: Optional[str]

CMS summary of the strategy’s risks.

underlying_risks: Optional[str]

CMS detail about the underlying assets’ risks.

redemption_time_days: Optional[int]

Estimated redemption time in days, if supplied by the Nest CMS.

status: Optional[str]

Product status, for example active.

yield_source_partners: list[str]

Yield-source partner names displayed by Nest.

icon_url: Optional[str]

Product icon URL supplied by Nest.

reported_apy: Optional[float]

Catalogue SEC 30-day annualised yield as a fraction; its month-end window can differ from the application’s rolling NAV yield.

target_apy: Optional[float]

Product target APY reported by the contract catalogue, distinct from realised yield.

estimated_apy: Optional[float]

CMS yield estimate, which may be unpublished or stale on some products.

tvl_usd: Optional[float]

Reported product TVL in USD.

num_holders: Optional[int]

Holder count reported by Nest’s live API.

volume_24h_usd: Optional[float]

USD-denominated 24-hour volume reported by Nest’s live API.

__init__(*args, **kwargs)
__new__(**kwargs)
clear()

Remove all items from the dict.

copy()

Return a shallow copy of the dict.

fromkeys(value=None, /)

Create a new dictionary with keys from iterable and values set to value.

get(key, default=None, /)

Return the value for key if key is in the dictionary, else default.

items()

Return a set-like object providing a view on the dict’s items.

keys()

Return a set-like object providing a view on the dict’s keys.

pop(k[, d]) → v, remove specified key and return the corresponding value.

If the key is not found, return the default if given; otherwise, raise a KeyError.

popitem()

Remove and return a (key, value) pair as a 2-tuple.

Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.

setdefault(key, default=None, /)

Insert key with a value of default if key is not in the dictionary.

Return the value for key if key is in the dictionary, else default.

update([E, ]**F) → None.  Update D from mapping/iterable E and F.

If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

values()

Return an object providing a view on the dict’s values.

fetch_nest_vaults(cache_path=PosixPath('/home/runner/.tradingstrategy/cache/nest'), api_base_url='https://api.nest.credit/v1', cms_api_base_url='https://cms.nest.credit/api', now_=None, max_cache_duration=datetime.timedelta(days=2), *, allow_stale=True)

Fetch and cache the first-party catalogue of Nest vault entrypoints.

One request obtains contract routes and live statistics; one CMS request obtains the associated product descriptions. The output intentionally keys contracts by chain and address because Nest can deploy equal addresses on more than one EVM network. A successful refresh also updates the in-process adapter cache, so a migration’s freshly verified catalogue is used when rebuilding rows.

Parameters
  • cache_path (pathlib.Path) – Local directory for the process-safe JSON cache.

  • api_base_url (str) – Nest public API base URL, overrideable for tests.

  • cms_api_base_url (str) – Nest CMS public API base URL, overrideable for tests.

  • now – Override the current naive UTC time for deterministic cache tests.

  • max_cache_duration (datetime.timedelta) – Age after which first-party metadata is refreshed.

  • allow_stale (bool) – Use the cache and fall back to it after an API outage. Disable this for migrations that must refetch the current first-party route catalogue.

  • now_ (Optional[datetime.datetime]) –

Returns

Chain-and-address keyed metadata for every NestVault route.

Return type

dict[str, eth_defi.erc_4626.vault_protocol.nest.offchain_metadata.NestVaultMetadata]

fetch_nest_vault_metadata(web3, vault_address)

Look up first-party metadata for one NestVault deployment.

Adapters share the latest explicitly fetched catalogue in this process. An empty response is not memoised, allowing recovery after an API outage.

Parameters
  • web3 (web3.main.Web3) – Connected Web3 instance used to select the EVM chain.

  • vault_address (eth_typing.evm.HexAddress) – NestVault deposit and redemption entrypoint address.

Returns

Product metadata, or None if the address is not in Nest’s published catalogue.

Return type

Optional[eth_defi.erc_4626.vault_protocol.nest.offchain_metadata.NestVaultMetadata]