Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • PerpPosition

Index

Constructors

  • new PerpPosition(marketIndex: PerpMarketIndex, settlePnlLimitWindow: number, settlePnlLimitSettledInCurrentWindowNative: BN, basePositionLots: BN, quotePositionNative: I80F48, quoteRunningNative: BN, longSettledFunding: I80F48, shortSettledFunding: I80F48, bidsBaseLots: BN, asksBaseLots: BN, takerBaseLots: BN, takerQuoteLots: BN, cumulativeLongFunding: number, cumulativeShortFunding: number, makerVolume: BN, takerVolume: BN, perpSpotTransfers: BN, avgEntryPricePerBaseLot: number, deprecatedRealizedTradePnlNative: I80F48, oneshotSettlePnlAllowance: I80F48, recurringSettlePnlAllowance: BN, realizedPnlForPositionNative: I80F48): PerpPosition
  • Parameters

    • marketIndex: PerpMarketIndex
    • settlePnlLimitWindow: number
    • settlePnlLimitSettledInCurrentWindowNative: BN
    • basePositionLots: BN
    • quotePositionNative: I80F48
    • quoteRunningNative: BN
    • longSettledFunding: I80F48
    • shortSettledFunding: I80F48
    • bidsBaseLots: BN
    • asksBaseLots: BN
    • takerBaseLots: BN
    • takerQuoteLots: BN
    • cumulativeLongFunding: number
    • cumulativeShortFunding: number
    • makerVolume: BN
    • takerVolume: BN
    • perpSpotTransfers: BN
    • avgEntryPricePerBaseLot: number
    • deprecatedRealizedTradePnlNative: I80F48
    • oneshotSettlePnlAllowance: I80F48
    • recurringSettlePnlAllowance: BN
    • realizedPnlForPositionNative: I80F48

    Returns PerpPosition

Properties

asksBaseLots: BN
avgEntryPricePerBaseLot: number
basePositionLots: BN
bidsBaseLots: BN
cumulativeLongFunding: number
cumulativeShortFunding: number
deprecatedRealizedTradePnlNative: I80F48
longSettledFunding: I80F48
makerVolume: BN
marketIndex: PerpMarketIndex
oneshotSettlePnlAllowance: I80F48
perpSpotTransfers: BN
quotePositionNative: I80F48
quoteRunningNative: BN
realizedPnlForPositionNative: I80F48
recurringSettlePnlAllowance: BN
settlePnlLimitSettledInCurrentWindowNative: BN
settlePnlLimitWindow: number
shortSettledFunding: I80F48
takerBaseLots: BN
takerQuoteLots: BN
takerVolume: BN
PerpMarketIndexUnset: number = 65535

Methods

  • availableSettleLimit(perpMarket: PerpMarket): [BN, BN]
  • cumulativePnlOverPositionLifetimeUi(perpMarket: PerpMarket): number
  • getAverageEntryPriceUi(perpMarket: PerpMarket): number
  • getBasePositionUi(perpMarket: PerpMarket, useEventQueue?: boolean): number
  • getBreakEvenPriceUi(perpMarket: PerpMarket): number
  • Parameters

    Returns CumulativeFunding

    perp position cumulative funding, in quote token units. If the user paid $1 in funding for a short position, this would be -1e6. Caveat: This will only return cumulative interest since the perp position was last opened. If the perp position was closed and reopened multiple times it is necessary to add this result to cumulative funding at each of the prior perp position closings (from mango API) to get the all time cumulative funding.

  • getCumulativeFundingUi(perpMarket: PerpMarket): number
  • getNotionalValueUi(perpMarket: PerpMarket, useEventQueue?: boolean): number
  • getQuotePositionUi(perpMarket: PerpMarket, useEventQueue?: boolean): number
  • getRealizedPnlUi(): number
  • getUnRealizedPnlUi(perpMarket: PerpMarket): number
  • getUnsettledFundingUi(perpMarket: PerpMarket): number
  • hasOpenOrders(): boolean
  • isActive(): boolean

Generated using TypeDoc