One row per leg of a perpetual fill, and one row per order-book fill. trade_amount is the size traded on a perpetual leg, and trade_amount_raw the same size as a decimal string on an order-book fill.
Columns
facts_perp_markets.trades holds one row per leg, keyed by block_timestamp, perp_market_id, trade_id, trader_address and crossed. HyperCore fills have maker and taker legs; MUX pool executions have one trader leg.| Column | Type | Description |
|---|
block_timestamp | TIMESTAMP | Time of the block containing the trade. Partition column. |
block_number | INT64 | Number of the block containing the trade. |
trade_id | INT64 | Fill identifier shared by both HyperCore legs; fingerprint of chain, transaction hash and log index on MUX. Part of the row key with block_timestamp, perp_market_id, trader_address and crossed. |
perp_market_id | STRING | Market the trade executed in, keyed like dimensions.perp_markets. |
interface_app_id | STRING | The builder credited for the market, read from the registry. Every fill in a market has the same value. |
exchange_app_id | STRING | The venue that executed the trade. The same fill is credited under both app columns, so group by one of them for a total. |
token_id | STRING | The market’s settlement token, keyed like dimensions.tokens. Null on MUX markets, which accept several collateral tokens. |
chain_id | STRING | Chain the trade executed on. |
project_id | STRING | Project the exchange app belongs to. |
trader_address | STRING | Address of the trader on this leg. Part of the row key. |
side | STRING | Which side this leg is: B for the buyer, A for the seller. |
crossed | BOOL | True on a HyperCore taker leg or a MUX pool execution; false on a HyperCore maker leg. |
price | BIGNUMERIC | Execution price in the settlement token on HyperCore and in USD on MUX. |
fee | BIGNUMERIC | Fee charged on this leg, in fee_token, before sharing. Null on MUX executions, where fees can involve several tokens. |
fee_token | STRING | Token the fee was charged in. Null on MUX executions. |
builder_fee | BIGNUMERIC | The front end’s share inside that fee. Null on MUX executions. |
deployer_fee | BIGNUMERIC | The market deployer’s share inside that fee. Null on MUX executions. |
trade_amount | BIGNUMERIC | Size traded on this leg, in units of the underlying asset. Times price it is the leg’s notional in the HyperCore settlement token or in USD on MUX. |
facts_order_book_markets.trades holds one row per fill, with the maker and the taker on the same row as maker_* and taker_* columns. Amounts are decimal strings, following the datashare’s convention for fact amounts, and safe_cast(price_raw as bignumeric) puts one back into arithmetic.| Column | Type | Description |
|---|
block_timestamp | TIMESTAMP | Time of the block containing the fill. Partition column. |
block_number | INT64 | Number of the block containing the fill. |
unique_id | INT64 | Row key: fingerprint of order_book_market_id, trade_id and block_timestamp. |
trade_id | INT64 | Identifier of the fill within its market and block. |
order_book_market_id | STRING | Market the trade executed in, keyed like dimensions.order_book_markets. |
app_id | STRING | The app running the book, read from the registry. |
token_id | STRING | The market’s quote token, keyed like dimensions.tokens. |
chain_id | STRING | Chain the trade executed on. |
project_id | STRING | Project the operating app belongs to. |
maker_address | STRING | Address of the maker, whose order was resting on the book. Null on a single-leg match. |
taker_address | STRING | Address of the taker, who accepted the resting order. Null on a single-leg match. |
maker_side | STRING | Which way the maker traded: B for a buy, A for a sell. Null on a single-leg match with a maker side missing. |
taker_side | STRING | Which way the taker traded: B for a buy, A for a sell. Null on a single-leg match with a taker side missing. |
match_leg_count | INT64 | How many legs the match wrote: two on an ordinary fill, one on a HIP-4 outcome-market mint or burn, which settles against the venue itself. |
price_raw | STRING | Price the trade filled at, in the quote token, as a decimal string. |
trade_amount_raw | STRING | How much was traded, in the base token, as a decimal string. Times price_raw it is the fill’s value, which Metrics turns into dollars on the market-and-token tables. |
maker_fee_raw | STRING | Fee charged on the maker’s side, in maker_fee_token, as a decimal string. |
taker_fee_raw | STRING | Fee charged on the taker’s side, in taker_fee_token, as a decimal string. |
maker_fee_token | STRING | Token the maker’s fee was charged in. |
taker_fee_token | STRING | Token the taker’s fee was charged in. The taker is charged in the token received, so this is either side of the pair. |
maker_builder_fee_raw | STRING | The front end’s share inside the maker’s fee, as a decimal string. |
taker_builder_fee_raw | STRING | The front end’s share inside the taker’s fee, as a decimal string. |
Sample queries
This table is large and split by day. Bound block_timestamp and filter chain_id on every query, or you read the whole table and the whole table is billed to you.
One market, one day
Pool volume by market
One order book, one day
Order book volume
trade_amount is the size in whatever the market tracks and price the settlement-token price it filled at; multiply them for the leg’s notional value.MUX executions have one trader leg with crossed = true, and price * trade_amount is the executed notional in USD. The registry supplies the market name through perp_market_id. price_raw and trade_amount_raw are decimal strings, and safe_cast to bignumeric puts them back into arithmetic.One row is one fill, and the product of price and size is counted once per trade. match_leg_count reads 1 on a mint or burn, where the match has a single leg.