Skip to main content
The sendPerpUsdc action enables Vincent Apps to send USDC from a Vincent User’s HyperCore perp balance to another HyperCore perp account.

Prerequisites

Before executing the sendPerpUsdc action, the following conditions must be met:
  • Perp Balance on HyperCore: The Vincent User Agent Wallet must have sufficient USDC in their HyperCore perp balance to cover the send amount.
  • Destination Address: You must provide a valid destination address on HyperCore to receive the USDC in their perp account.
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 perp USDC send, without actually performing the operation. For the sendPerpUsdc action, the precheck function will validate the following:
  • The Vincent User Agent Wallet has sufficient USDC in their HyperCore perp balance to cover the send 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.SEND_PERP_USDC)
   */
  action: HyperliquidAction.SEND_PERP_USDC;
  /**
   * Whether to use Hyperliquid testnet (optional, defaults to false)
   */
  useTestnet?: boolean;
  /**
   * Send perp USDC parameters
   */
  sendPerpUsdc: {
    /**
     * The destination address on HyperCore to receive the USDC in their perp account
     */
    destination: string;
    /**
     * The amount of USDC to send in 6-decimal format.
     * Note: Perp USDC uses standard 6 decimals (unlike spot which uses 8)
     * Example: "1000000" = 1.0 USDC
     */
    amount: string;
  };
}

Executing the execute Function

The execute function performs the actual send operation, transferring USDC from the Vincent User’s HyperCore perp balance to the destination address’s perp account. For the sendPerpUsdc action, the execute function will:
  • Transfer the specified amount of USDC from the Vincent User Agent Wallet’s HyperCore perp balance to the destination address’s perp account.
  • Return the send result from Hyperliquid.
  • Parameters
  • Implementation
  • Response
The execute function requires the following parameters:
import { HyperliquidAction } from '@lit-protocol/vincent-ability-hyperliquid';

{
  /**
   * The action to perform (must be HyperliquidAction.SEND_PERP_USDC)
   */
  action: HyperliquidAction.SEND_PERP_USDC;
  /**
   * Whether to use Hyperliquid testnet (optional, defaults to false)
   */
  useTestnet?: boolean;
  /**
   * Send perp USDC parameters
   */
  sendPerpUsdc: {
    /**
     * The destination address on HyperCore to receive the USDC in their perp account
     */
    destination: string;
    /**
     * The amount of USDC to send in 6-decimal format.
     * Note: Perp USDC uses standard 6 decimals (unlike spot which uses 8)
     * Example: "1000000" = 1.0 USDC
     */
    amount: string;
  };
}

Important Considerations

Perp USDC uses 6 decimals (standard USDC decimals). This is different from spot assets on Hyperliquid which use 8 decimals for USDC.When specifying the send amount:
  • 1.0 USDC = "1000000"
  • 0.5 USDC = "500000"
  • 10 USDC = "10000000"
For this action, sends are taken from the Vincent User’s HyperCore perp balance. If you need to send funds from the spot balance, you must first transfer them to the perp balance using the Transfer to Perp action.
The destination address must be a valid Ethereum address that exists on HyperCore. The recipient will receive the USDC in their HyperCore perp account (not spot).
After the send is executed, you can verify the balances changed by checking the clearinghouse state (perp balance) for both the sender and recipient using a Hyperliquid SDK, or by using the Hyperliquid API.

Reference Implementation

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

Next Steps

Explore the rest of the supported Hyperliquid actions: