View Source Hyperliquid.Api.Info.PerpConciseAnnotations (hyperliquid v0.4.1)
Concise category annotations for perp coins.
The API returns [coin, annotation] pairs; this module reshapes them into a
list of annotation records keyed by coin.
See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals
Usage
{:ok, annotations} = PerpConciseAnnotations.request()
{:ok, btc} = PerpConciseAnnotations.find(annotations, "BTC")
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.
Group coins by their category.
Returns true if cache storage is enabled.
Returns the cache TTL if configured.
List the distinct categories present.
Creates a changeset for perp annotations.
Fetch data and persist to configured storage backends.
Fetch data and persist. Raises on error.
Find the annotation for a coin.
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.
Types
@type t() :: %Hyperliquid.Api.Info.PerpConciseAnnotations{annotations: [map()]}
Functions
Returns metadata about this endpoint.
Example
iex> Hyperliquid.Api.Info.PerpConciseAnnotations.__endpoint_info__()
%{
endpoint: "perpConciseAnnotations",
type: :info,
rate_limit_cost: 2,
params: [],
optional_params: [],
doc: "Retrieve concise category annotations for perp coins",
returns: "Per-coin category, display name and keywords"
}
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.
Group coins by their category.
Parameters
annotations: The annotations struct
Returns
- Map of category to list of coin names
Returns true if cache storage is enabled.
Returns the cache TTL if configured.
List the distinct categories present.
Parameters
annotations: The annotations struct
Returns
- Sorted list of category names
@spec changeset(t(), map()) :: Ecto.Changeset.t()
Creates a changeset for perp annotations.
Parameters
annotations: The annotations structattrs: Map with an annotations key
Returns
Ecto.Changeset.t()
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 the annotation for a coin.
Parameters
annotations: The annotations structcoin: Coin name
Returns
{:ok, annotation}if found{:error, :not_found}otherwise
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.