build_hypercore_deposit_phase2
Documentation for eth_defi.hyperliquid.core_writer.build_hypercore_deposit_phase2 function.
- build_hypercore_deposit_phase2(lagoon_vault, hypercore_usdc_amount, vault_address)
Build phase 2 of a two-phase Hypercore deposit: spot to perp to vault.
Batches two CoreWriter actions into a single multicall:
transferUsdClass— move USDC from spot to perpvaultTransfer— deposit USDC from perp into vault
When the EVM block finishes execution, HyperCore processes all queued CoreWriter actions from that block sequentially, so the
transferUsdClasscompletes before thevaultTransferruns.Must only be called after phase 1 USDC has cleared the EVM escrow and is available in the user’s HyperCore spot account. Use
wait_for_evm_escrow_clear()between phase 1 and phase 2.- Parameters
lagoon_vault (LagoonVault) – Lagoon vault instance with
trading_strategy_module_addressconfigured.hypercore_usdc_amount (int) – USDC amount in HyperCore wei (uint64) for both 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