View Source Hyperliquid.Api.Info.SettledOutcome (hyperliquid v0.3.1)
Settlement information for a HIP-4 prediction market outcome.
Returns nil when the outcome exists but has not settled yet.
See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot
Usage
{:ok, settled} = SettledOutcome.request(7)
SettledOutcome.settled?(settled)
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 settled outcome data.
Fetch data and persist to configured storage backends.
Fetch data and persist. Raises on error.
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.
Whether the outcome resolved fully to the YES side.
Settlement fraction as a float.
Whether the outcome has settled.
Returns true if any storage backend is enabled.
Types
Functions
Returns metadata about this endpoint.
Example
iex> Hyperliquid.Api.Info.SettledOutcome.__endpoint_info__()
%{
endpoint: "settledOutcome",
type: :info,
rate_limit_cost: 2,
params: [:outcome],
optional_params: [],
doc: "Retrieve settlement information for an outcome",
returns: "Settlement details, or null when the outcome has not settled"
}
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.
@spec changeset(t(), map()) :: Ecto.Changeset.t()
Creates a changeset for settled outcome data.
Parameters
outcome: The settled outcome structattrs: Map of attributes
Returns
Ecto.Changeset.t()
Fetch data and persist to configured storage backends.
This calls request/N and then stores the result using Storage.Writer.
Request params are merged into stored data for cache key generation.
Fetch data and persist. Raises on error.
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.
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.
Whether the outcome resolved fully to the YES side.
Parameters
outcome: The settled outcome struct
Returns
boolean()
Settlement fraction as a float.
Parameters
outcome: The settled outcome struct
Returns
{:ok, float()}when settled{:error, :not_settled}otherwise
Whether the outcome has settled.
Parameters
outcome: The settled outcome struct
Returns
boolean()
Returns true if any storage backend is enabled.