apex.vault
Documentation for eth_defi.apex.vault Python module.
Typed ApeX public vault API parsing and fetching.
The public endpoints are:
The history endpoint was verified on 2026-07-23 to return one unpaginated
data.timeValue array with no completeness token or range parameters.
Functions
|
Fetch recoverable history for official ApeX vaults in one batch. |
|
Fetch the complete ApeX official liquidity-provider vault listing. |
|
Fetch one zero-based ranking page. |
|
Fetch two complete matching ranking passes. |
|
Fetch one vault's public subscription redemption delay. |
|
Fetch all history currently recoverable for one ApeX vault. |
|
Parse, canonicalise and order one unpaginated history response. |
|
Parse a complete official-vault batch-history response. |
|
Parse the complete official ApeX liquidity-provider vault listing. |
|
Parse and validate one ranking response page. |
|
Parse the public configuration for one vault's redemption delay. |
|
Parse one ranking vault without status or TVL filtering. |
Classes
One native ApeX historical vault value. |
|
One validated ranking page. |
|
Redemption configuration returned for one ApeX vault. |
|
One vault returned by the ApeX ranking endpoint. |
- class ApexVaultSummary
Bases:
objectOne vault returned by the ApeX ranking endpoint.
- reported_ethereum_address: Optional[eth_typing.evm.HexAddress]
Ethereum address reported by ApeX, which is not unique per vault.
Current share price in ApeX USDT terms.
Current reported share count.
- created_at: Optional[datetime.datetime]
Creation timestamp as naive UTC.
- source_updated_at: Optional[datetime.datetime]
Source update timestamp as naive UTC.
- finished_at: Optional[datetime.datetime]
Terminal timestamp as naive UTC.
Unverified profit-share-unit source value.
- __init__(vault_id, synthetic_address, reported_ethereum_address, name, description, status, vault_type, share_price, tvl, share_count, created_at, source_updated_at, finished_at, max_amount, purchase_fee_rate_raw, share_profit_ratio_raw)
- Parameters
vault_id (str) –
synthetic_address (str) –
reported_ethereum_address (Optional[eth_typing.evm.HexAddress]) –
name (str) –
description (str) –
status (str) –
vault_type (str) –
created_at (Optional[datetime.datetime]) –
source_updated_at (Optional[datetime.datetime]) –
finished_at (Optional[datetime.datetime]) –
- Return type
None
- class ApexVaultConfiguration
Bases:
objectRedemption configuration returned for one ApeX vault.
ApeX calls the period during which a freshly subscribed share cannot be redeemed
freezePurchaseShareDuration. It is a per-vault configuration value, distinct from a user’s pending redemption order. ApeX’s official liquidity-provider vaults are a separate source path and have no lock-up: its Protocol Vault announcement states this explicitly. Therefore the public configuration endpoint is the canonical source for each ranked vault’s delay.- redemption_delay: datetime.timedelta
Time between subscription and the earliest permitted redemption.
Source: ApeX vault configuration endpoint response field
data.vaultConfig.freezePurchaseShareDuration, in milliseconds. Verified against the live ApeX application API on 2026-08-01.Official liquidity-provider vaults have no lock-up according to ApeX’s Protocol Vault announcement. Do not infer a ranked-vault delay from
vault_type; use this per-vault source field when it is present.
- __init__(redemption_delay)
- Parameters
redemption_delay (datetime.timedelta) –
- Return type
None
- class ApexHistoryPoint
Bases:
objectOne native ApeX historical vault value.
- timestamp: datetime.datetime
Exact naive UTC source timestamp.
- property total_supply: Optional[float]
Derive total share supply when division is valid.
- Returns
Total value divided by positive NAV, otherwise
None.
- __init__(timestamp, net_value, total_value)
- Parameters
timestamp (datetime.datetime) –
net_value (float) –
total_value (float) –
- Return type
None
- class ApexRankingPage
Bases:
objectOne validated ranking page.
- vaults: tuple[eth_defi.apex.vault.ApexVaultSummary, ...]
Parsed page vaults.
- __init__(total_size, vaults)
- Parameters
total_size (int) –
vaults (tuple[eth_defi.apex.vault.ApexVaultSummary, ...]) –
- Return type
None
- parse_vault_summary(raw)
Parse one ranking vault without status or TVL filtering.
- Parameters
raw (object) – Raw
vaultListobject.- Returns
Typed vault summary.
- Return type
- parse_ranking_page(payload)
Parse and validate one ranking response page.
The application envelope, total size, vault array and every retained vault record are validated before the page is returned.
- Parameters
payload (object) – Decoded JSON response.
- Returns
Typed page with its complete-source row count.
- Return type
- parse_vault_configuration(payload)
Parse the public configuration for one vault’s redemption delay.
The public
vault/vault-configendpoint gives the exact lock period in milliseconds. ApeX’s application describes shares as non-redeemable until this period after subscription has elapsed. ApeX’s official liquidity-provider vaults are excluded: its Protocol Vault announcement says its Protocol Vaults have no lock-up.- Parameters
payload (object) – Decoded vault-configuration response.
- Returns
Typed redemption-delay configuration.
- Return type
- parse_official_vaults(payload)
Parse the complete official ApeX liquidity-provider vault listing.
This separate endpoint is not part of the user-vault ranking. Its entries share the same fields, except that their raw collection type is named
typerather thancollectVaultType.- Parameters
payload (object) – Decoded JSON response from
/vault/official-vaults.- Returns
Complete official-vault records in source order.
- Return type
- parse_history(payload)
Parse, canonicalise and order one unpaginated history response.
Equivalent duplicate timestamps collapse to one point. Conflicting values at one timestamp reject the complete response so no ambiguous history is staged.
- Parameters
payload (object) – Decoded JSON response.
- Returns
Timestamp-ordered immutable history points.
- Return type
- parse_official_vault_histories(payload, vault_ids)
Parse a complete official-vault batch-history response.
Every requested ID must appear exactly once. Treating an omitted official vault as an empty history would incorrectly mark a partial API response as a successful maintenance run.
- Parameters
- Returns
Parsed histories keyed by requested vault ID.
- Return type
- fetch_ranking_page(session_pool, page, *, limit=100, operation_deadline)
Fetch one zero-based ranking page.
Endpoint validation runs inside the session pool retry boundary, so an invalid HTTP-200 application envelope is retried as one request operation.
- Parameters
session_pool (eth_defi.apex.session.ApexSessionPool) – Configured bounded ApeX session pool.
page (int) – Zero-based page number.
limit (int) – Positive page size.
operation_deadline (float) – Monotonic budget boundary shared by the full ranking operation.
- Returns
Validated typed ranking page.
- Return type
- fetch_stabilised_vaults(session_pool, *, limit=100, operation_timeout=300.0, attempts=3)
Fetch two complete matching ranking passes.
The second pass supplies the stored metric values after both passes report identical vault membership.
- Parameters
session_pool (eth_defi.apex.session.ApexSessionPool) – Configured bounded ApeX session pool.
limit (int) – Positive ranking page size.
operation_timeout (float) – Monotonic whole-read budget used across both passes and retries.
attempts (int) – Positive number of complete two-pass attempts.
- Returns
Stabilised second-pass vault records.
- Return type
- fetch_vault_history(session_pool, vault_id, *, operation_timeout=120.0)
Fetch all history currently recoverable for one ApeX vault.
The public endpoint exposes no pagination or completeness metadata. The returned timestamps are therefore the recoverable source range, not a claim of lifetime completeness.
- Parameters
session_pool (eth_defi.apex.session.ApexSessionPool) – Configured bounded ApeX session pool.
vault_id (str) – Non-empty ApeX platform vault ID.
operation_timeout (float) – Monotonic operation budget shared by all HTTP attempts.
- Returns
Parsed history ordered by exact naive UTC source timestamp.
- Return type
- fetch_vault_configuration(session_pool, vault_id, *, operation_timeout=120.0)
Fetch one vault’s public subscription redemption delay.
The configuration endpoint is public but undocumented in ApeX’s OpenAPI specification. It contains the precise per-vault subscription freeze duration in milliseconds.
- Parameters
session_pool (eth_defi.apex.session.ApexSessionPool) – Configured bounded ApeX session pool.
vault_id (str) – Non-empty ApeX platform vault ID.
operation_timeout (float) – Monotonic operation budget shared by all HTTP attempts.
- Returns
Parsed public vault configuration.
- Return type
- fetch_official_vaults(session_pool, *, operation_timeout=300.0)
Fetch the complete ApeX official liquidity-provider vault listing.
- Parameters
session_pool (eth_defi.apex.session.ApexSessionPool) – Configured bounded ApeX session pool.
operation_timeout (float) – Monotonic operation budget shared by HTTP attempts.
- Returns
Complete official vault records.
- Return type
- fetch_official_vault_histories(session_pool, vault_ids, *, operation_timeout=120.0)
Fetch recoverable history for official ApeX vaults in one batch.
- Parameters
session_pool (eth_defi.apex.session.ApexSessionPool) – Configured bounded ApeX session pool.
vault_ids (tuple[str, ...]) – Non-empty, unique official vault IDs.
operation_timeout (float) – Monotonic operation budget shared by HTTP attempts.
- Returns
Parsed histories keyed by official vault ID.
- Return type