aftermath-ts-sdk - v3.3.3
    Preparing search index...

    Aggregate position data for a single perpetuals market and account.

    Values are generally denoted in:

    • Base asset units (e.g. BTC)
    • Quote units (e.g. USD)
    • Collateral units (per collateralCoinType)
    interface PerpetualsPosition {
        asksQuantity: number;
        baseAssetAmount: number;
        bidsQuantity: number;
        collateral: number;
        collateralUsd: number;
        cumFundingRateLong: number;
        cumFundingRateShort: number;
        entryPrice: number;
        freeCollateral: number;
        freeMarginUsd: number;
        leverage: number;
        liquidationPrice: number;
        marginRatio: number;
        marketId: string;
        pendingOrders: {
            clientOrderId?: bigint;
            currentSize: bigint;
            initialSize: bigint;
            orderId: bigint;
            side: PerpetualsOrderSide;
        }[];
        quoteAssetNotionalAmount: number;
        unrealizedFundingsUsd: number;
        unrealizedPnlUsd: number;
    }
    Index
    asksQuantity: number

    Aggregate size of resting asks in this market for the account.

    baseAssetAmount: number

    Net base asset amount (positive = long, negative = short).

    bidsQuantity: number

    Aggregate size of resting bids in this market for the account.

    collateral: number

    Allocated collateral (in collateral coins).

    collateralUsd: number

    Collateral value in USD.

    cumFundingRateLong: number

    Cumulative funding rate accrued on the long side.

    cumFundingRateShort: number

    Cumulative funding rate accrued on the short side.

    entryPrice: number

    Average entry price of the position.

    freeCollateral: number

    Free (unlocked) collateral in collateral units.

    freeMarginUsd: number

    Free margin available in USD.

    leverage: number

    Effective leverage applied to the position.

    liquidationPrice: number

    Approximate liquidation price for the position.

    marginRatio: number

    Current margin ratio (collateral / exposure).

    marketId: string

    Market identifier for this position.

    pendingOrders: {
        clientOrderId?: bigint;
        currentSize: bigint;
        initialSize: bigint;
        orderId: bigint;
        side: PerpetualsOrderSide;
    }[]

    All pending (open) orders associated with this position.

    Type Declaration

    • OptionalclientOrderId?: bigint

      Client-managed order id this order was tagged with, if any.

    • currentSize: bigint

      Current size remaining of the order in base units (scaled as bigint).

    • initialSize: bigint

      Initial size of the order in base units (scaled as bigint).

    • orderId: bigint

      Unique ID of the order.

    • side: PerpetualsOrderSide

      Side of the order (Bid/Ask).

    quoteAssetNotionalAmount: number

    Notional exposure of the position in quote units.

    unrealizedFundingsUsd: number

    Unrealized funding PnL in USD.

    unrealizedPnlUsd: number

    Unrealized position PnL in USD.