info
endpoint with type: "userFills"
retrieves a user’s trading fills (executed orders) on the Hyperliquid exchange. This endpoint returns detailed information about completed trades, including prices, sizes, fees, and profit/loss data for both perpetual and spot markets.
Parameters
Request body
type
(string, required) — The request type. Must be"userFills"
to retrieve user fills.user
(string, required) — Address in 42-character hexadecimal format; e.g. 0x0000000000000000000000000000000000000000.aggregateByTime
(boolean, optional) — When true, partial fills are combined when a crossing order gets filled by multiple different resting orders. Resting orders filled by multiple crossing orders will not be aggregated.
Response
The response is an array of fill objects, with each fill containing detailed trade information:Fill data structure
Each fill object contains the following fields: Core trade data:coin
— Asset identifier (simple names like “BTC”, “ETH” for perpetuals; spot format like “@107” for spot trades)px
— Fill price as a string for precisionsz
— Fill size (quantity traded)side
— Trade side: “A” for Ask/Sell, “B” for Bid/Buytime
— Fill timestamp in millisecondsoid
— Order ID that generated this filltid
— Unique trade ID
startPosition
— Position size before this filldir
— Trade direction (e.g., “Open Long”, “Close Short”, “Buy”, “Sell”)closedPnl
— Realized profit/loss from this fillcrossed
— Boolean indicating if this was a crossing order
fee
— Trading fee paid for this fillfeeToken
— Token used to pay the fee (typically “USDC”)builderFee
— Builder fee (optional, only present if non-zero)hash
— Transaction hash for blockchain verification
Asset identification
Perpetual contracts:- Use simple asset names: “BTC”, “ETH”, “AVAX”, “SOL”
- Represent standard perpetual futures contracts
- Use indexed format: “@107”, “@1”, etc.
- Index corresponds to the spot pair position in the universe
- Some assets may have remapped names in user interfaces
Data limitations
Response limits:- Maximum 2000 fills per response
- Returns most recent fills first
- For larger datasets, use pagination with
userFillsByTime
- Only the 10,000 most recent fills are available
- Older fills are not accessible through this endpoint
Example request
Example response
Use cases
Theinfo
endpoint with type: "userFills"
is essential for applications that need to:
- Trade history tracking: Display complete trading history with detailed fill information
- Portfolio analysis: Calculate realized profits/losses and trading performance metrics
- Fee analysis: Track trading costs and fee optimization strategies
- Position reconciliation: Verify position changes against executed fills
- Tax reporting: Generate detailed trade records for tax compliance
- Risk management: Monitor trading patterns and position sizing
- Performance attribution: Analyze trading performance by asset, time period, or strategy
- Audit trails: Maintain comprehensive records of all trading activity
- Trading analytics: Build dashboards showing fill patterns and execution quality
- Compliance reporting: Generate reports for regulatory requirements
- Account reconciliation: Match fills against expected order executions
- Strategy backtesting: Use historical fill data to validate trading strategies
- Fee optimization: Analyze fee structures and optimize trading costs
- Position tracking: Monitor how positions change over time through fills
- Market impact analysis: Study the effect of order execution on prices
Body
The request type. Must be "userFills" to retrieve user fills.
userFills
Address in 42-character hexadecimal format; e.g. 0x0000000000000000000000000000000000000000.
When true, partial fills are combined when a crossing order gets filled by multiple different resting orders. Resting orders filled by multiple crossing orders will not be aggregated.
Response
Successful response with user fills data
Closed profit and loss for the fill
Asset symbol (e.g., 'BTC', 'ETH') for perpetuals or spot format (e.g., '@107') for spot trades
Whether this was a crossing order
Direction of the trade (e.g., 'Open Long', 'Close Short', 'Buy', 'Sell')
Transaction hash
Order ID
Fill price
Side of the trade: 'A' for Ask/Sell, 'B' for Bid/Buy
A
, B
Position size before this fill
Fill size
Fill timestamp in milliseconds
Trading fee paid
Token used to pay the fee (typically 'USDC')
Builder fee (optional, only present if non-zero)
Trade ID