HyperFunTrading API
HyperFunTrading API Documentation
Overview
Constants
Name
Value
Description
Asset Indices (Hyperliquid Perps)
Asset
Index
szDecimals
Max Leverage
Authorization
Role
Can Call
Trading Functions
executeMarketOrder
executeLimitOrder
executeLimitOrderRaw
batchLimitOrders
closePositionAdvanced
executeCloseOrderAdvanced
cancelOrder
Fund Transfer Functions
transferToPerp
transferFromPerp
sweepToSpot
forceReturnToSpot
View Functions
getL1Position
getL1PositionFull
getL1SpotBalance
getL1AccountValue
getAccountMarginSummary
getOraclePrice
getSzDecimals
getMaxLeverage
previewNormalizedSize
getTotalAssets
checkReserve
API Wallet Setup (Complete Flow)
Overview
Step 1: addApiWallet (Required)
Step 2: approveBuilderFee (Optional)
Step 3: API Wallet 开始交易
API Wallet Management Functions
Complete Setup Example
Admin Functions (Admin Only)
withdrawPerpToEVM
withdrawAllPerpToEVM
withdrawAllSpotToEVM
refillReserve
Size & Price Formatting
Size Format (1e8)
Amount
Size Value
Price Format (1e8)
Price
Price Value
Events
Example: Full Trading Flow
Error Codes
Code
Meaning
Contract Version
Last updated