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 one zero-based ranking page. |
|
Fetch two complete matching ranking passes. |
|
Fetch all history currently recoverable for one ApeX vault. |
|
Parse, canonicalise and order one unpaginated history response. |
|
Parse and validate one ranking response page. |
|
Parse one ranking vault without status or TVL filtering. |
Classes
One native ApeX historical vault value. |
|
One validated ranking page. |
|
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 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_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
- 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