enzyme.blue_vault
Documentation for eth_defi.enzyme.blue_vault Python module.
Direct VaultBase adapter for Enzyme Blue VaultProxy funds.
Blue predates ERC-4626. Its VaultProxy is the share token and delegates fund valuation to the paired ComptrollerProxy. This adapter exposes the pair as a single scanner vault while keeping the canonical VaultProxy address as its identity.
See https://docs.enzyme.finance/enzyme-blue-protocol/architecture/persistent.
Module Attributes
Reviewed policy identifiers that restrict who may deposit into Blue. |
|
Backwards-compatible public constant for the current Sulu identifier. |
|
Deprecated Ethereum releases do not expose |
Classes
Read an Enzyme Blue VaultProxy and its paired ComptrollerProxy. |
- ENZYME_BLUE_DEPOSIT_PERMISSION_POLICY_IDENTIFIERS = frozenset({'ALLOWED_DEPOSIT_RECIPIENTS', 'BUY_SHARES_CALLER_WHITELIST', 'DEPOSITOR_WHITELIST', 'INVESTOR_WHITELIST'})
Reviewed policy identifiers that restrict who may deposit into Blue.
Sulu uses
ALLOWED_DEPOSIT_RECIPIENTS. Deprecated Phoenix and Encore releases used the equivalent investor/depositor whitelist and caller whitelist policies. Enzyme’s website exposes these asDepositorWhitelistandBuySharesCallerWhitelistrespectively.
- ALLOWED_DEPOSIT_RECIPIENTS_POLICY_IDENTIFIER = 'ALLOWED_DEPOSIT_RECIPIENTS'
Backwards-compatible public constant for the current Sulu identifier.
- ENZYME_BLUE_LEGACY_POLICY_MANAGERS: dict[tuple[int, str], eth_typing.evm.HexAddress] = {(1, '0x7e6d3b1161df9c9c7527f68d651b297d2fdb820b'): '0x0bd9f0465d21d4c300c7b8d781a013bdc87a31e8', (1, '0x9134c9975244b46692ad9a7da36dba8734ec6da3'): '0x4c2c07b15b0b32bad989d9defaec775e2aa8a7ad'}
Deprecated Ethereum releases do not expose
getPolicyManager()through their Comptroller ABI. Resolve their reviewed manager from the current FundDeployer recorded by the persistent Dispatcher. Source: https://github.com/enzymefinance/sdk/blob/main/packages/environment/src/deployments/ethereum.ts
- class EnzymeBlueVault
Bases:
eth_defi.vault.base.VaultBaseRead an Enzyme Blue VaultProxy and its paired ComptrollerProxy.
Create a scanner adapter for a canonical Blue VaultProxy.
- Parameters
web3 – Web3 connection for the vault’s chain.
spec – Chain and VaultProxy address.
token_cache – Shared ERC-20 metadata cache.
features – Scanner feature flags.
default_block_identifier – Optional point-in-time metadata block.
require_denomination_token – Base-class compatibility option.
- __init__(web3, spec, token_cache=None, features=None, default_block_identifier=None, require_denomination_token=False)
Create a scanner adapter for a canonical Blue VaultProxy.
- Parameters
web3 (web3.main.Web3) – Web3 connection for the vault’s chain.
spec (eth_defi.vault.base.VaultSpec) – Chain and VaultProxy address.
token_cache (Optional[dict]) – Shared ERC-20 metadata cache.
features (Optional[set[eth_defi.erc_4626.core.ERC4626Feature]]) – Scanner feature flags.
default_block_identifier (Optional[Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, int]]) – Optional point-in-time metadata block.
require_denomination_token (bool) – Base-class compatibility option.
- property address: eth_typing.evm.HexAddress
Return the canonical VaultProxy/share-token address.
- property vault_address: eth_typing.evm.HexAddress
Return scanner-compatible alias for
address.
- property vault_contract: web3.contract.contract.Contract
Load VaultLib ABI at the proxy address.
- property comptroller_contract: web3.contract.contract.Contract
Resolve and load the currently paired ComptrollerProxy.
- property denomination_token: eth_defi.token.TokenDetails
Fetch the current denominator ERC-20 token details.
- property short_description: Optional[str]
Return optional app-profile table copy for this Blue vault.
- get_strategy_tags()
Return default and documented strategy tags for this Blue vault.
The shared Enzyme mapping keys classifications by canonical share-token address. Every Enzyme vault receives the default discretionary-trading tag, while researched addresses receive additional strategy tags.
- Returns
A mutable set of default and address-specific strategy tags.
- Return type
Fetch the VaultProxy ERC-20 share token.
- Return type
Return cached VaultProxy share-token metadata.
Return the immutable VaultProxy share-token address.
- fetch_denomination_token_address()
Read the current ComptrollerProxy denomination token.
- Return type
- fetch_denomination_token()
Return the current Blue denominator token.
- Return type
- fetch_total_supply(block_identifier='latest')
Read human-readable VaultProxy share supply.
- fetch_total_assets(block_identifier='latest')
Read GAV expressed in human-readable denomination-token units.
Calculate GAV per human-readable share.
Return Blue GAV as scanner TVL.
- fetch_info()
Return current Blue contract and public manager profile details.
The manager object is populated from the cache written by the bounded app-profile migration. It is intentionally optional because the app backend is undocumented and a manager may leave any contact field empty.
- Returns
Blue contract addresses and cached manager profile fields.
- Return type
- fetch_portfolio(universe, block_identifier=None)
Return empty positions until Blue portfolio accounting is integrated.
- Parameters
universe (eth_defi.vault.base.TradingUniverse) –
block_identifier (Optional[Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, int]]) –
- Return type
- has_block_range_event_support()
Return false until Blue flow events are mapped to VaultProxy.
- Return type
- has_deposit_distribution_to_all_positions()
Return false; Blue allocations do not make this guarantee.
- Return type
- get_flow_manager()
Return the explicit unsupported Enzyme flow reader.
- Return type
- get_deposit_manager()
Reject unimplemented Blue transaction flows.
- get_historical_reader(stateful)
Return the GAV and supply historical reader.
Historical deposit and redemption availability remains unsupported; see
EnzymeBlueVaultHistoricalReaderfor the reason.- Parameters
stateful (bool) – Whether the shared reader should retain adaptive scan state between runs.
- Returns
Historical GAV and share-supply reader.
- Return type
- is_whitelisted_deposit()
Determine whether Blue limits investors through its recipient policy.
Enzyme Blue’s Allowed Deposit Recipients policy is the reviewed vault-level allowlist for
buyShares. The policy manager enumerates enabled policy contracts for the paired ComptrollerProxy. Every policy implementsidentifier(), so reading its stable identifier avoids hardcoding policy deployment addresses. Deprecated Phoenix and Encore Comptrollers cannot return their policy manager directly; for these releases the persistent Dispatcher gives the current FundDeployer, which is mapped to Enzyme’s reviewed release deployment metadata. The adapter does not treat asset, adapter, risk, redemption, or transfer policies as investor allowlists.This is a current-state classification only. A result of
Falsemeans no recipient allowlist policy is active; it does not promise a successful deposit because Blue can apply other policies, balances, approvals or fund-specific conditions.- Returns
TruewhenALLOWED_DEPOSIT_RECIPIENTSis enabled for this fund, otherwiseFalse.- Return type
- get_fee_mode()
Return Blue’s share-minting dilution fee mechanism.
- Return type
- get_fee_data()
Read current Blue investor fee rates.
Blue’s protocol fee is distinct from a fund’s optional ManagementFee plugin, but it is included in the exported management fee rather than exposed as a separate fee category. Enzyme’s canonical Protocol Fees documentation defines it as a charge on Assets Under Technology applied through share inflation; unlike the PerformanceFee it is not conditional on growth above a high-water mark. It is therefore a management fee for the public vault export.
Performance, entrance, and exit contracts store their rates in basis points. Enzyme’s canonical ManagementFee and Performance Fee documentation describes ManagementFee’s Ray-scaled per-second compounding factor and PerformanceFee’s high-water-mark calculation. Historical fee configuration is TODO because Blue fee plugins, releases, and protocol-fee trackers can be replaced.
- Returns
Current investor-facing fee settings.
managementincludes protocol access.protocolis retained as a breakdown, so the manager-only rate ismanagement - protocol.- Return type
- get_link(referral=None)
Return the address-specific Enzyme Blue application page.
Enzyme selects the deployment using a lower-case network query value. Linking the canonical VaultProxy directly avoids sending an investor to the generic discovery catalogue where they would need to locate the vault again.
- property deposit_manager: eth_defi.vault.deposit_redeem.VaultDepositManager
Deposit manager assocaited with this vault
- fetch_available_liquidity(block_identifier='latest')
Get the amount of denomination token available for immediate withdrawal.
Only applicable to lending protocol vaults (IPOR, Euler, Morpho, Gearbox, etc.). Non-lending protocols should leave this method unimplemented.
Note: maxRedeem(address(0)) does NOT work as a proxy for available liquidity because it requires a specific address that has already deposited shares. For address(0), balanceOf is always 0, so maxRedeem returns 0 regardless of actual liquidity.
- Parameters
block_identifier (Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, int]) – Block to query. Defaults to “latest”.
- Raises
NotImplementedError – For non-lending protocol vaults.
- Returns
Amount in denomination token units (human-readable Decimal).
- Return type
- fetch_deposit_closed_reason()
Get human-readable reason why deposits are closed.
Override in protocol-specific subclasses
Default behaviour: no closure reason is known (return None)
- Returns
Human-readable string explaining why deposits are closed, or None if deposits are open or the adapter cannot determine a closure reason. Use
fetch_deposit_open()for explicit tri-state availability metadata.Example reasons:
”Epoch redemption window closed (opens in 14h)”
”Vault paused by admin”
”Max deposit cap reached”
”Vault utilisation too high”
- Return type
- fetch_deposit_next_open()
Get when deposits will next be open.
For epoch-based vaults (Ostium, D2), return calculated window open time
For non-epoch vaults (Plutus, IPOR, Morpho), return None
Override in protocol-specific subclasses
- Returns
Naive UTC datetime when deposits will next be available, or None if:
Deposits are currently open
Timing is unpredictable (manually controlled)
Protocol does not support timing information
- Return type
- fetch_deposit_open()
Fetch the current protocol-defined deposit availability.
This is deliberately a tri-state value.
TrueandFalsemean that the adapter read an authoritative vault-wide state;Nonemeans that the generic adapter cannot safely determine the state. It is separate fromfetch_deposit_closed_reason(), because an absent human-readable reason does not prove that deposits are open.
- fetch_minimum_deposit(block_identifier='latest')
Fetch a source-proven minimum deposit in decimal token units.
A
Noneresult means this adapter does not expose a known minimum; it does not prove the protocol accepts arbitrarily small deposits. A zero result means the adapter positively established that the vault has no minimum deposit.- Parameters
block_identifier (Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, int]) – Block at which to read the protocol configuration.
- Returns
Decimal denomination-token minimum, or
Nonewhen unknown.- Return type
- fetch_minimum_redemption(block_identifier='latest')
Fetch a source-proven redemption minimum in decimal share units.
A
Noneresult means this adapter does not expose a known minimum; it does not prove the protocol accepts arbitrarily small redemptions. A zero result means the adapter positively established that the vault has no minimum redemption.- Parameters
block_identifier (Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, int]) – Block at which to read the protocol configuration.
- Returns
Decimal vault-share minimum, or
Nonewhen unknown.- Return type
- fetch_redemption_closed_reason()
Get human-readable reason why redemptions are closed.
Override in protocol-specific subclasses
Default behaviour: assume redemptions are always open (return None)
- fetch_redemption_next_open()
Get when withdrawals/redemptions will next be open.
For epoch-based vaults (Ostium, D2), return calculated window open time
For non-epoch vaults (Plutus, IPOR, Morpho), return None
Override in protocol-specific subclasses
- Returns
Naive UTC datetime when withdrawals will next be available, or None if:
Withdrawals are currently open
Timing is unpredictable (manually controlled)
Protocol does not support timing information
- Return type
- fetch_scan_record_extra_data()
Fetch protocol-specific private scan row columns.
Some vault protocols expose structured metadata that is useful for the raw scanner output but does not fit the shared human-readable columns. Override this hook in protocol-specific subclasses instead of adding a separate branch to
eth_defi.erc_4626.scan.create_vault_scan_record().
- fetch_utilisation_percent(block_identifier='latest')
Get the percentage of assets currently lent out.
Only applicable to lending protocol vaults (IPOR, Euler, Morpho, Gearbox, etc.). Non-lending protocols should leave this method unimplemented.
- Parameters
block_identifier (Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, int]) – Block to query. Defaults to “latest”.
- Raises
NotImplementedError – For non-lending protocol vaults.
- Returns
Utilisation as float between 0.0 and 1.0 (0% to 100%).
- Return type
- property flow_manager: eth_defi.vault.base.VaultFlowManager
Flow manager associated with this vault
- get_deposit_fee(block_identifier)
Deposit fee is set to zero by default as vaults usually do not have deposit fees.
Internal: Use
get_fee_data().
- get_deposit_manager_capability()
Return static public transaction-adapter support, if any.
This method deliberately does not attempt to construct a manager or query live pause, cap, epoch, balance, allow-list, or liquidity state. Adapters opt in only after their complete deposit and redemption lifecycles have focused coverage.
Noneis therefore the safe default for unknown and protocol-specific vaults.- Returns
Adapter-specific capability object, or
Nonewhen unsupported.- Return type
Optional[eth_defi.vault.deposit_redeem.VaultDepositManagerCapability]
- get_estimated_lock_up()
What is the estimated lock-up period for this vault.
- Returns
None if not know
- Return type
- get_flags()
Get various vault state flags from the smart contract.
Override to add status flags
Also add flags from our manual flag list in
eth_defi.vault.flag
The vault metadata scan stores this result as
_flagsinvault-metadata-db.pickle.top_vaults_by_chain.jsonis generated from those stored values throughscripts/erc-4626/vault-analysis-json.py/eth_defi.vault.top_vaults_json.After editing manual flags in
eth_defi.vault.flag, rerun the vault metadata scan and top-vault JSON post-processing. Regenerating the JSON from an old metadata database will not pick up new manual flags.- Returns
Flag set.
Do not modify in place.
- Return type
- get_management_fee(block_identifier)
Get the current management fee as a percent.
Internal: Use
get_fee_data().
- get_notes()
Get a human readable message if we know somethign special is going on with this vault.
- get_performance_fee(block_identifier)
Get the current performance fee as a percent.
Internal: Use
get_fee_data().
- get_risk()
Get risk profile of this vault.
- Return type
Return the source used for share-price observations.
Vault integrations override this method when they expose a share price. Returning
Nonedistinguishes unsupported or unknown pricing from a known source classification.- Returns
Share-price source, or
Nonewhen the adapter does not provide one.- Return type
- get_whitelist_notes()
Return an export caveat for the vault-wide whitelist status.
Adapters may attach a concise, stable explanation when a classification is an explicitly requested operating assumption or excludes an integration-specific permission mechanism. The note describes the policy classification only; it must not be used to report temporary deposit availability.
- get_withdraw_fee(block_identifier)
Withdraw fee is set to zero by default as vaults usually do not have withdraw fees.
Internal: Use
get_fee_data().
- get_withdrawal_period()
Return binding withdrawal timing and optional settlement estimates.
Unlike
get_estimated_lock_up(), this reports the redemption lifecycle after a user submits a valid withdrawal request. Adapters usemin_periodandmax_periodonly for a binding smart-contract timing rule. An adapter may instead return a non-bindingestimated_settlementfor backtesting an offchain operating cadence or redemption wait; that estimate never establishes claimability and does not require a synthetic timing bound.- Returns
Withdrawal period details, or
Nonewhen unavailable.- Return type
- has_custom_fees()
Does this vault have fees outside the shared fee model.
Custom fees cause risk in vault comparison because the shared management/performance/deposit/withdraw fee fields cannot describe the full fee structure.
Do not return
Truemerely because a vault implements custom accessors for ordinary management, performance, deposit, or withdraw fees. ReturnTrueonly when some vault fee cannot be reflected in those standard fields as a fee-like value.- Returns
Trueif the vault has fees outside the shared fee model.- Return type
- property info: eth_defi.vault.base.VaultInfo
Get info dictionary related to this vault deployment.
Get cached data on the various vault parameters
- Returns
Vault protocol specific information dictionary
- is_account_whitelisted(address)
Determine whether an account has completed the vault’s KYC policy.
The result concerns KYC, manual identity approval, or recipient allowlist membership only. A protocol may still require scheduling, a token balance, an allowance, available capacity, or an open epoch before a deposit can be submitted. Callers must use the relevant deposit manager pre-flight before broadcasting a transaction.
- Parameters
address (eth_typing.evm.HexAddress) – Account whose deposit-policy membership is queried.
- Returns
Truewhen the account has the required pre-approval.- Raises
NotImplementedError – If the adapter cannot safely query account membership.
- Return type