Skip to main content
The Deposit Service handles the complete flow of depositing USDC from HyperEVM to Hyperliquid L1 (HyperCore) trading accounts. It includes three main modules:
  1. USDC Arrival Detection - Monitor for bridged USDC on HyperEVM
  2. Deposit Execution - Execute deposits to Hyperliquid L1
  3. L1 Confirmation Monitoring - Confirm deposits on Hyperliquid L1

USDC Arrival Detection

Monitor for USDC arrival on HyperEVM after a bridge transaction.

Exports

detectUsdcArrival(walletAddress, options?)

Poll for USDC balance increase on HyperEVM.
DetectionOptions: Returns: UsdcArrivalResult Throws: UsdcArrivalTimeoutError if timeout is reached. Example:

snapshotUsdcBalance(walletAddress)

Take a balance snapshot before bridging.
Example:

detectUsdcArrivalFromSnapshot(walletAddress, previousBalance, options?)

Detect arrival from a known balance snapshot.

checkUsdcBalance(walletAddress)

One-time check of USDC balance on HyperEVM.
Example:

Deposit Execution

Execute deposits from HyperEVM to Hyperliquid L1.

Exports

executeDeposit(signer, options)

Execute a deposit to Hyperliquid L1 trading account.
DepositSigner:
DepositOptions: Returns: DepositResult Throws:
  • MinimumDepositError if amount < 5 USDC
  • InsufficientBalanceError if USDC balance insufficient
  • InsufficientGasError if HYPE balance insufficient
  • DepositTransactionError if transaction fails
  • UserRejectedError if user rejects
Example:

executeDepositFor(signer, recipientAddress, options)

Deposit on behalf of another address.
Example:

validateDepositRequirements(walletAddress, amount)

Pre-flight validation before deposit.
Returns: DepositValidation Example:

approveUsdcForDeposit(signer, amount, onSubmitted?)

Execute USDC approval for CoreDepositWallet.

checkDepositAllowance(walletAddress)

Check current USDC allowance for CoreDepositWallet.

L1 Confirmation Monitoring

Monitor deposit confirmation on Hyperliquid L1.

Exports

monitorL1Confirmation(walletAddress, expectedAmount, hyperEvmTxHash, options?)

Monitor L1 with cancellation support.
L1MonitorOptions: Returns: Object with:
  • result: Promise that resolves to L1ConfirmationResult
  • controller: L1MonitorController for managing monitoring
L1MonitorController:
Example:

waitForL1Confirmation(walletAddress, expectedAmount, hyperEvmTxHash, options?)

Simple L1 confirmation (without controller).
Example:

getHyperliquidBalance(walletAddress)

Get Hyperliquid L1 trading account balance.
Returns: Account value in smallest units (raw USD * 10^6). Throws:
  • InvalidL1AddressError if address is invalid
  • NetworkError if API fails
Example:

getL1TradingBalance(walletAddress)

Get formatted L1 trading balance.
Example:

checkHyperliquidAccountExists(walletAddress)

Check if account has any trading history.

createBridgeCompleteSummary(params)

Create a complete summary of the bridge-to-trading flow.
Returns: BridgeCompleteSummary

Constants

Contract Addresses

Amounts

DestinationDex

Timing

APIs


Complete Flow Example