View Source Hyperliquid.Api.Info.AlignedQuoteTokenInfo (hyperliquid v0.2.2)

Information about aligned quote tokens.

Returns alignment status, mint supply, and predicted rates for quote tokens.

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint

Usage

{:ok, info} = AlignedQuoteTokenInfo.request(0)
AlignedQuoteTokenInfo.aligned?(info)

Summary

Functions

Returns metadata about this endpoint.

Returns postgres table configurations (multi-table support).

Returns storage configuration for this endpoint.

Check if the token is aligned.

Get the amount owed for a specific date.

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 aligned quote token info data.

Fetch is an alias for request when no storage is configured.

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.

Get the total amount owed across all days.

Types

@type t() :: %Hyperliquid.Api.Info.AlignedQuoteTokenInfo{
  daily_amount_owed: [DailyAmount.t()],
  evm_minted_supply: String.t(),
  first_aligned_time: non_neg_integer() | nil,
  is_aligned: boolean(),
  predicted_rate: String.t()
}

Functions

Returns metadata about this endpoint.

Example

iex> Hyperliquid.Api.Info.AlignedQuoteTokenInfo.__endpoint_info__()
%{
  endpoint: "alignedQuoteTokenInfo",
  type: :info,
  rate_limit_cost: 2,
  params: [:token],
  optional_params: [],
  doc: "Retrieve information about aligned quote tokens",
  returns: "Alignment status, mint supply, and predicted rates"
}

Returns postgres table configurations (multi-table support).

Returns storage configuration for this endpoint.

Link to this function

aligned?(aligned_quote_token_info)

View Source
@spec aligned?(t()) :: boolean()

Check if the token is aligned.

Parameters

  • info: The aligned quote token info struct

Returns

  • boolean()
Link to this function

amount_for_date(aligned_quote_token_info, date)

View Source
@spec amount_for_date(t(), String.t()) :: {:ok, String.t()} | {:error, :not_found}

Get the amount owed for a specific date.

Parameters

  • info: The aligned quote token info struct
  • date: Date string to find

Returns

  • {:ok, String.t()} if found
  • {:error, :not_found} if not found

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(term()) :: map()

Build the request payload.

Returns true if cache storage is enabled.

Returns the cache TTL if configured.

Link to this function

changeset(info \\ %__MODULE__{}, attrs)

View Source
@spec changeset(t(), map()) :: Ecto.Changeset.t()

Creates a changeset for aligned quote token info data.

Parameters

  • info: The aligned quote token info struct
  • attrs: Map of attributes to validate

Returns

  • Ecto.Changeset.t()

Fetch is an alias for request when no storage is configured.

@spec parse_response(map() | nil) :: {:ok, t() | nil} | {:error, term()}
@spec parse_response(map()) :: {:ok, t()} | {:error, term()}

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).

Link to this function

postgres_upsert_config()

View Source

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.

@spec request(term()) :: {:ok, t()} | {:error, term()}

Make the API request and parse the response.

@spec request!(term()) :: t()

Make the API request, raising on error.

@spec request_raw(term()) :: {:ok, map()} | {:error, term()}

Make the API request and return the raw response map (no key transformation).

@spec request_raw!(term()) :: map()

Make the API request returning raw map, raising on error.

Returns true if any storage backend is enabled.

Link to this function

total_amount_owed(aligned_quote_token_info)

View Source
@spec total_amount_owed(t()) :: {:ok, float()} | {:error, :parse_error}

Get the total amount owed across all days.

Parameters

  • info: The aligned quote token info struct

Returns

  • {:ok, Decimal.t()} - Total amount
  • {:error, :parse_error} - If parsing fails