The hyperliquid.dex.trades table provides enriched trade details for both spot and perpetual markets on Hyperliquid DEX, including HIP-3 permissionless perpetual trades.
Note that not all trades with builder fees will have a corresponding builder address. These are trade fills that do not have a corresponding raw.transactions record that will indicate the builder address. Currently, about ~80-90% of all trades with builder fees will have a corresponding builder address.
On Hyperliquid DEX Trades:
Hyperliquid DEX Trades are fully backfilled for every address, except for ~4,000 traders (~1% of traders) who had made more than 10k trades at the time of backfill in March 2025. This is because the Hyperliquid API only makes the last 10k trades available, and there are no other ways to retrieve the missing historical data. This means the following data is available:
- pre-March 2025: all trades are available for all addresses, except for ~4,000 traders, where only the last 10k trades are available
- March 2025 onwards: all trades are available for all addresses
Sample Queries
Get all available trades for a given user
select
*
from hyperliquid.dex.trades
where 1=1
and (buyer_address = <address_to_search> or seller_address = <address_to_search>)
Get monthly volume by token
select
date_trunc('month', timestamp) as month,
token_a_symbol,
sum(usd_amount) as volume_usd
from hyperliquid.dex.trades
where timestamp >= current_date - 90
group by all
Get all available trades for a given user
select
*
from hyperliquid.dex.trades
where 1=1
and (buyer_address = <address_to_search> or seller_address = <address_to_search>)
Get HIP-3 permissionless perpetual trades
select
*
from hyperliquid.dex.trades
where is_hip3 = true
order by timestamp desc
limit 100
Table Columns
| Column Name | Description |
|---|
| market_type | The type of market - ‘spot’ or ‘perpetuals’. |
| coin | A unique identifier for the asset being traded: • The coin for perpetuals is the standard token symbol, e.g. BTC, ETH. • The coin for spot tokens is an ID representing a pair of tokens based on Hyperliquid’s metadata, e.g. @4. |
| token_a_symbol | The base token symbol. For perpetuals, this is the clean symbol (e.g., BTC). |
| token_b_symbol | The quote token symbol. For perpetuals, this is the collateral token (e.g., USDC). |
HIP-3 Permissionless Perpetuals
| Column Name | Description |
|---|
| perp_dex | The HIP-3 DEX name if this is a permissionless perpetual trade. Empty/null for native Hyperliquid perps and spot trades. |
| perp_market_name | The full name of the HIP-3 DEX for permissionless perpetual trades. |
| perp_dex_deployer | The address of the HIP-3 DEX deployer for permissionless perpetual trades. |
| perp_dex_fee_recipient | The address that receives trading fees for HIP-3 DEX trades. |
| is_hip3 | Whether this trade is on a HIP-3 permissionless perpetual market (true) or native Hyperliquid market (false). |
Trade Details
| Column Name | Description |
|---|
| amount | The size/quantity of the trade in base token units. |
| price | The price at which the trade was executed. |
| usd_amount | The total trade value in USD (amount * price). |
| buyer_address | The address of the buyer. |
| seller_address | The address of the seller. |
| timestamp | The UTC timestamp when the trade was executed. |
| transaction_hash | The transaction hash for the trade. |
| trade_id | A unique identifier for the trade. |
| unique_id | A unique identifier for each trade record. |
| Column Name | Description |
|---|
| seller_order_id | The order ID for the seller’s order. |
| buyer_order_id | The order ID for the buyer’s order. |
| seller_twap_id | The TWAP order ID if the seller’s order was a TWAP order. |
| buyer_twap_id | The TWAP order ID if the buyer’s order was a TWAP order. |
Fees
| Column Name | Description |
|---|
| fee_token | The token in which fees were paid. |
| seller_fee | The fee paid by the seller in fee_token units. |
| buyer_fee | The fee paid by the buyer in fee_token units. |
| builder_fee | Total builder fees paid (buyer + seller) in USD. |
| seller_builder_fee | Builder fee paid by the seller in USD. |
| seller_builder_address | The builder address that received the seller’s builder fee. |
| buyer_builder_fee | Builder fee paid by the buyer in USD. |
| buyer_builder_address | The builder address that received the buyer’s builder fee. |
Position & PnL
| Column Name | Description |
|---|
| seller_closed_pnl | The closed PnL for the seller from this trade in USD. |
| buyer_closed_pnl | The closed PnL for the buyer from this trade in USD. |
| seller_start_position | The seller’s position before this trade. |
| buyer_start_position | The buyer’s position before this trade. |
| seller_crossed | Whether the seller’s order was crossed. |
| buyer_crossed | Whether the buyer’s order was crossed. |
| seller_dir | The direction of the seller’s trade (e.g., Open Long, Close Short). |
| buyer_dir | The direction of the buyer’s trade (e.g., Open Long, Close Short). |
Liquidation
| Column Name | Description |
|---|
| liquidated_user | The address of the user being liquidated, if this trade is a liquidation. |
| liquidation_mark_price | The mark price at liquidation, if this trade is a liquidation. |
| liquidation_method | The liquidation method used, if this trade is a liquidation. |