activate_account

Documentation for eth_defi.hyperliquid.evm_escrow.activate_account function.

activate_account(web3, lagoon_vault, deployer, session=None, activation_amount=2000000, timeout=60.0, poll_interval=2.0)

Activate a Safe’s HyperCore account via depositFor.

Smart contracts (like Safe multisigs) must be activated on HyperCore before CoreDepositWallet.deposit() bridge actions will work. Without activation, deposited USDC gets permanently stuck in the evmEscrows field.

The activation flow uses transact_via_trading_strategy_module to call CoreDepositWallet.depositFor(safe, amount, SPOT_DEX) through the Safe’s trading strategy module. This bridges USDC from the Safe’s EVM balance to the Safe’s HyperCore spot account, creating the account in the process.

Note

New HyperCore accounts incur a 1 USDC account creation fee. Deposits ≤1 USDC to new accounts fail silently. The default activation_amount of 2 USDC comfortably exceeds the fee.

Warning

The Safe must hold sufficient EVM USDC for the activation amount. The guard must have depositFor whitelisted via whitelistCoreWriter() (included since guard v0.x).

Example:

from eth_defi.hyperliquid.evm_escrow import activate_account

activate_account(
    web3=web3,
    lagoon_vault=lagoon_vault,
    deployer=deployer_wallet,
)
Parameters
  • web3 (Web3) – Web3 connection to HyperEVM.

  • lagoon_vault (LagoonVault) – Lagoon vault instance with trading_strategy_module_address configured. The Safe associated with this vault will be activated.

  • deployer (HotWallet) – Hot wallet for the asset manager / deployer EOA.

  • session (HyperliquidSession | None) – Optional Hyperliquid API session. If provided, the function checks that the Safe has no existing EVM escrow entries before attempting activation. Stuck escrow entries from prior failed deposits will prevent activation from succeeding.

  • activation_amount (int) – USDC amount in raw units (6 decimals) to deposit for activation. Defaults to 2 USDC (DEFAULT_ACTIVATION_AMOUNT). Must comfortably exceed the ~1 USDC account creation fee.

  • timeout (float) – Maximum seconds to wait for activation verification. Defaults to 60 seconds.

  • poll_interval (float) – Seconds between precompile polls. Defaults to 2 seconds.

Raises

TimeoutError – If the activation does not complete within the timeout period.

Return type

None