Skip to main content
Schema: hypercore.core Table: ez_perp_fills Type: View

What

Single-sided perpetual trade fills, split by maker/taker. Each double-sided trade becomes two fill rows. Comparable to GMX and Tornado perp fill structures for cross-protocol analysis.

Sample queries

-- Maker vs taker analysis: who pays and who gets paid?
SELECT
    fill_side,
    COUNT(*) AS fills,
    ROUND(SUM(trade_notional) / 1e9, 2) AS volume_billions,
    ROUND(SUM(fee), 2) AS total_fees_usd,
    ROUND(AVG(fee), 6) AS avg_fee_per_fill
FROM hypercore.core.ez_perp_fills
WHERE block_timestamp >= DATEADD('day', -7, CURRENT_DATE)
GROUP BY 1;
-- Top BTC traders by weekly volume
SELECT
    user_address,
    side,
    COUNT(*) AS trade_count,
    ROUND(SUM(trade_notional) / 1e6, 1) AS volume_millions,
    ROUND(SUM(closed_pnl), 2) AS realized_pnl,
    ROUND(SUM(fee), 2) AS total_fees
FROM hypercore.core.ez_perp_fills
WHERE block_timestamp >= DATEADD('day', -7, CURRENT_DATE)
    AND coin = 'BTC'
GROUP BY 1, 2
ORDER BY 4 DESC
LIMIT 20;
-- Builder (MEV) fee analysis
SELECT
    builder_address,
    COUNT(*) AS trades_built,
    ROUND(SUM(builder_fee), 2) AS total_builder_fees,
    ROUND(SUM(trade_notional) / 1e6, 1) AS volume_routed_millions
FROM hypercore.core.ez_perp_fills
WHERE builder_fee > 0
    AND block_timestamp >= DATEADD('day', -7, CURRENT_DATE)
GROUP BY 1
ORDER BY 3 DESC
LIMIT 10;

Columns

Column NameData TypeDescription
EZ_PERP_FILLS_IDTEXTSurrogate key generated from fact_trades_id and side
TRADE_IDNUMBERUnique trade identifier assigned by the Hyperliquid L1 matching engine.
BLOCK_NUMBERNUMBERL1 block number containing this event.
BLOCK_TIMESTAMPTIMESTAMP_NTZBlock production timestamp on the Hyperliquid L1. This is the canonical time for ordering blockchain events.
COINTEXTRaw asset identifier. Perps use plain ticker (e.g. BTC), spot uses @token_index format (e.g. @2), prelaunch uses xyz:name prefix.
SYMBOLTEXTHuman-readable trading symbol. Resolved from token metadata for spot tokens; same as coin for perps.
TRADE_TIMESTAMPTIMESTAMP_NTZExact fill timestamp from the matching engine, may differ slightly from block_timestamp.
TX_HASHTEXTL1 transaction hash uniquely identifying the on-chain transaction.
PRICEFLOATExecution price in USD for this trade.
TRADE_SIZEFLOATSize of the trade in base asset units.
TRADE_NOTIONALFLOATUSD notional value of the trade (price x size), rounded to 2 decimal places.
FILL_SIDETEXTWhether this fill is the maker (resting order) or taker (crossing the spread).
IS_TAKERBOOLEANTRUE when this side of the trade crossed the spread (taker), FALSE for maker.
SIDETEXTTrade side: buyer or seller
USER_ADDRESSTEXTHyperCore address of the primary user involved in this event.
ORDER_IDNUMBEROrder identifier for this side of the trade.
DIRECTIONTEXTTrade direction (Open Long, Close Long, Open Short, Close Short).
IS_CROSSEDBOOLEANWhether this side of the trade was a crossed (taker) order.
FEEFLOATFee charged for the event.
FEE_TOKENTEXTToken in which trading fees are denominated.
CLOSED_PNLFLOATClosed PnL realized by this side of the trade.
START_POSITIONFLOATPosition size before this fill for this side of the trade.
TWAP_IDNUMBERTWAP order ID, if applicable.
CLIENT_ORDER_IDTEXTClient-specified order ID, if applicable.
BUILDER_ADDRESSTEXTAddress of the block builder (MEV/builder infrastructure). NULL for most trades. Only populated on the taker row; NULL on the maker row.
BUILDER_FEEFLOATBuilder fee for the trade, only populated on the taker side.
IS_LIQUIDATIONBOOLEANBoolean indicating whether this trade is a liquidation event.
LIQUIDATED_USERTEXTAddress of the user being liquidated. NULL if this is not a liquidation trade.
LIQUIDATION_MARK_PRICEFLOATMark price at the time of liquidation. NULL if not a liquidation.
LIQUIDATION_METHODTEXTMethod used for the liquidation (e.g. backstop, market). NULL if not a liquidation.
MARKET_TYPETEXTType of market: ‘perp’ for perpetual futures, ‘spot’ for HIP-1 token trading, ‘prelaunch’ for pre-listing futures.
MODIFIED_TIMESTAMPTIMESTAMP_NTZTimestamp when the record was last modified in this table (Snowflake SYSDATE).
FACT_TRADES_IDTEXTSurrogate key from the parent fact_trades row