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'))
Wait for a vault deposit to be confirmed on HyperCore.
After a CoreWriter
vaultTransferaction succeeds on HyperEVM, HyperCore may take several seconds to process the deposit. This function pollsuserVaultEquitiesuntil the expected equity appears or increases.Handles two cases:
New position: existing_equity is
None. Waits for any equity > 0 to appear for the vault.Existing position: existing_equity is provided. Waits for equity to increase by at least
expected_deposit - tolerance.
- Parameters
session (eth_defi.hyperliquid.session.HyperliquidSession) – Session from
create_hyperliquid_session().user (Union[eth_typing.evm.HexAddress, str]) – On-chain address (the Safe address for Lagoon vaults).
vault_address (Union[eth_typing.evm.HexAddress, str]) – Hypercore vault address.
expected_deposit (decimal.Decimal) – Expected deposit amount in USDC (human-readable, not raw).
existing_equity (decimal.Decimal | None) – User’s vault equity before the deposit, or
Noneif this is the first deposit (no existing position).timeout (float) – Maximum seconds to wait before raising
HypercoreDepositVerificationError.poll_interval (float) – Seconds between API polls.
tolerance (decimal.Decimal) – Acceptable difference between expected and actual equity increase (to account for rounding, fees, vault PnL during the wait). Defaults to 0.01 USDC.
- Returns
The confirmed
UserVaultEquityafter the deposit.- Raises
HypercoreDepositVerificationError – If the deposit cannot be verified within the timeout.
- Return type