Kafka Schema
Example connecting to a Kafka Topic
Example Data for each Topic
Blocks
Transactions
Raw transaction data from hyperliquid.- Payload
- Transaction Types
Cancel Order
a is an index to an asset that is traded on Hyperliquid. Click through for more information on assets.
Trades
Contains data from both sides of a tradeFills
Contains only one side of a trade, but with a lot more information than what is contained in the trades. FillFills with Order Metadata
Fills from thefills topic, each with the order that produced it attached, and aggregated the way Hyperliquid’s userFills?aggregateByTime=true does.
Aggregation. Hyperliquid emits one fill per match, so a single order can produce several fills that share a timestamp: a crossing order can match several resting orders at once, and several crossing orders can hit one resting order in the same block. Fills sharing a user, oid and time are combined into one record:
sz,fee,closedPnland any builder fee are summedpxbecomes the size-weighted mean- every other field is taken from the fill that opened the group, the one whose
startPositionprecedes the rest.tidandhashare therefore that fill’s, and the other fills’tids do not appear in the record fillCountis how many fills were combined, sofillCount: 1is a fill that was passed through as-is
fillCount is not part of Hyperliquid’s REST response. It is added here so a consumer can tell an aggregated record from a single fill.
Corrections. Records are keyed user:oid:time. If a further fill for that key arrives after the record has been published, the complete recomputed record is published again under the same key, so consumers that keep the last record per key converge on the right value.
Order metadata. The order object is not present on every record, so treat it as optional. It is absent on:
- TWAP fills, which are not currently enriched. They are identified by a non-null
twapId. - Fills with no user order behind them, such as settlements, outcome merges and splits, and spot dust conversions. These are recognisable by their
dir. - Ordinary fills where the order could not be resolved in time. This is consistently well under 1% of them.
Trade Fills
Trade fills is the trades topic enhanced with the fills. However currently we are unable to always get all the fills for a trade. If you absolutely require the fill, then it is better to use the fills topic which will always be complete.Misc Events
Event Types
AccountClassTransfer
Moving USDC from the Perpetuals balance to the Spot balance and the Spot balance to the Perpetuals balance.