Fetch all markets
hip4.events.fetchMarkets() returns a flat HIP4Market[] array covering every outcome in Hyperliquid’s outcomeMeta catalog.
Filter by type
Pass atype filter to narrow results to a specific market category.
Group by type
UsegroupBy: "type" to receive a MarketsByType object with one key per market category.
Group multi-outcome markets by question
Multi-outcome markets share a parent question. Grouping by question returns aMarketsByQuestion object keyed by question ID (or "standalone" for outcomes that don’t belong to a multi-outcome question).
Paginate results
Uselimit and offset to page through large result sets. Without limit, you get every matching market.
limit and offset apply only to the flat list. When you pass groupBy, the result contains every matching market.Sort results
Control the order of returned markets withsortBy. When you omit it, markets stay in Hyperliquid’s catalog order (the order of outcomeMeta).
sortBy takes effect from SDK 1.3.0-beta.0. Earlier versions accept the parameter but ignore it.Template market names
Many markets are created from Hyperliquid’s template registry (outcomeTemplates). Their name, sides[].name, and questionName are the names Hyperliquid sends, such as "template:priceTouch". From SDK 1.3.0, parsedName, sides[].parsedName, and parsedQuestionName carry the names rendered from the registry. Use them for display.
parsedName "Other". Other markets repeat their name. If the registry can’t be fetched, the parsed names keep the wire names, except that the template: prefix is removed from plain names such as "template:Yes". The original outcome is always available on market.raw.
Events, prices, and positions carry the same names: parsedTitle, parsedQuestion, and outcomes[].parsedName from fetchEvents and fetchEvent, outcomes[].parsedName from fetchPrice, and parsedEventTitle, parsedMarketQuestion, and parsedOutcomeName from fetchPositions.
Refreshing the market or event cache makes one extra outcomeTemplates request, cached for 30 seconds.
Access typed fields on DefaultBinaryMarket
Each market type exposes fields specific to its category.DefaultBinaryMarket includes the parsed description fields you need for display and filtering.
Fetch events and categories
Markets belong to events. You can query at the event level when you need the event title, description, status, and markets list together.Event and outcome metadata is cached for 30 seconds. Subsequent calls within that window return the cached result without hitting the network.