Skip to main content
The sendSpotAsset action enables Vincent Apps to send spot assets (USDC or other tokens) from a Vincent User’s HyperCore spot balance to another HyperCore account.

Prerequisites

Before executing the sendSpotAsset action, the following conditions must be met:
  • Spot Balance on HyperCore: The Vincent User Agent Wallet must have sufficient balance of the specified token in their HyperCore spot account to cover the send amount.
  • Destination Address: You must provide a valid destination address on HyperCore to receive the tokens.
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 spot asset send, without actually performing the operation. For the sendSpotAsset action, the precheck function will validate the following:
  • The Vincent User Agent Wallet has sufficient balance of the specified token in their HyperCore spot account 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_SPOT_ASSET)
   */
  action: HyperliquidAction.SEND_SPOT_ASSET;
  /**
   * Whether to use Hyperliquid testnet (optional, defaults to false)
   */
  useTestnet?: boolean;
  /**
   * Send spot asset parameters
   */
  sendSpotAsset: {
    /**
     * The destination address on HyperCore to receive the tokens
     */
    destination: string;
    /**
     * The token to send (e.g., "USDC", "PURR", etc.)
     */
    token: string;
    /**
     * The amount to send in the token's Hyperliquid precision for spot trading.
     * For example, USDC uses 8 decimals on Hyperliquid for spot trading (not 6)
     * Example for USDC: "100000000" = 1.0 USDC
     * Example for PURR (5 decimals): "10000" = 1.0 PURR
     */
    amount: string;
  };
}

Executing the execute Function

The execute function performs the actual send operation, transferring the specified token from the Vincent User’s HyperCore spot balance to the destination address. For the sendSpotAsset action, the execute function will:
  • Transfer the specified amount of the token from the Vincent User Agent Wallet’s HyperCore spot balance to the destination address.
  • 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_SPOT_ASSET)
   */
  action: HyperliquidAction.SEND_SPOT_ASSET;
  /**
   * Whether to use Hyperliquid testnet (optional, defaults to false)
   */
  useTestnet?: boolean;
  /**
   * Send spot asset parameters
   */
  sendSpotAsset: {
    /**
     * The destination address on HyperCore to receive the tokens
     */
    destination: string;
    /**
     * The token to send (e.g., "USDC", "PURR", etc.)
     */
    token: string;
    /**
     * The amount to send in the token's Hyperliquid precision for spot trading.
     * For example, USDC uses 8 decimals on Hyperliquid for spot trading (not 6)
     * Example for USDC: "100000000" = 1.0 USDC
     * Example for PURR (5 decimals): "10000" = 1.0 PURR
     */
    amount: string;
  };
}

Important Considerations

Hyperliquid uses different decimal precision for spot assets, so make sure to use the correct precision when specifying the send amount. You can find the decimal precision for each token using a Hyperliquid SDK, or by using the Hyperliquid API.When specifying the send amount:
  • USDC: Use 8 decimals
    • 1.0 USDC = "100000000"
    • 0.5 USDC = "50000000"
    • 10 USDC = "1000000000"
  • Other tokens: Check the token’s specific decimal precision on Hyperliquid
    • PURR: 5 decimals (1.0 PURR = "100000")
    • Each token may have different precision
Sends are always taken from the Vincent User’s HyperCore spot balance. If you need to send funds from the perp balance, you must first transfer them to the spot balance using the Transfer to Spot action.
The destination address must be a valid Ethereum address that exists on HyperCore. The recipient will receive the tokens in their HyperCore spot account.
After the send is executed, you can verify the balances changed by checking the spot balances state 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 spot asset workflow including balance verification, see the send-spot-asset.spec.ts end-to-end test in the ability-hyperliquid package.

Next Steps

Explore the rest of the supported Hyperliquid actions: