View Source Hyperliquid.Api.Subscription.FastAssetCtxs (hyperliquid v0.4.1)
WebSocket subscription for low-latency mark and mid price updates.
A trimmed-down counterpart to assetCtxs: each event is a map of coin to a
context carrying only markPx and midPx, either of which may be absent, and
midPx may be explicitly null when there is no two-sided market.
See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/websocket/subscriptions
Usage
{:ok, request} = FastAssetCtxs.build_request()
# => {:ok, %{type: "fastAssetCtxs"}}
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.
Coins present in this event.
Generate a unique subscription key for this parameter set.
Mark price for a coin.
Mid price for a coin.
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).
Returns true if any storage backend is enabled.
Types
@type request_params() :: %{}
@type t() :: %Hyperliquid.Api.Subscription.FastAssetCtxs{ctxs: 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()
Coins present in this event.
Parameters
event: The subscription event
Returns
- List of coin names
Generate a unique subscription key for this parameter set.
Parameters
params- Map of subscription parameters
Returns
String key that uniquely identifies this subscription variant.
Mark price for a coin.
Parameters
event: The subscription eventcoin: Coin name
Returns
{:ok, String.t()}if present{:error, :not_found}otherwise
Mid price for a coin.
Returns {:error, :not_found} when the coin has no mid price, which includes
the case where the API sent an explicit null.
Parameters
event: The subscription eventcoin: Coin name
Returns
{:ok, String.t()}if present{:error, :not_found}otherwise
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).
Returns true if any storage backend is enabled.