Skip to main content
The deposit action enables Vincent Apps to bridge USDC from Arbitrum into a Vincent User’s HyperCore mainnet perp balance using the Hyperliquid bridge contract.
The deposit action will only work if being executed on Arbitrum mainnet, and will not work for depositing to HyperCore testnet. To get test USDC on HyperCore testnet, follow the testnet funding process, or transfer test USDC from an existing HyperCore testnet account’s balance.

Prerequisites

Before executing the deposit action, the following conditions must be met:
  • Arbitrum RPC URL: The precheck function of this Ability requires a valid Arbitrum mainnet RPC URL to perform the USDC transfer to the Hyperliquid bridge contract.
  • USDC Balance on Arbitrum: The Vincent User Agent Wallet must have sufficient USDC on Arbitrum to cover the deposit amount.
    • The minimum deposit amount for Hyperliquid is $5 USDC, do not deposit less as it will not be credited to the Vincent User’s HyperCore perp balance.
  • Native ETH for Gas: The Vincent User Agent Wallet must have sufficient native ETH on Arbitrum to pay for the bridge transaction gas fees.
To learn more about executing Vincent Abilities, see the Executing Abilities guide.

Executing the precheck Function

The precheck function validates some prerequisites for executing a deposit, without actually performing the operation. For the deposit action, the precheck function will validate the following:
  • The useTestnet parameter is set to false, or wasn’t provided.
  • The Vincent User Agent Wallet has a non-zero balance of native ETH on Arbitrum to pay for the bridge transaction gas fees.
  • The deposit amount is greater than or equal to the minimum deposit amount for Hyperliquid.
  • The Vincent User Agent Wallet has a sufficient USDC balance on Arbitrum to cover the deposit amount.
  • Parameters
  • Implementation
  • Response
The precheck function requires the following parameters:
import { HyperliquidAction } from '@lit-protocol/vincent-ability-hyperliquid';

{
  /**
   * The action to perform (must be HyperliquidAction.DEPOSIT)
   */
  action: HyperliquidAction.DEPOSIT;
  /**
   * Deposit parameters
   */
  deposit: {
    /**
     * The amount of USDC to deposit in 6-decimal format.
     * Example: "5000000" = 5 USDC
     */
    amount: string;
  };
  /**
   * An RPC endpoint for Arbitrum mainnet where the deposit will be executed.
   */
  arbitrumRpcUrl: string;
}

Executing the execute Function

The execute function performs the actual deposit by bridging USDC from Arbitrum to Vincent User’s HyperCore perp balance, by transferring the USDC to the Hyperliquid bridge contract. For the deposit action, the execute function will:
  • Transfer the specified amount of USDC from the Vincent User Agent Wallet’s Arbitrum account to the Hyperliquid bridge contract.
  • Return the transaction hash of the deposit transaction on Arbitrum.
  • Parameters
  • Implementation
  • Response
The execute function requires the following parameters, note that the arbitrumRpcUrl parameter is not used because the Ability will use the Arbitrum RPC URL supplied by the Lit Nodes:
import { HyperliquidAction } from '@lit-protocol/vincent-ability-hyperliquid';

{
  /**
   * The action to perform (must be HyperliquidAction.DEPOSIT)
   */
  action: HyperliquidAction.DEPOSIT;
  /**
   * Deposit parameters
   */
  deposit: {
    /**
     * The amount of USDC to deposit in 6-decimal format.
     * Example: "15000000" = 15 USDC
     */
    amount: string;
  };
}

Important Considerations

After successfully executing a deposit transaction on Arbitrum, it takes some time for the funds to appear in the Vincent User’s Hyperliquid portfolio. The transaction must be confirmed on Arbitrum before Hyperliquid’s bridge processes the deposit.
USDC on Arbitrum uses 6 decimals. When specifying the deposit amount, use the 6-decimal format:
  • 5 USDC = "5000000"
  • 15 USDC = "15000000"
  • 100 USDC = "100000000"
The deposit action only works on Hyperliquid mainnet. If you set useTestnet: true, the deposit action will fail. To get test USDC on Hyperliquid testnet, you must first make a minimum 5 USDC deposit on mainnet, then claim test USDC through the Hyperliquid testnet faucet.
The Vincent User’s Vincent Wallet must have sufficient native ETH on Arbitrum to pay for the bridge transaction gas fees. Ensure the wallet has at least a small amount of ETH before attempting a deposit.
After the deposit transaction is confirmed on Arbitrum, you can verify the funds arrived in the Vincent User’s Hyperliquid portfolio by checking the clearinghouse state using a Hyperliquid SDK, or by using the Hyperliquid API.

Reference Implementation

For a complete working example showing the full deposit workflow including balance verification, see the deposit.spec.ts end-to-end test in the ability-hyperliquid package.

Next Steps

Explore the rest of the supported Hyperliquid actions: