Vault ArchitectureHyperCore Relayer
End-to-End Flow
How a single deposit travels from arrival on HyperCore through bridging and batching to final vault settlement on HyperEVM.
A single deposit travels through the system as follows:
- Funds arrive on HyperCore: A user sends supported tokens to the relayer address. Hyperliquid emits a
userNonFundingLedgerUpdatesevent. - Reader receives and filters: Matching messages are placed on
message_queue. - Dispatcher fans out: Spawns a task that calls
handle_messagethenhandle_non_funding_ledger_updates_data. - Address guard + per-update parsing: The handler confirms the update is for the configured relayer address, then concurrently runs
handle_non_funding_ledger_updatefor every update. That helper parses each deposit, persists aHyperliquidRelayerDepositrecord keyed by transfer hash, and enqueues the(transfer_hash, amount, recipient)tuple ontobridge_queue. - Bridge batching: It then checks gas balances, checks the HyperCore balance covers the total, bridges the aggregate amount to HyperEVM via Fordefi, marks all transfers as
is_bridged, and forwards each ontodeposit_queue. - Deposit batching: Process batched transfers, checks the HyperEVM token balance covers the total, submits one
batch_deposittransaction throughBatchDepositorand stamps the returnedfordefi_idonto every matching deposit row. - Settlement: The vault credits each recipient with shares. Because the deposit call does not wait for confirmation, final on-chain settlement is tracked out of band via the
fordefi_id.
Balance prerequisites
The relayer wallet must hold:
- enough gas on HyperEVM
- enough of the token on HyperCore to cover pending bridges
- enough of the token on HyperEVM to cover pending deposits
A failure in any of these checks will surface as a bridge or deposit batch failure.
Recovering failed transfers
Deposits marked is_failed = True in the HyperliquidRelayerDeposit table are the authoritative list of items needing attention. After fixing the root cause, re-enqueue or replay those transfer hashes through the appropriate stage.