wait_for_vault_deposit_confirmation

Documentation for eth_defi.hyperliquid.api.wait_for_vault_deposit_confirmation function.

wait_for_vault_deposit_confirmation(session, user, vault_address, expected_deposit, existing_equity=None, timeout=60.0, poll_interval=2.0, tolerance=Decimal('0.01'), relative_tolerance=Decimal('0.05'), first_deposit_relative_tolerance=Decimal('0.01'))

Observe vault equity until its deposit threshold is reached or time runs out.

After a CoreWriter vaultTransfer action succeeds on HyperEVM, HyperCore may take several seconds to process the deposit. This function polls userVaultEquities until the expected equity appears or increases.

The deadline includes network reads and poll sleeps. Strict callers still receive HypercoreDepositVerificationError if the threshold is not reached. A live executor may deliberately treat that exception as a warning: an existing holding’s trading PnL can conceal a small successful top-up, so equity growth cannot establish the amount actually deposited. Market gains can also reach the threshold without a successful deposit. The historical function name is retained for existing callers.

Handles two cases:

  • New position: existing_equity is None. Requires equity near the expected amount, so old dust cannot satisfy a strict caller’s first-deposit check.

  • Existing position: existing_equity is provided. Waits for equity to increase by at least expected_deposit - max(tolerance, expected_deposit * relative_tolerance).

Parameters
Returns

The observed UserVaultEquity that reached the threshold.

Raises
  • HypercoreDepositVerificationError – If equity does not reach the threshold within the timeout.

  • requests.RequestException – If the bounded API read fails. No hidden transport retries are made.

Return type

eth_defi.hyperliquid.api.UserVaultEquity