spotSell action enables Vincent Apps to execute sell orders on Hyperliquid’s spot market using a Vincent User’s HyperCore spot balance.
Prerequisites
Before executing thespotSell action, the following conditions must be met:
- Spot Balance on HyperCore: The Vincent User Agent Wallet must have sufficient balance for the base asset in their HyperCore spot balance to cover the sell amount. The base asset is the first asset in the trading pair (e.g., PURR in “PURR/USDC”).
- Order Parameters: You must provide a valid trading pair symbol (e.g., “PURR/USDC”), price, and size according to Hyperliquid’s trading rules.
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 sell, without actually performing the operation.
For the spotSell action, the precheck function will validate the following:
- The trading pair symbol is a valid Hyperliquid trading pair (e.g., “PURR/USDC”).
- The Vincent User Agent Wallet has sufficient balance for the base asset in their HyperCore spot balance to cover the sell amount. The base asset is the first asset in the trading pair (e.g. PURR in “PURR/USDC”).
- Parameters
- Implementation
- Response
The
precheck function requires the following parameters:Executing the execute Function
The execute function performs the actual sell operation, placing a sell order on Hyperliquid’s spot market.
For the spotSell action, the execute function will:
- Place a sell order for the specified token pair at the given price and size.
- Return the order result from Hyperliquid.
- Parameters
- Implementation
- Response
The
execute function requires the following parameters:Important Considerations
Price and Size Formatting Rules
Price and Size Formatting Rules
Hyperliquid has strict formatting requirements for spot orders. See the Hyperliquid API documentation for more details.
Token Dust and Minimum Size
Token Dust and Minimum Size
When selling tokens, you may encounter “dust” - small amounts below the minimum tradeable size. For example:
- If a token has szDecimals=0 (only whole tokens), fractional amounts like 0.9986 cannot be sold
- The sell size is floored to the token’s precision, so 1.9986 PURR becomes 1.0 PURR for a sell order
Getting Current Market Prices
Getting Current Market Prices
You’ll need to fetch the current market price before placing an order. Use the Hyperliquid API or
SDK to get the mid price for your trading pair, then adjust it based on your strategy (e.g. 1%
below mid price for market sells).
Order Types
Order Types
You can specify either a limit or market order using the
orderType parameter. See the
Parameters section for more details.Verifying Order Success
Verifying Order Success
After the order is executed, you can verify the balances changed by checking the spot balances using a Hyperliquid SDK, or by using the Hyperliquid API.
Reference Implementation
For a complete working example showing the full spot sell workflow including balance verification and price calculation, see the sell.spec.ts end-to-end test in theability-hyperliquid package.

