View Source Hyperliquid.Api.Exchange.UpdateLeverage (hyperliquid v0.2.2)
Update leverage for a perpetual asset.
See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint
Summary
Functions
Update leverage for a perpetual asset.
Functions
Update leverage for a perpetual asset.
Parameters
asset: Asset indexleverage: New leverage valueis_cross: true for cross margin, false for isolatedopts: Optional parameters
Options
:private_key- Private key for signing (falls back to config):vault_address- Update for a vault
Returns
{:ok, response}- Update result{:error, term()}- Error details
Examples
{:ok, result} = UpdateLeverage.request(0, 10, true)Breaking Change (v0.2.0)
private_key was previously the first positional argument. It is now
an option in the opts keyword list (:private_key).