build_hypercore_withdraw_multicall
Documentation for eth_defi.hyperliquid.core_writer.build_hypercore_withdraw_multicall function.
- build_hypercore_withdraw_multicall(lagoon_vault, hypercore_usdc_amount, vault_address)
Build a single multicall transaction for the full Hypercore withdrawal flow.
Batches the 3-step withdrawal into one EVM transaction:
CoreWriter.sendRawAction(vaultTransfer)— withdraw from vaultCoreWriter.sendRawAction(transferUsdClass)— move USDC from perp to spotCoreWriter.sendRawAction(spotSend)— bridge USDC back to EVM Safe
When the EVM block finishes execution, all queued CoreWriter actions are processed sequentially on HyperCore (~47k gas per action).
Derives all contract instances internally from the
LagoonVault:modulefromLagoonVault.trading_strategy_modulecore_writerat the system addressCORE_WRITER_ADDRESSsafe_addressfromLagoonVault.safe_address
- Parameters
lagoon_vault (LagoonVault) – Lagoon vault instance with
trading_strategy_module_addressconfigured.hypercore_usdc_amount (int) – USDC amount in HyperCore wei (uint64) for all CoreWriter actions.
vault_address (HexAddress | str) – Hypercore native vault address (not the Lagoon vault address).
- Returns
Bound
module.functions.multicall(data)ready to.transact().- Return type
ContractFunction