import { Channel, ChannelEventSource } from "../../internal"; import { Position } from "./Position"; import Big from "big.js"; import { PerpetualProtocolConnected } from "../PerpetualProtocol"; export interface FetchPositionsReturn { takerPositions: Position[]; makerPositions: Position[]; } declare type PositionsEventName = "updated" | "updateError"; declare type ByMarketTickerSymbol = { [tickerSymbol: string]: Value; }; export declare class Positions extends Channel { private readonly _perp; private _cache; constructor(_perp: PerpetualProtocolConnected); protected _getEventSourceMap(): { updated: ChannelEventSource; }; getTakerPositions({ cache }?: { cache?: boolean | undefined; }): Promise; getMakerPositions({ cache }?: { cache?: boolean | undefined; }): Promise; getTakerPositionByTickerSymbol(tickerSymbol: string, { cache }?: { cache?: boolean | undefined; }): Promise; getMakerPositionByTickerSymbol(tickerSymbol: string, { cache }?: { cache?: boolean | undefined; }): Promise; getTakerPosition(baseAddress: string, { cache }?: { cache?: boolean | undefined; }): Promise; getMakerPosition(baseAddress: string, { cache }?: { cache?: boolean | undefined; }): Promise; getTotalPositionValue(baseAddress: string, { cache }?: { cache?: boolean | undefined; }): Promise; getTotalPositionValueFromAllMarkets({ cache }?: { cache?: boolean | undefined; }): Promise; getTotalTakerPositionValueFromAllMarkets({ cache }?: { cache?: boolean | undefined; }): Promise; getTotalMakerPositionValueFromAllMarkets({ cache }?: { cache?: boolean | undefined; }): Promise; getTotalUnrealizedPnlFromAllMarkets({ cache }?: { cache?: boolean | undefined; }): Promise; getTotalTakerUnrealizedPnlFromAllMarkets({ cache }?: { cache?: boolean | undefined; }): Promise; getTotalMakerUnrealizedPnlFromAllMarkets({ cache }?: { cache?: boolean | undefined; }): Promise; getTotalPendingFundingPayments({ cache }?: { cache?: boolean | undefined; }): Promise>; getAccountMarginRatio({ cache }?: { cache?: boolean | undefined; }): Promise; getAccountLeverage({ cache }?: { cache?: boolean | undefined; }): Promise; private _fetch; protected getPositionDataAll(): Promise; private getAdjustedSqrtPriceX96; } export interface PositionDataAllCrossMarket { totalTakerPositionValue: Big; totalMakerPositionValue: Big; totalTakerUnrealizedPnl: Big; totalMakerUnrealizedPnl: Big; totalUnrealizedPnl: Big; accountPosValueAbs: Big; accountMarginRatio?: Big; accountLeverage?: Big; } export interface PositionDataAllByMarket { [key: string]: { takerPosition?: Position; takerPositionValue?: Big; takerPosUnrealizedPnl?: Big; takerPosExitPrice?: Big; takerPosExitPriceImpact?: Big; takerPosExitTxFee?: Big; makerPosition?: Position; makerPositionValue?: Big; makerPosUnrealizedPnl?: Big; makerPosExitPrice?: Big; makerPosExitPriceImpact?: Big; makerPosExitTxFee?: Big; pendingFundingPayment: Big; indexPrice: Big; marketPrice: Big; }; } export interface PositionDataAll { positionDataAllByMarket: PositionDataAllByMarket; positionDataAllCrossMarket: PositionDataAllCrossMarket; } export {};