Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

PerpsUserState

A user's perps state — margin, positions, vault shares.

Definition

type PerpsUserState = {
  margin: string
  vaultShares: string
  positions: Record<string, PerpsPosition>
  unlocks: PerpsUnlock[]
  reservedMargin: string
  openOrderCount: number
}
 
type PerpsPosition = {
  size: string
  entryPrice: string
  entryFundingPerUnit: string
  conditionalOrderAbove?: ConditionalOrder
  conditionalOrderBelow?: ConditionalOrder
}
 
type PerpsUnlock = {
  endTime: string
  amountToRelease: string
}

Fields

margin — total collateral.

vaultShares — vault shares held.

positionsRecord<pairId, PerpsPosition>.

unlocks — pending vault withdrawals waiting on cooldown.

reservedMargin — margin reserved for open orders.

openOrderCount — active perps orders.

See also