Owner account reads use an authenticated
session. Position snapshots also support
public reads.
Review Account Health
Start with the account’s current collateral and exposure when showing portfolio health or checking whether a trade fits the account’s risk state.Balances
Use balances to show collateral by asset and account value.- TypeScript
- Python
- API
Output: PerpsBalance[]
Output: PerpsBalance[]
Portfolio
Use the portfolio to show open positions, margin usage, withdrawable collateral, and liquidation state.- TypeScript
- Python
- API
Output: PerpsPortfolio
Output: PerpsPortfolio
Account Stats
Use account stats to review trailing 7-day trading activity such as volume and maker share. Stats are cached by UTC day and may be stale by up to 24 hours. See Fee Metrics for what each metric means.- TypeScript
- Python
- API
Output: PerpsAccountStats
Output: PerpsAccountStats
Reconcile Orders and Fills
Use order state and fills to connect submitted orders with resting liquidity, executions, fees, and exposure changes.Open Orders
Use open orders to show what is still resting on the book.- TypeScript
- Python
- API
Output: PerpsOrder[]
Output: PerpsOrder[]
Orders
Use orders to inspect the latest known state for submitted orders.- TypeScript
- Python
- API
Output: PerpsOrder[]
Output: PerpsOrder[]
Fills
Use fills to reconcile executions, fees, realized PnL, and exposure changes.- TypeScript
- Python
- API
Output: PerpsAccountFill[]
Output: PerpsAccountFill[]
settlement: true identifies a position close at the final instrument-settlement
price. The same flag is available on each fill in a session "fill" event
payload; it defaults to false on older responses.Inspect Position Snapshots
Inspect a position now or immediately after a selected fill. Each snapshot covers one position cycle, from opening until the position becomes flat or changes side. Select up to 20 active instruments and 4 historical fills in one request, with at least one selection. Results keep the selection order within each group.- TypeScript
- Python
- API
Use the existing authenticated
To inspect the fill shown in the Fills example, add For a public read, call
session to read your own positions. The example
selects instrument 1; replace it with the instrument you want to inspect.Output: PerpsPositionSnapshots
Output: PerpsPositionSnapshots
A successful active selection returns:For
Ok, snapshot is a PerpsPositionSnapshot. Financial values such as pnl
use DecimalString; timestamps are Unix milliseconds. pnlPercent and leverage
can be null.historyFills. Keep the
original decimal trade ID as a string; do not round it through a JavaScript number.client.fetchPerpsPositionSnapshots({ address, activeInstrumentIds: [1] }) with a createPublicClient() instance and the
registered account’s address. This method does not add session credentials,
including when inherited by a secure client.Interpret a Snapshot
While a cycle remains open, PnL is gross unrealized profit or loss on its remaining size. After it closes, PnL is the gross realized total for that cycle. Both exclude fees, funding, and previous cycles. A fill that closes or flips a position returns the closed cycle; the new cycle appears in the active selection or its later fills. Leverage and PnL percentage are visible only to the authenticated owner. Historical leverage uses the value captured at the selected fill and can remain unavailable. PnL percentage uses nominal entry margin, so it can differ from portfolio return on equity. Chart candles and markers use numeric coordinates and approximate prices; the selected minute’s candle includes the whole minute’s aggregate.Handle Unavailable Selections
Only successful selections contain a snapshot. The completed-history horizon indicates how far the serving gateway has processed history; gateways can report different horizons. Handle each selection independently instead of discarding the whole batch when one selection is unavailable.
Reconstruction limits and unsafe-accounting results are not signals to poll
indefinitely.
Reconcile Funding and Transfers
Funding, deposits, and withdrawals explain collateral changes that did not come from order fills. Use Fund Your Account for deposit and withdrawal submission workflows.Funding Payments
Use funding payments to explain periodic funding debits or credits for a market.- TypeScript
- Python
- API
id for storing or deduplicating funding payments.Output: PerpsAccountFundingPayment[]
Output: PerpsAccountFundingPayment[]
Deposits
Use deposits to reconcile collateral added to the Perps account.- TypeScript
- Python
- API
Output: PerpsDeposit[]
Output: PerpsDeposit[]
Withdrawals
Use withdrawals to reconcile collateral leaving the Perps account.- TypeScript
- Python
- API
Output: PerpsWithdrawal[]
Output: PerpsWithdrawal[]
status using the PerpsKnownWithdrawalStatus enum.The status set can grow between SDK releases.
status is typed
PerpsWithdrawalStatus, so a status added after your release arrives as a
plain string instead of failing the response parse.Track Equity and PnL
Use equity and PnL history to explain how the account’s value changed over time.Equity
Use equity history to chart account value over time. Each point is the last equity sample in itsinterval bucket, stamped with that sample’s own
timestamp. A coarser interval lets each 1000-point page cover a longer window
before more is set.
- TypeScript
- Python
- API
Output: PerpsEquityPoint[]
Output: PerpsEquityPoint[]
PnL
Use PnL history to chart account profit and loss over the same interval. Each point is the PnL realized inside itsinterval bucket — not a running total —
and buckets in which nothing was realized are omitted, so the series is
sparse.
- TypeScript
- Python
- API
Output: PerpsPnlPoint[]
Output: PerpsPnlPoint[]