TokenisedFundDepositManager

Documentation for eth_defi.tokenised_fund.vault.TokenisedFundDepositManager Python class.

class TokenisedFundDepositManager

Bases: eth_defi.vault.deposit_redeem.VaultDepositManager

Fail-closed, non-operational manager for permissioned tokenised funds.

Tokenised funds are issuer-operated products whose subscriptions and redemptions require investor eligibility (KYC, allow-list, transfer agent) and offchain servicing, so there is no publicly executable onchain flow. This manager still implements the full VaultDepositManager interface — but every operational method is fail-closed — so scanner metadata can distinguish a deliberately unsupported permissioned product from an adapter whose capability is merely unknown. It never constructs, settles or analyses a transaction. All refusals route through _reject(), which raises VaultFlowUnavailable with a fixed reason (TOKENISED_FUND_FLOW_UNAVAILABLE) and the requested direction/phase.

Deposit process

Unsupported / fail-closed. has_synchronous_deposit() returns False; estimate_deposit(), create_deposit_request(), finish_deposit() and analyse_deposit() all raise VaultFlowUnavailable. can_create_deposit_request() returns False and get_max_deposit() returns zero.

Redemption process

Unsupported / fail-closed. has_synchronous_redemption() returns False; estimate_redeem(), create_redemption_request(), finish_redemption() and analyse_redemption() all raise VaultFlowUnavailable. can_create_redemption_request() and can_finish_redeem() return False.

Queues and settlement

None. No ticket can be created, so is_deposit_in_progress() and is_redemption_in_progress() return False, and reclaim_deposit() / reclaim_withdrawal() raise.

Lockups and cooldowns

Not applicable / not queryable. estimate_redemption_delay() raises VaultFlowUnavailable, and get_redemption_delay_over() returns None because no redemption can ever be created.

Whitelisting / access control

Permissioned. At the vault level TokenisedFundVault.is_whitelisted_deposit() always returns True, marking these subscriptions as gated, but concrete membership is not queryable here — eligibility is enforced offchain by the issuer, so is_account_whitelisted stays protocol-specific and this base manager does not attempt to evaluate it.

Anvil settlement (force_settle)

Unlike the synchronous ERC-4626 managers, force_settle() does not perform a no-op: it raises VaultFlowUnavailable (phase="settlement"), because there is no fund transaction to settle.

Attributes summary

web3

Methods summary

__init__(vault)

analyse_deposit(claim_tx_hash, deposit_ticket)

Reject analysis because this manager cannot produce deposit transactions.

analyse_redemption(claim_tx_hash, ...)

Reject analysis because this manager cannot produce redemption transactions.

can_create_deposit_request(owner)

Return false because public tokenised-fund deposits are unsupported.

can_create_redemption_request(owner)

Return false because public tokenised-fund redemptions are unsupported.

can_finish_deposit(deposit_ticket)

Return false because this manager cannot create deposits.

can_finish_redeem(redemption_ticket)

Return false because this manager cannot create redemptions.

check_deposit_whitelist(owner)

Reject a deposit when the vault's whitelist excludes the owner.

create_deposit_request(owner[, to, amount, ...])

Reject creation of a public tokenised-fund deposit.

create_deposit_request_for_guard_validation(...)

Build deposit calldata for a closed-vault GuardV0 policy check.

create_redemption_request(owner[, to, ...])

Reject creation of a public tokenised-fund redemption.

estimate_deposit(owner, amount[, ...])

Reject estimation of an unsupported deposit.

estimate_redeem(owner, shares[, ...])

Reject estimation of an unsupported redemption.

estimate_redemption_delay()

Reject delay estimation for an unsupported redemption.

fetch_completed_redemption_tx_hash(ticket)

Find an operator-owned terminal redemption transaction when available.

fetch_vault_flow_events(hypersync_client, ...)

Fetch asynchronous vault request events from an indexed backend.

finish_deposit(deposit_ticket)

Reject completion of an unsupported deposit.

finish_redemption(redemption_ticket)

Reject completion of an unsupported redemption.

force_redemption_liquidity(owner, ...)

Provision an unavailable synchronous redemption on an Anvil fork.

force_settle(ticket, *[, mock, ignore_liquidity])

Reject settlement of an unsupported tokenised-fund flow.

get_deposit_approval_target()

Return the ERC-20 spender required for a deposit request.

get_deposit_delay_over(address)

Estimate when a pending async deposit request will settle.

get_deposit_request_status(ticket)

Query the current status of an async deposit request.

get_max_deposit(owner)

Return zero because this manager refuses public deposits.

get_redemption_delay_over(address)

Return no deadline because no redemption can be created.

get_redemption_request_status(ticket)

Query the current status of an async redemption request.

has_synchronous_deposit()

Return false because no public deposit flow is supported.

has_synchronous_redemption()

Return false because no public redemption flow is supported.

is_deposit_in_progress(owner)

Return false because this manager cannot create deposits.

is_redemption_in_progress(owner)

Return false because this manager cannot create redemptions.

reclaim_deposit(ticket)

Reject recovery because this manager cannot create deposit tickets.

reclaim_withdrawal(ticket)

Reject recovery because this manager cannot create redemption tickets.

reconstruct_deposit_ticket(data)

Reconstruct a deposit ticket from a serialised dict.

reconstruct_redemption_ticket(data)

Reconstruct a redemption ticket from a serialised dict.

serialize_deposit_ticket(ticket)

Serialise a deposit ticket to a dict for persistence.

serialize_redemption_ticket(ticket)

Serialise a redemption ticket to a dict for persistence.

force_settle(ticket, *, mock=None, ignore_liquidity=False)

Reject settlement of an unsupported tokenised-fund flow.

Parameters
Return type

eth_defi.vault.deposit_redeem.VaultForcedSettlementResult

reclaim_deposit(ticket)

Reject recovery because this manager cannot create deposit tickets.

Parameters

ticket (eth_defi.vault.deposit_redeem.DepositTicket) –

Return type

Optional[web3.contract.contract.ContractFunction]

reclaim_withdrawal(ticket)

Reject recovery because this manager cannot create redemption tickets.

Parameters

ticket (eth_defi.vault.deposit_redeem.RedemptionTicket) –

Return type

Optional[web3.contract.contract.ContractFunction]

has_synchronous_deposit()

Return false because no public deposit flow is supported.

Return type

bool

has_synchronous_redemption()

Return false because no public redemption flow is supported.

Return type

bool

estimate_deposit(owner, amount, block_identifier='latest')

Reject estimation of an unsupported deposit.

Parameters
Return type

decimal.Decimal

estimate_redeem(owner, shares, block_identifier='latest')

Reject estimation of an unsupported redemption.

Parameters
Return type

decimal.Decimal

create_deposit_request(owner, to=None, amount=None, raw_amount=None, check_max_deposit=True, check_enough_token=True)

Reject creation of a public tokenised-fund deposit.

Parameters
Return type

eth_defi.vault.deposit_redeem.DepositRequest

create_redemption_request(owner, to=None, shares=None, raw_shares=None, check_max_deposit=True, check_enough_token=True)

Reject creation of a public tokenised-fund redemption.

Parameters
Return type

eth_defi.vault.deposit_redeem.RedemptionRequest

is_redemption_in_progress(owner)

Return false because this manager cannot create redemptions.

Parameters

owner (eth_typing.evm.HexAddress) –

Return type

bool

is_deposit_in_progress(owner)

Return false because this manager cannot create deposits.

Parameters

owner (eth_typing.evm.HexAddress) –

Return type

bool

can_create_deposit_request(owner)

Return false because public tokenised-fund deposits are unsupported.

Parameters

owner (eth_typing.evm.HexAddress) –

Return type

bool

get_max_deposit(owner)

Return zero because this manager refuses public deposits.

Parameters

owner (eth_typing.evm.HexAddress) –

Return type

decimal.Decimal

can_create_redemption_request(owner)

Return false because public tokenised-fund redemptions are unsupported.

Parameters

owner (eth_typing.evm.HexAddress) –

Return type

bool

can_finish_redeem(redemption_ticket)

Return false because this manager cannot create redemptions.

Parameters

redemption_ticket (eth_defi.vault.deposit_redeem.RedemptionTicket) –

Return type

bool

can_finish_deposit(deposit_ticket)

Return false because this manager cannot create deposits.

Parameters

deposit_ticket (eth_defi.vault.deposit_redeem.DepositTicket) –

Return type

bool

finish_deposit(deposit_ticket)

Reject completion of an unsupported deposit.

Parameters

deposit_ticket (eth_defi.vault.deposit_redeem.DepositTicket) –

Return type

web3.contract.contract.ContractFunction

finish_redemption(redemption_ticket)

Reject completion of an unsupported redemption.

Parameters

redemption_ticket (eth_defi.vault.deposit_redeem.RedemptionTicket) –

Return type

Optional[web3.contract.contract.ContractFunction]

estimate_redemption_delay()

Reject delay estimation for an unsupported redemption.

Return type

datetime.timedelta

get_redemption_delay_over(address)

Return no deadline because no redemption can be created.

Parameters

address (Union[eth_typing.evm.HexAddress, str]) –

Return type

Optional[datetime.datetime]

analyse_deposit(claim_tx_hash, deposit_ticket)

Reject analysis because this manager cannot produce deposit transactions.

Parameters
Return type

Union[eth_defi.vault.deposit_redeem.DepositRedeemEventAnalysis, eth_defi.vault.deposit_redeem.DepositRedeemEventFailure]

analyse_redemption(claim_tx_hash, redemption_ticket)

Reject analysis because this manager cannot produce redemption transactions.

Parameters
Return type

Union[eth_defi.vault.deposit_redeem.DepositRedeemEventAnalysis, eth_defi.vault.deposit_redeem.DepositRedeemEventFailure]

__init__(vault)
Parameters

vault (eth_defi.vault.base.VaultBase) –

check_deposit_whitelist(owner)

Reject a deposit when the vault’s whitelist excludes the owner.

Shared deposit-preflight helper implementing the whitelisting contract every manager must honour: when a vault applies a deposit whitelist policy that is applicable and queryable, and owner is not a member of it, raise WhitelistingRequired before any transaction is broadcast so the caller can surface a “whitelisting required” state instead of paying gas for a guaranteed revert.

The check is intentionally conservative — it only raises when the whitelist information can be obtained and is applicable:

  • if is_whitelisted_deposit() raises NotImplementedError, the vault-wide policy cannot be determined for this adapter/version, so no exception is raised;

  • if the vault is permissionless, no exception is raised;

  • if is_account_whitelisted() raises NotImplementedError, per-account membership cannot be queried, so no exception is raised;

  • only when the policy is applicable and the owner is provably not admitted is WhitelistingRequired raised.

Adapters that need a stricter fail-closed policy for an unknown admission state should override their own preflight and raise VaultFlowUnavailable in addition to calling this helper (see the Lagoon manager for an example).

Parameters

owner (eth_typing.evm.HexAddress) – Deposit owner and controller whose whitelist membership is checked.

Raises

WhitelistingRequired – When the vault applies an applicable, queryable whitelist policy and owner is not permitted to deposit.

Return type

None

create_deposit_request_for_guard_validation(owner, raw_amount)

Build deposit calldata for a closed-vault GuardV0 policy check.

This Anvil-only diagnostic path is for a consumer that has already received a typed deposit_closed or deposit_paused preflight result. Adapters must override it only after proving that their typed result represents a temporary vault closure rather than a capacity or amount restriction. The returned calls must be supplied individually to GuardV0.validateCall(); callers must never broadcast them to the closed protocol vault.

Parameters
  • owner (eth_typing.evm.HexAddress) – SimpleVaultV0/Safe address that would own the shares.

  • raw_amount (int) – Denomination-token amount in the selected asset’s raw unit.

Returns

Manager-generated deposit request suitable only for isolated GuardV0 validation.

Raises

UnsupportedVaultSimulation – Unless the protocol-specific manager implements this diagnostic path.

Return type

eth_defi.vault.deposit_redeem.DepositRequest

fetch_completed_redemption_tx_hash(ticket)

Find an operator-owned terminal redemption transaction when available.

Claim-based protocols finish through finish_redemption() and do not need this lookup. Operator-finalised protocols override the hook to find and validate the transaction that paid the requested receiver.

Parameters

ticket (eth_defi.vault.deposit_redeem.RedemptionTicket) – Persisted redemption request to locate.

Returns

Terminal transaction hash, or None if the protocol has not observed one yet.

Return type

Optional[hexbytes.main.HexBytes]

fetch_vault_flow_events(hypersync_client, start_block, end_block)

Fetch asynchronous vault request events from an indexed backend.

The base implementation returns no events for vault managers that do not have a two-phase deposit or redemption flow.

Parameters
  • hypersync_client – Configured Hypersync client for this vault’s chain.

  • start_block (int) – Inclusive start block.

  • end_block (int) – Inclusive end block.

Returns

Iterator of protocol-neutral pending vault flow events.

Return type

collections.abc.Iterator[eth_defi.vault.flow_events.PendingVaultFlow]

force_redemption_liquidity(owner, raw_shares, failure)

Provision an unavailable synchronous redemption on an Anvil fork.

Concrete managers may implement this only for a source-proven liquidity failure. The default is deliberately unsupported: this hook must never bypass admission, minimums, maturity or time locks.

Parameters
Returns

Structured intervention evidence from a concrete manager.

Raises

UnsupportedVaultSimulation – Always for managers without a protocol-specific implementation.

Return type

eth_defi.vault.deposit_redeem.VaultRedemptionSimulationIntervention

get_deposit_approval_target()

Return the ERC-20 spender required for a deposit request.

Standard ERC-4626 and the currently supported async adapters pull denomination tokens from the vault address itself. An adapter using a different router or silo must override this method; guarded callers use it to whitelist and validate the exact approval calldata.

Returns

ERC-20 approval spender address.

Return type

eth_typing.evm.HexAddress

get_deposit_delay_over(address)

Estimate when a pending async deposit request will settle.

  • Mirror of get_redemption_delay_over() for the deposit side.

  • Used to show an estimated settlement time for unsettled deposits (e.g. in the trade-executor trade-ui table).

  • Default returns None: the protocol has no deterministic onchain settlement schedule (e.g. operator-driven ERC-7540 vaults like Lagoon). Subclasses with a predictable settlement cadence (e.g. Ostium V1.5) override this to return an estimated UTC timestamp.

Parameters

address (Union[eth_typing.evm.HexAddress, str]) – Owner of the pending deposit request.

Returns

Naive UTC timestamp when the deposit is expected to settle, or None when no onchain estimate is available.

Return type

Optional[datetime.datetime]

get_deposit_request_status(ticket)

Query the current status of an async deposit request.

Default implementation probes via can_finish_deposit(). Subclasses should override for more accurate status reporting (e.g. distinguishing reclaimable from pending).

Parameters

ticket (eth_defi.vault.deposit_redeem.DepositTicket) –

Return type

eth_defi.vault.deposit_redeem.AsyncVaultRequestStatus

get_redemption_request_status(ticket)

Query the current status of an async redemption request.

Default implementation probes via can_finish_redeem(). Subclasses should override for more accurate status reporting.

Parameters

ticket (eth_defi.vault.deposit_redeem.RedemptionTicket) –

Return type

eth_defi.vault.deposit_redeem.AsyncVaultRequestStatus

reconstruct_deposit_ticket(data)

Reconstruct a deposit ticket from a serialised dict.

Default returns a base DepositTicket. Subclasses override for protocol-specific ticket types.

Parameters

data (dict) –

Return type

eth_defi.vault.deposit_redeem.DepositTicket

reconstruct_redemption_ticket(data)

Reconstruct a redemption ticket from a serialised dict.

Async vault managers must override this to return their protocol-specific ticket subclass. The base implementation raises NotImplementedError because RedemptionTicket has abstract methods.

Parameters

data (dict) –

Return type

eth_defi.vault.deposit_redeem.RedemptionTicket

serialize_deposit_ticket(ticket)

Serialise a deposit ticket to a dict for persistence.

The trade-executor stores this in trade.other_data so that the settlement retry module can reconstruct the ticket after a process restart.

Default implementation stores base DepositTicket fields. Subclasses override to add protocol-specific fields (e.g. settlement_id for Ostium, requestId for ERC-7540).

Parameters

ticket (eth_defi.vault.deposit_redeem.DepositTicket) –

Return type

dict

serialize_redemption_ticket(ticket)

Serialise a redemption ticket to a dict for persistence.

Default implementation stores base RedemptionTicket fields. Subclasses override to add protocol-specific fields.

Parameters

ticket (eth_defi.vault.deposit_redeem.RedemptionTicket) –

Return type

dict