View Source Hyperliquid.Api.Info.AllPerpMetas (hyperliquid v0.2.2)
Metadata for perpetual assets across all or a specific DEX.
This is similar to the meta endpoint but allows querying metadata
for a specific builder-deployed DEX.
See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals
Summary
Functions
Returns metadata about this endpoint.
Returns postgres table configurations (multi-table support).
Returns storage configuration for this endpoint.
Build a cache key from response data using the configured pattern.
Returns nil if cache is not enabled or no pattern configured.
Build the request payload.
Returns true if cache storage is enabled.
Returns the cache TTL if configured.
Creates a changeset for all perp metas data.
Get all coin names in the universe.
Fetch data and persist to configured storage backends.
Fetch data and persist. Raises on error.
Find a universe entry by coin name.
Get the margin table by ID.
Parse and validate the API response.
Returns true if postgres storage is enabled.
Returns the postgres table name if configured (primary table for legacy support).
Returns the upsert config for postgres (primary table for legacy support).
Get the rate limit cost for this endpoint.
Make the API request and parse the response.
Make the API request, raising on error.
Make the API request and return the raw response map (no key transformation).
Make the API request returning raw map, raising on error.
Returns true if any storage backend is enabled.
Store margin tables to the margin_tables table.
Transform margin tables for storage.
Types
@type t() :: %Hyperliquid.Api.Info.AllPerpMetas{ collateral_token: non_neg_integer(), margin_tables: [MarginTable.t()], universe: [Universe.t()] }
Functions
Returns metadata about this endpoint.
Example
iex> Hyperliquid.Api.Info.AllPerpMetas.__endpoint_info__()
%{
endpoint: "allPerpMetas",
type: :info,
rate_limit_cost: 2,
params: [],
optional_params: [],
doc: "Retrieve metadata for perpetual assets across all or a specific DEX",
returns: "Universe of perp assets with margin tables and collateral token"
}
Returns postgres table configurations (multi-table support).
Returns storage configuration for this endpoint.
Build a cache key from response data using the configured pattern.
Returns nil if cache is not enabled or no pattern configured.
@spec build_request() :: map()
Build the request payload.
Returns true if cache storage is enabled.
Returns the cache TTL if configured.
@spec changeset(t(), map()) :: Ecto.Changeset.t()
Creates a changeset for all perp metas data.
Parameters
all_perp_metas: The all perp metas structattrs: Map of attributes to validate
Returns
Ecto.Changeset.t()
Get all coin names in the universe.
Parameters
all_perp_metas: The all perp metas struct
Returns
- List of coin names
Fetch data and persist to configured storage backends.
This calls request/0 and then stores the result using Storage.Writer.
@spec fetch!() :: t()
Fetch data and persist. Raises on error.
Find a universe entry by coin name.
Parameters
all_perp_metas: The all perp metas structname: Coin name (e.g., "BTC", "ETH")
Returns
{:ok, Universe.t()}if found{:error, :not_found}if not found
Get the margin table by ID.
Parameters
all_perp_metas: The all perp metas structid: Margin table ID
Returns
{:ok, MarginTable.t()}if found{:error, :not_found}if not found
Parse and validate the API response.
Returns true if postgres storage is enabled.
Returns the postgres table name if configured (primary table for legacy support).
Returns the upsert config for postgres (primary table for legacy support).
@spec rate_limit_cost() :: non_neg_integer()
Get the rate limit cost for this endpoint.
Make the API request and parse the response.
@spec request!() :: t()
Make the API request, raising on error.
Make the API request and return the raw response map (no key transformation).
@spec request_raw!() :: map()
Make the API request returning raw map, raising on error.
Returns true if any storage backend is enabled.
@spec store_margin_tables(t()) :: {:ok, non_neg_integer()} | {:error, term()}
Store margin tables to the margin_tables table.
This is separate from the main storage (perp_assets) since we need to store to two different tables from one API response.
Parameters
all_perp_metas: The AllPerpMetas struct with margin_tables
Returns
{:ok, count}- Number of margin tables stored/updated{:error, term()}- Error details
Transform margin tables for storage.
Converts margin_tiers embedded list to JSONB-compatible format. This function is called automatically by the storage layer when using fetch/0.