Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.allium.so/llms.txt

Use this file to discover all available pages before exploring further.

The hyperliquid.predictions.trades table contains every Hyperliquid HIP-4 prediction-market trade. event_name = 'Settlement' rows mark settlement events; all other rows are regular trades.

Table Columns

Identifiers

Column NameDescription
event_nameOne of ‘Trade’ or ‘Settlement’.
projectAlways ‘hyperliquid’.
protocolAlways ‘hyperliquid_hip4’.
chainAlways ‘hyperliquid’.
exchange_typeAlways ‘orderbook’.
coinHL-native side-token identifier (e.g. ‘#54760’).
encodingHL-canonical numeric encoding for the side-token.
outcome_idHIP-4 outcome ID.
token_side0 or 1.
asset_idHL-canonical numeric identifier for the side-token.
trade_idThe HL trade ID (tid).
transaction_hashThe HL transaction hash for the fill.
timestampUTC timestamp of the fill.
unique_idDeterministic unique identifier per row.
_created_atRow creation timestamp.
_updated_atRow last update timestamp.

Counterparties

Column NameDescription
buyer_addressBuyer of the side-token.
seller_addressSeller of the side-token.
maker_addressMaker (resting-order) address. NULL on synthetic mints.
taker_addressTaker (aggressing-order) address.
side_nameOne of ‘BUY’, ‘SELL’, ‘SETTLE’.
buyer_dirDirection string for the buyer leg (e.g. ‘Open Long’, ‘Settlement’).
seller_dirDirection string for the seller leg.
buyer_crossedWhether the buyer’s order was the aggressor.
seller_crossedWhether the seller’s order was the aggressor.
buyer_order_idOrder ID for the buyer’s order.
seller_order_idOrder ID for the seller’s order.
buyer_twap_idTWAP order ID if the buyer’s order was a TWAP order.
seller_twap_idTWAP order ID if the seller’s order was a TWAP order.

Trade Economics

Column NameDescription
priceTrade price as a 0..1 probability.
sizeTrade size in side-tokens.
collateral_tokenCollateral token symbol. Always ‘USDH’ on HIP-4 today.
collateral_token_decimalsDecimals of the collateral token.
collateral_amountNative-unit collateral value of the trade.
usd_exchange_rateUSD price of the collateral token. 1.0 for USDH.
usd_collateral_amountUSD value of the trade.

Fees

Column NameDescription
fee_tokenToken in which the fee was paid (e.g. ‘USDH’). NULL when no fee was charged.
buyer_feeBuyer-side fee in fee_token units.
seller_feeSeller-side fee in fee_token units.
buyer_fee_usdBuyer-side fee in USD.
seller_fee_usdSeller-side fee in USD.
tx_feeTotal fee for the transaction in fee_token units.
tx_fee_usdTotal fee for the transaction in USD.
builder_feeTotal builder fee for the trade.
buyer_builder_feeBuilder fee paid by the buyer.
seller_builder_feeBuilder fee paid by the seller.
buyer_builder_addressBuilder address that received the buyer’s builder fee.
seller_builder_addressBuilder address that received the seller’s builder fee.

Position & PnL

Column NameDescription
buyer_start_positionBuyer’s position in this side-token before the trade.
seller_start_positionSeller’s position in this side-token before the trade.
buyer_closed_pnlClosed PnL realized by the buyer on this fill.
seller_closed_pnlClosed PnL realized by the seller on this fill.
is_synthetic_mintTrue when the trade represents a synthetic mint, burn, or cross-coin pairing.

Sample Query

SELECT
  timestamp,
  coin,
  side_name,
  size,
  price,
  usd_collateral_amount,
  buyer_address,
  seller_address
FROM hyperliquid.predictions.trades
WHERE timestamp >= CURRENT_DATE - 7
  AND event_name = 'Trade'
ORDER BY timestamp DESC
LIMIT 100