The examples on this page use Hyperliquid (
provider: 'hyperliquid'). Replace the provider value with any supported DEX from getProviders().Parameters
Returns
AvailableToTrade:
This is the per-market figure an order panel reads before it lets the user size an order. It differs from
AccountSummary.availableMargin, which stays account-scoped and does not reflect one market’s margin asset.
Provider fallback
A provider that exposes no per-market figure falls back to an account-scoped read. The SDK fetches the account withgetAccount(), derives getAccountSummary(), and returns the account’s availableMargin as both buy and sell, in the market’s quote asset.
Hyperliquid implements the per-market read directly, from the venue’s activeAssetData.availableToTrade — see Hyperliquid / Account figures.