Skip to main content
A transaction carrying hyperCore.closePerp does this read itself and is rejected when there is nothing to close, so this is the check to make before offering a close at all.

Import

Usage

Parameters

`0x${string}`
required
the account holding the position
string
required
ticker as Hyperliquid names it, e.g. BTC
HyperliquidConfig
where to reach Hyperliquid’s info endpoint

Returns

PerpPosition | null
the position, or null when the account has none open on that asset

See also