View Source Hyperliquid.Api.Exchange.TopUpIsolatedOnlyMargin (hyperliquid v0.3.0)

Top up an isolated-only position's margin back to a target leverage.

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

Usage

{:ok, result} = TopUpIsolatedOnlyMargin.request(3, "5")

Summary

Functions

Top up isolated-only margin for an asset.

Functions

Link to this function

request(asset, leverage, opts \\ [])

View Source
@spec request(non_neg_integer(), String.t() | number(), keyword()) ::
  {:ok, map()} | {:error, term()}

Top up isolated-only margin for an asset.

Parameters

  • asset: Asset index
  • leverage: Target leverage as a decimal string (numbers are converted)
  • opts: Optional parameters

Options

  • :private_key - Private key for signing (falls back to config)
  • :vault_address - Act on behalf of a vault

Returns

  • {:ok, response} - Result
  • {:error, term()} - Error details

Examples

{:ok, result} = TopUpIsolatedOnlyMargin.request(3, "5")