View Source Hyperliquid.Api.Info.AllBorrowLendReserveStates (hyperliquid v0.2.2)
Borrow/lend reserve state data.
Returns reserve states including rates, balances, utilization, and oracle prices for all available lending markets.
See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint
Usage
{:ok, states} = AllBorrowLendReserveStates.request()
{:ok, reserve} = AllBorrowLendReserveStates.get_reserve(states, 0)
count = AllBorrowLendReserveStates.count(states)
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 borrow/lend reserve states data.
Get the number of reserves.
Fetch is an alias for request when no storage is configured.
Get reserve state by index.
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.AllBorrowLendReserveStates{
reserves: [ReserveState.t()]
}
Functions
Returns metadata about this endpoint.
Example
iex> Hyperliquid.Api.Info.AllBorrowLendReserveStates.__endpoint_info__()
%{
endpoint: "allBorrowLendReserveStates",
type: :info,
rate_limit_cost: 2,
params: [],
optional_params: [],
doc: "Retrieve borrow/lend reserve states",
returns: "Reserve states with rates, balances, and utilization"
}
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 borrow/lend reserve states data.
Parameters
states: The reserve states structattrs: Map with reserves list from API response
Returns
Ecto.Changeset.t()
@spec count(t()) :: non_neg_integer()
Get the number of reserves.
Parameters
states: The reserve states struct
Returns
non_neg_integer()
Fetch is an alias for request when no storage is configured.
Get reserve state by index.
Parameters
states: The reserve states structindex: Reserve index
Returns
{:ok, ReserveState.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.