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

Detailed vault information.

Returns comprehensive details about a specific vault.

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-details-for-a-vault

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.

Build the request payload with optional user parameter.

Returns true if cache storage is enabled.

Returns the cache TTL if configured.

Check if vault is closed.

Check if deposits are allowed.

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.

Fetches vault details with optional user parameter.

Returns true if any storage backend is enabled.

Types

@type t() :: %Hyperliquid.Api.Info.VaultDetails{
  allow_deposits: boolean(),
  always_close_on_withdraw: boolean(),
  apr: float(),
  description: String.t(),
  follower_state: map() | nil,
  followers: list(),
  is_closed: boolean(),
  leader: String.t(),
  leader_commission: float(),
  leader_fraction: float(),
  max_distributable: float(),
  max_withdrawable: float(),
  name: String.t(),
  portfolio: list(),
  relationship: map(),
  vault_address: String.t()
}

Functions

Returns metadata about this endpoint.

Example

iex> Hyperliquid.Api.Info.VaultDetails.__endpoint_info__()
%{
  endpoint: "vaultDetails",
  type: :info,
  rate_limit_cost: 1,
  params: [:vaultAddress],
  optional_params: [:user],
  doc: "Retrieve detailed vault information",
  returns: "Comprehensive details about a specific vault"
}

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.

Link to this function

build_request(vaultAddress, opts \\ [])

View Source
@spec build_request(
  term(),
  keyword()
) :: map()

Build the request payload.

Link to this function

build_request_with_user(vault_address, user)

View Source
@spec build_request_with_user(String.t(), String.t()) :: map()

Build the request payload with optional user parameter.

Parameters

  • vault_address: Vault address (0x...)
  • user: Optional user address to get follower state

Returns

  • Map with request parameters

Returns true if cache storage is enabled.

Returns the cache TTL if configured.

Link to this function

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

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

Check if vault is closed.

Link to this function

deposits_allowed?(vault_details)

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

Check if deposits are allowed.

Link to this function

fetch(vaultAddress, opts \\ [])

View Source

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

Link to this function

fetch!(vaultAddress, opts \\ [])

View Source
@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.

Link to this function

request(vaultAddress, opts \\ [])

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

Make the API request and parse the response.

Link to this function

request!(vaultAddress, opts \\ [])

View Source
@spec request!(
  term(),
  keyword()
) :: t()

Make the API request, raising on error.

Link to this function

request_raw(vaultAddress, opts \\ [])

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

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

Link to this function

request_raw!(vaultAddress, opts \\ [])

View Source
@spec request_raw!(
  term(),
  keyword()
) :: map()

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

Link to this function

request_with_user(vault_address, user)

View Source
@spec request_with_user(String.t(), String.t() | nil) :: {:ok, t()} | {:error, term()}

Fetches vault details with optional user parameter.

Parameters

  • vault_address: Vault address (0x...)
  • user: Optional user address to get follower state

Returns

  • {:ok, %VaultDetails{}} - Parsed and validated data
  • {:error, term()} - Error from HTTP or validation

Example

{:ok, details} = VaultDetails.request_with_user("0x1234...", "0x5678...")

Returns true if any storage backend is enabled.