Skip to main content
GET
TypeScript

Authorizations

Authorization
string
header
required

The Trading API key (trdrs_sk_…), for market data, orders and account state on the accounts its owner holds. Use it server-to-server, and keep it on your server. Its scope is named trading in the API.

Query Parameters

provider
string

The provider the account is at, such as rithmic or paper. Omit it to use your default provider. An unknown value is refused with 400, never replaced with another provider.

account
string

The account number at that provider. It must be one of your own accounts, or the call is refused with 400.

Response

The account summary. Buying power is the provider's own figure, so it is null on the paper book, including a Demo, which reports none here. The paper book still refuses an order whose margin doesn't fit the account's free collateral, and the margin preview tells you beforehand. A Demo's balance is in USD: a registered perpetual's realized profit and loss (a Hyperliquid core perpetual settles in USDC, a Binance or Bybit USDT perpetual in USDT) is added to it in USD at a fixed 1:1 rate, never held as a stablecoin. An issued account's balance is in USD as well, and a perpetual's profit and loss in a stablecoin is added to it one for one only where the account's risk policy states that parity; currency names the account currency. When the paper book can't value a position honestly (it has no current price, the feed is delayed outside the sandbox, or a futures position's contract is no longer the one priced), unrealizedPnl and netLiquidating are null.

The account's balance, profit and loss, and buying power. A value is null until known.

provider
string
required

The provider the account is at.

accountNumber
string
required

The account number.

currency
string
required

The currency the account is held in.

balance
number | null

The balance.

realizedPnl
number | null

Realized profit and loss.

unrealizedPnl
number | null

Unrealized profit and loss on open positions.

netLiquidating
number | null

What the account would be worth if every position closed now.

availableBuyingPower
number | null

Buying power for new positions, as the provider reports and enforces it. It is the real basis of margin and leverage (leverage is netLiquidating divided by marginRequired). On a paper book account, including a Demo, it is the free collateral the account's risk decisions last valued its pool at: marginBalance less usedBuyingPower. It is negative when no new exposure fits. It isn't an order's verdict: the paper book judges each order at its own prices, and POST /api/trading/margin-preview tells you beforehand whether it fits. A new account holding nothing shows its whole balance. It is null while the account's latest change is still being valued, or while a price it needs is missing or stale.

usedBuyingPower
number | null

Buying power in use by open positions and working orders. On a paper book account it is the initial margin the account's risk decisions last valued its open positions at, plus what working orders and charges of unknown amount hold back, so usedBuyingPower and availableBuyingPower add up to marginBalance. It is null when availableBuyingPower is.

marginBalance
number | null

The provider's margin balance: the equity it counts toward margin. On a paper book account it is the equity the account's risk decisions last valued its pool at, and null when availableBuyingPower is.

asOf
number | null

When these values were read, in epoch seconds, or null until the provider's first reading.