View Source Hyperliquid.Api.Subscription.OutcomeMetaUpdates (hyperliquid v0.4.1)
WebSocket subscription for HIP-4 prediction market metadata changes.
Each event carries a list of updates, where every update is a single-key map naming what changed:
outcomeCreated- a new outcome, with its side specs and quote tokenoutcomeSettled- an outcome identifier that has settledquestionUpdated- a question's named outcomes or text changedquestionSettled- a question identifier that has settled
See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
Usage
{:ok, request} = OutcomeMetaUpdates.build_request()
# => {:ok, %{type: "outcomeMetaUpdates"}}
Summary
Functions
Returns postgres table configurations (multi-table support).
Returns storage configuration for this subscription.
Returns metadata about this subscription endpoint.
Build a cache key from event data using the configured pattern.
Build a subscription request.
Returns true if cache storage is enabled.
Returns the configured cache fields for partial storage, or nil for all fields.
Returns the cache TTL if configured.
Generate a unique subscription key for this parameter set.
Split an event's updates by kind.
Returns true if postgres storage is enabled.
Returns the configured postgres fields for partial storage, or nil for all fields.
Returns the postgres table name if configured (primary table for legacy support).
Outcome identifiers that settled in this event.
Question identifiers that settled in this event.
Returns true if any storage backend is enabled.
Types
@type request_params() :: %{}
@type t() :: %Hyperliquid.Api.Subscription.OutcomeMetaUpdates{updates: [map()]}
Functions
Returns postgres table configurations (multi-table support).
Returns storage configuration for this subscription.
Returns metadata about this subscription endpoint.
Build a cache key from event data using the configured pattern.
Returns nil if cache is not enabled or no pattern is configured.
Build a subscription request.
Returns
{:ok, request_map}- Subscription request
Returns true if cache storage is enabled.
Returns the configured cache fields for partial storage, or nil for all fields.
Returns the cache TTL if configured.
@spec changeset(t(), map()) :: Ecto.Changeset.t()
Generate a unique subscription key for this parameter set.
Parameters
params- Map of subscription parameters
Returns
String key that uniquely identifies this subscription variant.
Split an event's updates by kind.
Parameters
event: The subscription event
Returns
- Map keyed by update kind, each holding the payloads of that kind
Examples
OutcomeMetaUpdates.group_updates(event)
# => %{"outcomeCreated" => [...], "questionSettled" => [...]}
Returns true if postgres storage is enabled.
Returns the configured postgres fields for partial storage, or nil for all fields.
Returns the postgres table name if configured (primary table for legacy support).
@spec settled_outcomes(t() | map()) :: [non_neg_integer()]
Outcome identifiers that settled in this event.
Parameters
event: The subscription event
Returns
- List of settled outcome identifiers
@spec settled_questions(t() | map()) :: [non_neg_integer()]
Question identifiers that settled in this event.
Parameters
event: The subscription event
Returns
- List of settled question identifiers
Returns true if any storage backend is enabled.