activate_account_sponsored

Documentation for eth_defi.hyperliquid.evm_escrow.activate_account_sponsored function.

activate_account_sponsored(web3, target_address, deployer, usdc_address, session=None, activation_amount=2000000, timeout=60.0, poll_interval=2.0)

Activate a HyperCore account via deployer-sponsored depositFor.

Unlike activate_account() which routes through the Safe’s trading strategy module, this function has the deployer EOA call CoreDepositWallet.depositFor(target, amount, SPOT_DEX) directly. The USDC comes from the deployer’s own EVM balance, not the Safe’s.

This is a workaround for the testnet issue where depositFor called through a Smart contract (Safe multisig) does not create HyperCore accounts. See hyperliquid-dex/node#138.

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.

Example:

from eth_defi.hyperliquid.evm_escrow import activate_account_sponsored

activate_account_sponsored(
    web3=web3,
    target_address="0xAbc...",
    deployer=deployer_wallet,
    usdc_address="0xDef...",
)
Parameters
  • web3 (web3.main.Web3) – Web3 connection to HyperEVM.

  • target_address (Union[eth_typing.evm.HexAddress, str]) – The address to activate on HyperCore (e.g. a Safe multisig).

  • deployer (eth_defi.hotwallet.HotWallet) – Hot wallet for the deployer EOA that will pay for the activation. Must hold sufficient EVM USDC.

  • usdc_address (Union[eth_typing.evm.HexAddress, str]) – USDC token contract address on HyperEVM.

  • session (eth_defi.hyperliquid.session.HyperliquidSession | None) – Optional Hyperliquid API session. If provided, checks that the target has no existing EVM escrow entries before attempting activation.

  • activation_amount (int) – USDC amount in raw units (6 decimals) to deposit for activation. Defaults to 2 USDC (DEFAULT_ACTIVATION_AMOUNT).

  • 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