UpshiftVault
Documentation for eth_defi.erc_4626.vault_protocol.upshift.vault.UpshiftVault Python class.
- class UpshiftVault
Bases:
eth_defi.erc_4626.vault.ERC4626VaultUpshift protocol vaults.
Upshift democratises institutional-grade DeFi yield strategies through non-custodial vaults built on August infrastructure.
The adapter supports two observed contract families:
TokenizedAccount ERC-4626 vaults, such as Upshift AZT.
Upshift
multiAssetVaultproxies, such as RockawayX’s Tori Ecosystem Vault and Earn ctUSD vault. These expose accounting on the vault proxy and share-token metadata throughlpTokenAddress().
Links:
Fee mechanism:
Upshift vaults have multiple fee types that are configured per-vault and managed by the vault operator. The fee functions in the smart contract include:
withdrawalFee(): Fee charged on standard withdrawalsinstantRedemptionFee(): Higher fee for immediate redemptions bypassing the claim queueManagement fees are charged periodically via
chargeManagementFee()
See the TokenizedAccount implementation for the fee collection logic.
- Parameters
web3 – Connection we bind this instance to
spec – Chain, address tuple
token_cache –
Cache used with
fetch_erc20_details()to avoid multiple calls to the same token.Reduces the number of RPC calls when scanning multiple vaults.
features – Pass vault feature flags along, externally detected.
default_block_identifier –
Override block identifier for on-chain metadata reads.
When
None, useget_safe_cached_latest_block_number()(the default, safe for broken RPCs). Set to"latest"for freshly deployed vaults whose contracts do not exist at the safe-cached block.require_denomination_token – If
True, accessingdenomination_tokenwill raiseRuntimeErrorwhen the on-chain lookup returnsNone.
Attributes summary
Get the vault smart contract address.
Get the multi-asset denomination-token whitelist contract.
Chain this vault is on
Get the token which denominates the vault valuation
Deposit manager assocaited with this vault
Return the full Upshift-supplied vault strategy description.
Is this ERC-7540 vault with asynchronous deposits.
Flow manager associated with this vault
Get info dictionary related to this vault deployment.
Expose Upshift strategist brands through the generic manager field.
Is this an Upshift multi-asset vault.
Vault name.
ERC-20 that presents vault shares.
Derive a one-sentence vault summary from Upshift's API description.
Vault share token symbol
Alias for
denomination_token()Alias for the Upshift implementation-specific vault contract.
Fetch cached public Upshift vault metadata.
vault_addressvault_address_checksumlessGet the vault deployment.
Methods summary
__init__(web3, spec[, token_cache, ...])- param web3
Can the generic ERC-4626
maxDeposit(address(0))probe be used.Check if maxRedeem(address(0)) can be used to check global redemption availability.
Fetch every configured multi-asset denomination token.
fetch_available_liquidity([block_identifier])Fetch immediately available withdrawal liquidity.
Fetch Upshift's primary denomination token.
Get the
asset()denomination token address of this vault.Fetch live deposit closure reason.
Get when deposits will next be open.
Use
info()property for cached access.fetch_instant_redemption_fee(block_identifier)Read the extra instant-redemption fee outside the shared fee schema.
fetch_nav([block_identifier])Fetch the most recent onchain NAV value.
fetch_portfolio(universe[, ...])Read the current token balances of a vault.
Fetch live redemption closure reason.
Get when withdrawals/redemptions will next be open.
Fetch protocol-specific private scan row columns.
fetch_share_price(block_identifier)Fetch the current share price.
Read share token details onchain.
fetch_share_token_address([block_identifier])Get the share token address.
Fetch the Upshift strategist identity from public metadata.
fetch_total_assets(block_identifier)Fetch vault NAV in denomination token units.
fetch_total_supply(block_identifier)Fetch current outstanding share supply.
fetch_utilisation_percent([block_identifier])Get the percentage of assets currently lent out.
Get all information we can extract from the vault smart contracts.
get_deposit_fee(block_identifier)Deposit fee is set to zero by default as vaults usually do not have deposit fees.
Get deposit/redeem manager.
Declare only Upshift's normal ERC-4626 vault shape.
Upshift vaults use a daily claim processing system.
Get fee data structure for this vault.
Return the fee-accounting model when the vault exposes it.
Get various vault state flags from the smart contract.
Get flow manager to read indiviaul settle events.
get_historical_reader(stateful)Get the historical reader for this Upshift vault.
get_link([referral])Get link to the vault on Upshift app.
get_management_fee(block_identifier)Get management fee.
Get a human readable message if we know somethign special is going on with this vault.
get_performance_fee(block_identifier)Get performance fee.
Return the name of the vault protocol.
get_risk()Get risk profile of this vault.
get_spec()Build static metadata for a verified synchronous manager.
get_withdraw_fee(block_identifier)Read the standard queued-redemption fee.
Does this vault support block range-based event queries for deposits and redemptions.
Upshift has withdrawal and instant redemption fees.
Deposits go automatically to all open positions.
is_account_whitelisted(address)Determine whether an account belongs to the vault deposit policy.
is_valid()Check if this vault is valid.
Determine whether this vault applies a deposit whitelist policy.
Check whether the live vault exposes the standard ERC-4626 surface.
- property upshift_metadata: Optional[eth_defi.erc_4626.vault_protocol.upshift.offchain_metadata.UpshiftVaultMetadata]
Fetch cached public Upshift vault metadata.
Upshift supplies descriptions, named strategists and named operator wallets through its vault API. The API does not expose a curator field, so strategist identities must not be treated as verified curator records without an external mapping.
- Returns
Parsed public metadata, or
Nonewhen no API record is accessible for this vault.
- property description: Optional[str]
Return the full Upshift-supplied vault strategy description.
- Returns
Public Upshift description, or
Nonewhen it is not available.
- property short_description: Optional[str]
Derive a one-sentence vault summary from Upshift’s API description.
Upshift does not expose a dedicated short-description field, so this follows the IPOR metadata convention and uses the first sentence of its long-form strategy description.
- Returns
First sentence of the public Upshift description, or
Nonewhen the API does not supply one.
- property manager_name: Optional[str]
Expose Upshift strategist brands through the generic manager field.
- Returns
Comma-separated strategist display names, or
Nonewhen the API does not publish any strategist names.
- fetch_strategist()
Fetch the Upshift strategist identity from public metadata.
Upshift calls these records
hardcoded_strategists. This is the closest available offchain manager identity, but it is not an explicit curator field. Named EOA operators are intentionally not used because they identify operational wallets rather than the strategy brand.
- property multi_asset_like: bool
Is this an Upshift multi-asset vault.
- Returns
True when the feature detector saw
assetsWhitelistAddress()on the vault proxy.
- property vault_contract: web3.contract.contract.Contract
Get the vault deployment.
Multi-asset vaults need a dedicated ABI because their accounting methods are not part of the generic ERC-4626 ABI.
- Returns
Web3 contract proxy for the vault address.
- property upshift_contract: web3.contract.contract.Contract
Alias for the Upshift implementation-specific vault contract.
- property assets_whitelist_contract: web3.contract.contract.Contract
Get the multi-asset denomination-token whitelist contract.
- Returns
The configured whitelist contract.
- Raises
ValueError – If this is not an Upshift multi-asset vault.
- fetch_all_denomination_tokens()
Fetch every configured multi-asset denomination token.
The returned tuple preserves the onchain whitelist ordering. That ordering determines the primary token returned by
fetch_denomination_token().- Returns
Whitelisted denomination tokens in protocol order. Standard single-asset Upshift vaults return their normal denomination token.
- Raises
ValueError – If a configured token cannot be read as an ERC-20.
- Return type
- fetch_denomination_token()
Fetch Upshift’s primary denomination token.
Supported simulation path
Multi-asset vaults use the first token in the onchain whitelist as their primary denomination token. The representative integration path uses a vault whose first token is USDC.
Known limitations
Only the first token is selected as the primary denomination token. Remaining whitelisted tokens are discovered by
fetch_all_denomination_tokens()but are not supported by the deposit manager yet.- Returns
First whitelisted token for a multi-asset vault, or the normal ERC-4626 denomination token for a standard Upshift vault.
- Return type
- fetch_share_token_address(block_identifier='latest')
Get the share token address.
Upshift multi-asset vault proxies keep ERC-20 share metadata on a separate LP token returned by
lpTokenAddress(). TokenizedAccount vaults remain standard ERC-4626 share-token contracts.
- fetch_total_supply(block_identifier)
Fetch current outstanding share supply.
For Upshift multi-asset vaults,
fetch_share_token_address()remaps the share token to the LP token returned bylpTokenAddress(). Keeping this method explicit documents that all inherited callers offetch_total_supply()use LP token supply, not the vault proxy address.
- has_custom_fees()
Upshift has withdrawal and instant redemption fees.
- Return type
- get_fee_mode()
Return the fee-accounting model when the vault exposes it.
Multi-asset vaults accrue management and performance fees against vault assets, making the share price net of those fees. TokenizedAccount vaults do not expose those configuration values, so their overall fee mode remains unknown.
- Returns
internalised_skimmingfor multi-asset vaults, otherwiseNone.- Return type
- get_management_fee(block_identifier)
Get management fee.
Multi-asset vaults expose
managementFeePercent()in basis points. TokenizedAccount contracts do not expose an equivalent fee getter, so their management fee remains unknown rather than being treated as zero.
- get_performance_fee(block_identifier)
Get performance fee.
Multi-asset vaults expose
performanceFeeRate()in parts per million. TokenizedAccount contracts do not expose an equivalent fee getter, so their performance fee remains unknown rather than being treated as zero.
- get_withdraw_fee(block_identifier)
Read the standard queued-redemption fee.
withdrawalFee()excludes the separate fee for the optional instant redemption path. That additional fee remains represented byhas_custom_fees().- Parameters
block_identifier (Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, int]) – Block number or
"latest"at which to read the configuration.- Returns
Decimal withdrawal-fee fraction, e.g.
0.002for 20 bps.- Return type
- fetch_instant_redemption_fee(block_identifier)
Read the extra instant-redemption fee outside the shared fee schema.
Upshift supports a queued redemption flow and an optional immediate redemption. The latter fee cannot be substituted for the standard withdrawal fee because it applies only when a user chooses that path.
- Parameters
block_identifier (Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, int]) – Block number or
"latest"at which to read the configuration.- Returns
Decimal instant-redemption fee fraction, e.g.
0.002for 20 bps.- Return type
- fetch_total_assets(block_identifier)
Fetch vault NAV in denomination token units.
Multi-asset vaults use
getTotalAssets()instead of the ERC-4626totalAssets()function.- Parameters
block_identifier (Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, int]) – Block number or
"latest".- Returns
NAV in denomination token units, or
Noneif the denomination token is unavailable.- Return type
- fetch_share_price(block_identifier)
Fetch the current share price.
Multi-asset vaults expose the canonical price through
getSharePrice().
- fetch_nav(block_identifier=None)
Fetch the most recent onchain NAV value.
- Parameters
block_identifier – Block number or
"latest".- Returns
NAV in denomination token units.
- Return type
- get_deposit_manager()
Get deposit/redeem manager.
The generic ERC-4626 deposit manager calls ERC-4626 deposit/redeem functions on the vault address. Upshift multi-asset vaults are proxy accounting contracts and use protocol-specific deposit flows through the Upshift app, so exposing the generic manager would be misleading.
- get_deposit_manager_capability()
Declare only Upshift’s normal ERC-4626 vault shape.
Multi-asset accounting vaults use a separate application flow and must never be represented as generic deposit-manager support.
- Returns
Synchronous two-way capability for the normal shape, or
Nonefor multi-asset vaults.- Return type
- can_check_deposit()
Can the generic ERC-4626
maxDeposit(address(0))probe be used.- Return type
- fetch_deposit_closed_reason()
Fetch live deposit closure reason.
Upshift multi-asset vaults expose deposit availability with
depositsPaused()andmaxDepositAmount()instead of ERC-4626maxDeposit(address).
- fetch_redemption_closed_reason()
Fetch live redemption closure reason.
Upshift multi-asset vaults expose redemption availability with
withdrawalsPaused()andmaxWithdrawalAmount()instead of ERC-4626maxRedeem(address).
- fetch_available_liquidity(block_identifier='latest')
Fetch immediately available withdrawal liquidity.
For Upshift multi-asset vaults,
maxWithdrawalAmount()is denominated in the vault denomination token and mirrors the value exported by the historical reader asavailable_liquidity.
- get_historical_reader(stateful)
Get the historical reader for this Upshift vault.
- Parameters
stateful (bool) – Whether to use adaptive reader state.
- Returns
Upshift multi-asset reader for multi-asset vaults, otherwise the generic ERC-4626 reader.
- Return type
- get_estimated_lock_up()
Upshift vaults use a daily claim processing system.
Withdrawals are processed through a request-claim system where users request redemption and then claim on designated days. Some curated pre-deposit vaults can have longer strategy-specific lock-ups; these are not exposed through the generic adapter.
- Return type
- __init__(web3, spec, token_cache=None, features=None, default_block_identifier=None, require_denomination_token=False)
- Parameters
web3 (web3.main.Web3) – Connection we bind this instance to
spec (eth_defi.vault.base.VaultSpec) – Chain, address tuple
token_cache (Optional[dict]) –
Cache used with
fetch_erc20_details()to avoid multiple calls to the same token.Reduces the number of RPC calls when scanning multiple vaults.
features (Optional[set[eth_defi.erc_4626.core.ERC4626Feature]]) – Pass vault feature flags along, externally detected.
default_block_identifier (Optional[Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, hexbytes.main.HexBytes, int]]) –
Override block identifier for on-chain metadata reads.
When
None, useget_safe_cached_latest_block_number()(the default, safe for broken RPCs). Set to"latest"for freshly deployed vaults whose contracts do not exist at the safe-cached block.require_denomination_token (bool) – If
True, accessingdenomination_tokenwill raiseRuntimeErrorwhen the on-chain lookup returnsNone.
- property address: eth_typing.evm.HexAddress
Get the vault smart contract address.
- can_check_redeem()
Check if maxRedeem(address(0)) can be used to check global redemption availability.
Most protocols return 0 for maxRedeem(address(0)) because that address has no balance/shares, not because redemptions are closed:
Gearbox: maxRedeem returns min(balanceOf(owner), convertToShares(availableLiquidity))
Most vaults: Return 0 because address(0) has no shares
Some protocols do use maxRedeem(address(0)) meaningfully:
Morpho, IPOR, Plutus: Return 0 when redemptions are globally blocked
Override to return True in subclasses that support address(0) redemption checks.
- Returns
True if maxRedeem(address(0)) returns meaningful values for global redemption availability checking.
- Return type
- property chain_id: int
Chain this vault is on
- property denomination_token: Optional[eth_defi.token.TokenDetails]
Get the token which denominates the vault valuation
Used in deposits and redemptions
Used in NAV calculation
Used in profit benchmarks
Usually USDC
- Returns
Token wrapper instance.
Maybe None for broken vaults like https://arbiscan.io/address/0x9d0fbc852deccb7dcdd6cb224fa7561efda74411#code
Note
Noneresults are not cached — the next access will retry the on-chain call. This avoids permanently caching a transient RPC failure.
- property deposit_manager: eth_defi.vault.deposit_redeem.VaultDepositManager
Deposit manager assocaited with this vault
- property erc_7540: bool
Is this ERC-7540 vault with asynchronous deposits.
For example
previewDeposit()function and other functions will revert
- fetch_denomination_token_address()
Get the
asset()denomination token address of this vault.Results are disk-cached per
(chain_id, vault_address)viaeth_defi.erc_4626.vault_tokenwhen the vault was constructed with aeth_defi.token.TokenDiskCacheand no pinneddefault_block_identifier. The denomination token is immutable post-deployment, so the cached value is correct regardless of which block the caller would have asked for.Only a definitive non-null answer is persisted. The
Nonepath taken on revert / broken contract is never cached, matching the behaviour ofeth_defi.vault.base.VaultBase.denomination_token()which explicitly avoids memoisingNoneso transient failures can be retried.To disable the cache, pass
token_cache=None(or any non-TokenDiskCachedict) when constructing the vault, or construct with a pinneddefault_block_identifier.- Returns
Denomination token address, or
Noneif the vault contract is broken and did not return a valid address.- 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_info()
Use
info()property for cached access.- Returns
See
LagoonVaultInfo- Return type
- fetch_portfolio(universe, block_identifier=None, allow_fallback=True)
Read the current token balances of a vault.
SHould be supported by all implementations
- 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, hexbytes.main.HexBytes, int]]) –
allow_fallback (bool) –
- Return type
- 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_share_token()
Read share token details onchain.
Use
share_token()for cached access.- Return type
- 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
- fetch_vault_info()
Get all information we can extract from the vault smart contracts.
- 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_fee_data()
Get fee data structure for this vault.
- Raises
ValueError – In the case of broken or unimplemented fee reading methods in the smart contract
- 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
- Returns
Flag set.
Do not modify in place.
- Return type
- get_flow_manager()
Get flow manager to read indiviaul settle events.
Only supported if
has_block_range_event_support()is True
- Return type
- get_link(referral=None)
Get link to the vault on Upshift app.
URL format: https://app.upshift.finance/pools/{chain_id}/{checksummed_address}
- get_notes()
Get a human readable message if we know somethign special is going on with this vault.
- get_protocol_name()
Return the name of the vault protocol.
- Return type
- get_risk()
Get risk profile of this vault.
- Return type
- get_synchronous_deposit_manager_capability()
Build static metadata for a verified synchronous manager.
A caller must already have established the reader class’ guarded fork evidence. This deliberately performs no RPC reads: the capability is static library metadata, not a live vault availability check.
- Returns
Synchronous two-way capability.
- Return type
- has_block_range_event_support()
Does this vault support block range-based event queries for deposits and redemptions.
If not we use chain balance polling-based approach
- has_deposit_distribution_to_all_positions()
Deposits go automatically to all open positions.
Deposits do not land into the vault as cash
Instead, smart contracts automatically increase all open positions
The behaviour of Velvet Capital
- 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 belongs to the vault deposit policy.
The result concerns policy membership only. A protocol may still require scheduling, 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 belongs to the applicable policy.- Raises
NotImplementedError – If the adapter cannot safely query account membership.
- Return type
- is_valid()
Check if this vault is valid.
Call a known smart contract function to verify the function exists
- Return type
- is_whitelisted_deposit()
Determine whether this vault applies a deposit whitelist policy.
Protocol adapters override this predicate only when their deployed contract version exposes a reliable vault-wide policy read.
Truemeans the vault requires account permission;Falsemeans its policy is permissionless. This is independent of a caller’s current balance, allowance, pause state, capacity, and request lifecycle.- Returns
Truefor a whitelist-restricted vault andFalsefor a permissionless vault.- Raises
NotImplementedError – If the adapter cannot safely determine the policy.
- Return type
- property name: str
Vault name.
- property share_token: eth_defi.token.TokenDetails
ERC-20 that presents vault shares.
User gets shares on deposit and burns them on redemption
- supports_generic_deposit_manager()
Check whether the live vault exposes the standard ERC-4626 surface.
This is deliberately an interface check, not a public support claim. Callers must still execute a guarded fork probe before relying on the generic manager for a protocol-specific adapter.
- Returns
Truewhenassetsucceeds with a non-zero asset address. Deposit and redemption availability is established only by a guarded fork transaction, not by ERC-4626max*advisory values.- Return type
- property symbol: str
Vault share token symbol
- property underlying_token: eth_defi.token.TokenDetails
Alias for
denomination_token()