Markets module class

Param: config

SDK configuration

Param: config.chainId

SupportedChainId

Param: config.publicClient

Public Client

Param: config.graphClient

GraphQL Client

Param: config.oracleClients

Oracle Clients OracleClients

Param: config.walletClient

Wallet Client

Param: config.operatingFor

If set, the module will read data and send multi-invoker transactions on behalf of this address.

Param: config.supportedMarkets

Subset of availalbe markets to support.

Returns

Markets module instance

Constructors

Properties

Accessors

Constructors

Properties

defaultAddress: `0x${string}` = zeroAddress

Accessors

  • get build(): {
        cancelOrder: ((args) => {
            data: `0x${string}`;
            to: `0x${string}`;
            value: bigint;
        });
        claimFee: ((args) => {
            data: `0x${string}`;
            to: `0x${string}`;
            value: bigint;
        });
        limitOrder: ((args) => Promise<undefined | {
            data: `0x${string}`;
            to: `0x${string}`;
            value: bigint;
        }>);
        modifyPosition: ((args) => Promise<{
            data: `0x${string}`;
            to: `0x${string}`;
            value: bigint;
        }>);
        placeOrder: ((args) => Promise<{
            data: `0x${string}`;
            to: `0x${string}`;
            value: bigint;
        }>);
        signed: {
            cancelOrder: ((args) => {
                cancelOrder: CancelOrderSigningPayload;
            });
            intent: ((args) => {
                intent: IntentSigningPayload;
            });
            placeOrder: ((args) => {
                placeOrder: PlaceOrderSigningPayload;
            });
            take: ((args) => {
                take: TakeSigningPayload;
            });
        };
        stopLoss: ((args) => Promise<{
            data: `0x${string}`;
            to: `0x${string}`;
            value: bigint;
        }>);
        takeProfit: ((args) => Promise<{
            data: `0x${string}`;
            to: `0x${string}`;
            value: bigint;
        }>);
        update: ((args) => Promise<undefined | {
            data: `0x${string}`;
            to: `0x${string}`;
            value: bigint;
        }>);
        updateIntent: ((args) => {
            data: `0x${string}`;
            to: `0x${string}`;
            value: bigint;
        });
    }
  • Returns {
        cancelOrder: ((args) => {
            data: `0x${string}`;
            to: `0x${string}`;
            value: bigint;
        });
        claimFee: ((args) => {
            data: `0x${string}`;
            to: `0x${string}`;
            value: bigint;
        });
        limitOrder: ((args) => Promise<undefined | {
            data: `0x${string}`;
            to: `0x${string}`;
            value: bigint;
        }>);
        modifyPosition: ((args) => Promise<{
            data: `0x${string}`;
            to: `0x${string}`;
            value: bigint;
        }>);
        placeOrder: ((args) => Promise<{
            data: `0x${string}`;
            to: `0x${string}`;
            value: bigint;
        }>);
        signed: {
            cancelOrder: ((args) => {
                cancelOrder: CancelOrderSigningPayload;
            });
            intent: ((args) => {
                intent: IntentSigningPayload;
            });
            placeOrder: ((args) => {
                placeOrder: PlaceOrderSigningPayload;
            });
            take: ((args) => {
                take: TakeSigningPayload;
            });
        };
        stopLoss: ((args) => Promise<{
            data: `0x${string}`;
            to: `0x${string}`;
            value: bigint;
        }>);
        takeProfit: ((args) => Promise<{
            data: `0x${string}`;
            to: `0x${string}`;
            value: bigint;
        }>);
        update: ((args) => Promise<undefined | {
            data: `0x${string}`;
            to: `0x${string}`;
            value: bigint;
        }>);
        updateIntent: ((args) => {
            data: `0x${string}`;
            to: `0x${string}`;
            value: bigint;
        });
    }

    • cancelOrder: ((args) => {
          data: `0x${string}`;
          to: `0x${string}`;
          value: bigint;
      })

      Build a cancel order transaction

      Returns

      Cancel order transaction data.

        • (args): {
              data: `0x${string}`;
              to: `0x${string}`;
              value: bigint;
          }
        • Returns {
              data: `0x${string}`;
              to: `0x${string}`;
              value: bigint;
          }

          • data: `0x${string}`
          • to: `0x${string}`
          • value: bigint
    • claimFee: ((args) => {
          data: `0x${string}`;
          to: `0x${string}`;
          value: bigint;
      })

      Build a claim fee transaction

      Notice

      This method only claims for the transaction sending address. OperatingFor is not supported

        • (args): {
              data: `0x${string}`;
              to: `0x${string}`;
              value: bigint;
          }
        • Returns {
              data: `0x${string}`;
              to: `0x${string}`;
              value: bigint;
          }

          • data: `0x${string}`
          • to: `0x${string}`
          • value: bigint
    • limitOrder: ((args) => Promise<undefined | {
          data: `0x${string}`;
          to: `0x${string}`;
          value: bigint;
      }>)

      Build a limit order transaction

      Returns

      Limit order transaction data.

        • (args): Promise<undefined | {
              data: `0x${string}`;
              to: `0x${string}`;
              value: bigint;
          }>
        • Returns Promise<undefined | {
              data: `0x${string}`;
              to: `0x${string}`;
              value: bigint;
          }>

    • modifyPosition: ((args) => Promise<{
          data: `0x${string}`;
          to: `0x${string}`;
          value: bigint;
      }>)

      Build a modify position transaction. Can be used to increase/decrease an existing position, open/close a position and deposit or withdraw collateral.

      Returns

      Modify position transaction data.

        • (args): Promise<{
              data: `0x${string}`;
              to: `0x${string}`;
              value: bigint;
          }>
        • Returns Promise<{
              data: `0x${string}`;
              to: `0x${string}`;
              value: bigint;
          }>

    • placeOrder: ((args) => Promise<{
          data: `0x${string}`;
          to: `0x${string}`;
          value: bigint;
      }>)

      Build a place order transaction. Can be used to set combined limit, stop loss and take profit orders.

      Returns

      Place order transaction data.

        • (args): Promise<{
              data: `0x${string}`;
              to: `0x${string}`;
              value: bigint;
          }>
        • Returns Promise<{
              data: `0x${string}`;
              to: `0x${string}`;
              value: bigint;
          }>

    • signed: {
          cancelOrder: ((args) => {
              cancelOrder: CancelOrderSigningPayload;
          });
          intent: ((args) => {
              intent: IntentSigningPayload;
          });
          placeOrder: ((args) => {
              placeOrder: PlaceOrderSigningPayload;
          });
          take: ((args) => {
              take: TakeSigningPayload;
          });
      }
    • stopLoss: ((args) => Promise<{
          data: `0x${string}`;
          to: `0x${string}`;
          value: bigint;
      }>)

      Build a stop loss order transaction

      Returns

      Stop loss transaction data.

        • (args): Promise<{
              data: `0x${string}`;
              to: `0x${string}`;
              value: bigint;
          }>
        • Returns Promise<{
              data: `0x${string}`;
              to: `0x${string}`;
              value: bigint;
          }>

    • takeProfit: ((args) => Promise<{
          data: `0x${string}`;
          to: `0x${string}`;
          value: bigint;
      }>)

      Build a take profit order transaction

      Returns

      Take profit transaction data.

        • (args): Promise<{
              data: `0x${string}`;
              to: `0x${string}`;
              value: bigint;
          }>
        • Returns Promise<{
              data: `0x${string}`;
              to: `0x${string}`;
              value: bigint;
          }>

    • update: ((args) => Promise<undefined | {
          data: `0x${string}`;
          to: `0x${string}`;
          value: bigint;
      }>)

      Build an update market transaction. Can be used to increase/decrease an existing position, open/close a position and deposit or withdraw collateral

      Returns

      Update market transaction data.

        • (args): Promise<undefined | {
              data: `0x${string}`;
              to: `0x${string}`;
              value: bigint;
          }>
        • Returns Promise<undefined | {
              data: `0x${string}`;
              to: `0x${string}`;
              value: bigint;
          }>

    • updateIntent: ((args) => {
          data: `0x${string}`;
          to: `0x${string}`;
          value: bigint;
      })

      Build a update intent transaction

        • (args): {
              data: `0x${string}`;
              to: `0x${string}`;
              value: bigint;
          }
        • Returns {
              data: `0x${string}`;
              to: `0x${string}`;
              value: bigint;
          }

          • data: `0x${string}`
          • to: `0x${string}`
          • value: bigint
  • get read(): {
        activePositionHistory: ((args) => Promise<{
            delta: bigint;
            depositTotal: bigint;
            executionPrice: bigint;
            executionPriceWithOffset: bigint;
            feeAccumulations: RealizedFeeAccumulations;
            guaranteePrice: null | bigint;
            liquidation: boolean;
            liquidationFee: bigint;
            magnitude: bigint;
            market: SupportedMarket;
            netDeposits: bigint;
            netPnl: bigint;
            netPnlPercent: bigint;
            orderId: bigint;
            pnlAccumulations: RealizedAccumulations;
            side: PositionSide;
            startCollateral: bigint;
            totalFees: bigint;
            totalPnl: bigint;
            transactionHashes: string[];
            valid: boolean;
            version: bigint;
            withdrawalTotal: bigint;
        }[]>);
        activePositionsPnl: ((args?) => Promise<SupportedMarketMapping<{
            averageEntryPrice: bigint;
            averageExitPrice: bigint;
            endVersion: null | bigint;
            feeAccumulations: RealizedFeeAccumulations;
            liquidation: boolean;
            liquidationFee: bigint;
            market: SupportedMarket;
            marketAddress: `0x${string}`;
            netDeposits: bigint;
            netPnl: bigint;
            netPnlPercent: bigint;
            pnlAccumulations: RealizedAccumulations;
            positionId: bigint;
            side: PositionSide;
            startCollateral: bigint;
            startPrice: bigint;
            startSize: bigint;
            startTransactionHash: null | string;
            startVersion: bigint;
            totalFees: bigint;
            totalNotional: bigint;
            totalPnl: bigint;
            trades: bigint;
        } & {
            pendingMarkToMarketAccumulations: null | RealizedAccumulations;
            realtime: bigint;
            realtimePercent: bigint;
        }>>);
        historicalPositions: ((args?) => Promise<{
            averageEntryPrice: bigint;
            averageExitPrice: bigint;
            endVersion: null | bigint;
            feeAccumulations: RealizedFeeAccumulations;
            liquidation: boolean;
            liquidationFee: bigint;
            market: SupportedMarket;
            marketAddress: `0x${string}`;
            netDeposits: bigint;
            netPnl: bigint;
            netPnlPercent: bigint;
            pnlAccumulations: RealizedAccumulations;
            positionId: bigint;
            side: PositionSide;
            startCollateral: bigint;
            startPrice: bigint;
            startSize: bigint;
            startTransactionHash: null | string;
            startVersion: bigint;
            totalFees: bigint;
            totalNotional: bigint;
            totalPnl: bigint;
            trades: bigint;
        }[]>);
        marketOracles: (() => Promise<SupportedMarketMapping<{
            commitmentGasOracle: `0x${string}`;
            id: `0x${string}`;
            market: SupportedMarket;
            marketAddress: `0x${string}`;
            maxSettlementFee: bigint;
            minValidTime: bigint;
            oracleAddress: `0x${string}`;
            oracleFactoryAddress: `0x${string}`;
            oracleName: string;
            settlementGasOracle: `0x${string}`;
            staleAfter: bigint;
            subOracleAddress: `0x${string}`;
            subOracleFactoryAddress: `0x${string}`;
            subOracleFactoryType: string;
            underlyingId: `0x${string}`;
        }>>);
        marketSnapshots: ((args?) => Promise<{
            blockNumber: bigint;
            commitments: readonly `0x${string}`[];
            market: {
                aero: undefined | MarketSnapshot;
                arb: undefined | MarketSnapshot;
                bnb: undefined | MarketSnapshot;
                btc: undefined | MarketSnapshot;
                btc²: undefined | MarketSnapshot;
                doge: undefined | MarketSnapshot;
                eth: undefined | MarketSnapshot;
                eth²: undefined | MarketSnapshot;
                eur: undefined | MarketSnapshot;
                gbp: undefined | MarketSnapshot;
                jpy: undefined | MarketSnapshot;
                jup: undefined | MarketSnapshot;
                link: undefined | MarketSnapshot;
                meem: undefined | MarketSnapshot;
                mkr: undefined | MarketSnapshot;
                mog: undefined | MarketSnapshot;
                pol: undefined | MarketSnapshot;
                popcat: undefined | MarketSnapshot;
                rlb: undefined | MarketSnapshot;
                sol: undefined | MarketSnapshot;
                tia: undefined | MarketSnapshot;
                unknown: undefined | MarketSnapshot;
                xau: undefined | MarketSnapshot;
                xrp: undefined | MarketSnapshot;
            };
            updates: readonly `0x${string}`[];
            user: undefined | SupportedMarketMapping<UserMarketSnapshot>;
        }>);
        markets24hrData: ((args?) => Promise<SupportedMarketMapping<{
            address: `0x${string}`;
            fundingRates: {
                longAPR: bigint;
                makerAPR: bigint;
                shortAPR: bigint;
                timestamp: string;
            }[];
            interestRates: {
                longAPR: bigint;
                makerAPR: bigint;
                shortAPR: bigint;
                timestamp: string;
            }[];
            makerAccumulation: {
                exposure: bigint;
                funding: bigint;
                interest: bigint;
                positionFee: bigint;
            };
            market: SupportedMarket;
            takerVolumes: {
                longNotional: bigint;
                shortNotional: bigint;
                timestamp: string;
            }[];
        }>>);
        marketsHistoricalData: ((args) => Promise<SupportedMarketMapping<{
            address: `0x${string}`;
            fundingRates: {
                longAPR: bigint;
                makerAPR: bigint;
                shortAPR: bigint;
                timestamp: string;
            }[];
            interestRates: {
                longAPR: bigint;
                makerAPR: bigint;
                shortAPR: bigint;
                timestamp: string;
            }[];
            makerAccumulation: {
                exposure: bigint;
                funding: bigint;
                interest: bigint;
                positionFee: bigint;
            };
            market: SupportedMarket;
            takerVolumes: {
                longNotional: bigint;
                shortNotional: bigint;
                timestamp: string;
            }[];
        }>>);
        openOrders: ((args?) => Promise<{
            account: `0x${string}`;
            associatedOrder?: null | {
                collateral: string;
                depositTotal: string;
                withdrawalTotal: string;
            };
            blockTimestamp: string;
            market: SupportedMarket;
            marketAddress: `0x${string}`;
            nonce: string;
            source: `0x${string}`;
            transactionHash: string;
            triggerOrderComparison: number;
            triggerOrderDelta: string;
            triggerOrderFee: string;
            triggerOrderPrice: string;
            triggerOrderSide: number;
        }[]>);
        settlementFees: ((args?) => Promise<SupportedMarketMapping<{
            commitmentCost: bigint;
            settlementCost: bigint;
            totalCost: bigint;
        }>>);
        subPositions: ((args) => Promise<{
            delta: bigint;
            depositTotal: bigint;
            executionPrice: bigint;
            executionPriceWithOffset: bigint;
            feeAccumulations: RealizedFeeAccumulations;
            guaranteePrice: null | bigint;
            liquidation: boolean;
            liquidationFee: bigint;
            magnitude: bigint;
            market: SupportedMarket;
            netDeposits: bigint;
            netPnl: bigint;
            netPnlPercent: bigint;
            orderId: bigint;
            pnlAccumulations: RealizedAccumulations;
            side: PositionSide;
            startCollateral: bigint;
            totalFees: bigint;
            totalPnl: bigint;
            transactionHashes: string[];
            valid: boolean;
            version: bigint;
            withdrawalTotal: bigint;
        }[]>);
        tradeHistory: ((args?) => Promise<{
            delta: bigint;
            depositTotal: bigint;
            executionPrice: bigint;
            executionPriceWithOffset: bigint;
            feeAccumulations: RealizedFeeAccumulations;
            guaranteePrice: null | bigint;
            liquidation: boolean;
            liquidationFee: bigint;
            magnitude: bigint;
            market: SupportedMarket;
            netDeposits: bigint;
            netPnl: bigint;
            netPnlPercent: bigint;
            orderId: bigint;
            pnlAccumulations: RealizedAccumulations;
            side: PositionSide;
            startCollateral: bigint;
            totalFees: bigint;
            totalPnl: bigint;
            transactionHashes: string[];
            valid: boolean;
            version: bigint;
            withdrawalTotal: bigint;
        }[]>);
        waitForOrderSettlement: ((txHash, onSettlement?) => Promise<TransactionReceipt>);
    }
  • Returns {
        activePositionHistory: ((args) => Promise<{
            delta: bigint;
            depositTotal: bigint;
            executionPrice: bigint;
            executionPriceWithOffset: bigint;
            feeAccumulations: RealizedFeeAccumulations;
            guaranteePrice: null | bigint;
            liquidation: boolean;
            liquidationFee: bigint;
            magnitude: bigint;
            market: SupportedMarket;
            netDeposits: bigint;
            netPnl: bigint;
            netPnlPercent: bigint;
            orderId: bigint;
            pnlAccumulations: RealizedAccumulations;
            side: PositionSide;
            startCollateral: bigint;
            totalFees: bigint;
            totalPnl: bigint;
            transactionHashes: string[];
            valid: boolean;
            version: bigint;
            withdrawalTotal: bigint;
        }[]>);
        activePositionsPnl: ((args?) => Promise<SupportedMarketMapping<{
            averageEntryPrice: bigint;
            averageExitPrice: bigint;
            endVersion: null | bigint;
            feeAccumulations: RealizedFeeAccumulations;
            liquidation: boolean;
            liquidationFee: bigint;
            market: SupportedMarket;
            marketAddress: `0x${string}`;
            netDeposits: bigint;
            netPnl: bigint;
            netPnlPercent: bigint;
            pnlAccumulations: RealizedAccumulations;
            positionId: bigint;
            side: PositionSide;
            startCollateral: bigint;
            startPrice: bigint;
            startSize: bigint;
            startTransactionHash: null | string;
            startVersion: bigint;
            totalFees: bigint;
            totalNotional: bigint;
            totalPnl: bigint;
            trades: bigint;
        } & {
            pendingMarkToMarketAccumulations: null | RealizedAccumulations;
            realtime: bigint;
            realtimePercent: bigint;
        }>>);
        historicalPositions: ((args?) => Promise<{
            averageEntryPrice: bigint;
            averageExitPrice: bigint;
            endVersion: null | bigint;
            feeAccumulations: RealizedFeeAccumulations;
            liquidation: boolean;
            liquidationFee: bigint;
            market: SupportedMarket;
            marketAddress: `0x${string}`;
            netDeposits: bigint;
            netPnl: bigint;
            netPnlPercent: bigint;
            pnlAccumulations: RealizedAccumulations;
            positionId: bigint;
            side: PositionSide;
            startCollateral: bigint;
            startPrice: bigint;
            startSize: bigint;
            startTransactionHash: null | string;
            startVersion: bigint;
            totalFees: bigint;
            totalNotional: bigint;
            totalPnl: bigint;
            trades: bigint;
        }[]>);
        marketOracles: (() => Promise<SupportedMarketMapping<{
            commitmentGasOracle: `0x${string}`;
            id: `0x${string}`;
            market: SupportedMarket;
            marketAddress: `0x${string}`;
            maxSettlementFee: bigint;
            minValidTime: bigint;
            oracleAddress: `0x${string}`;
            oracleFactoryAddress: `0x${string}`;
            oracleName: string;
            settlementGasOracle: `0x${string}`;
            staleAfter: bigint;
            subOracleAddress: `0x${string}`;
            subOracleFactoryAddress: `0x${string}`;
            subOracleFactoryType: string;
            underlyingId: `0x${string}`;
        }>>);
        marketSnapshots: ((args?) => Promise<{
            blockNumber: bigint;
            commitments: readonly `0x${string}`[];
            market: {
                aero: undefined | MarketSnapshot;
                arb: undefined | MarketSnapshot;
                bnb: undefined | MarketSnapshot;
                btc: undefined | MarketSnapshot;
                btc²: undefined | MarketSnapshot;
                doge: undefined | MarketSnapshot;
                eth: undefined | MarketSnapshot;
                eth²: undefined | MarketSnapshot;
                eur: undefined | MarketSnapshot;
                gbp: undefined | MarketSnapshot;
                jpy: undefined | MarketSnapshot;
                jup: undefined | MarketSnapshot;
                link: undefined | MarketSnapshot;
                meem: undefined | MarketSnapshot;
                mkr: undefined | MarketSnapshot;
                mog: undefined | MarketSnapshot;
                pol: undefined | MarketSnapshot;
                popcat: undefined | MarketSnapshot;
                rlb: undefined | MarketSnapshot;
                sol: undefined | MarketSnapshot;
                tia: undefined | MarketSnapshot;
                unknown: undefined | MarketSnapshot;
                xau: undefined | MarketSnapshot;
                xrp: undefined | MarketSnapshot;
            };
            updates: readonly `0x${string}`[];
            user: undefined | SupportedMarketMapping<UserMarketSnapshot>;
        }>);
        markets24hrData: ((args?) => Promise<SupportedMarketMapping<{
            address: `0x${string}`;
            fundingRates: {
                longAPR: bigint;
                makerAPR: bigint;
                shortAPR: bigint;
                timestamp: string;
            }[];
            interestRates: {
                longAPR: bigint;
                makerAPR: bigint;
                shortAPR: bigint;
                timestamp: string;
            }[];
            makerAccumulation: {
                exposure: bigint;
                funding: bigint;
                interest: bigint;
                positionFee: bigint;
            };
            market: SupportedMarket;
            takerVolumes: {
                longNotional: bigint;
                shortNotional: bigint;
                timestamp: string;
            }[];
        }>>);
        marketsHistoricalData: ((args) => Promise<SupportedMarketMapping<{
            address: `0x${string}`;
            fundingRates: {
                longAPR: bigint;
                makerAPR: bigint;
                shortAPR: bigint;
                timestamp: string;
            }[];
            interestRates: {
                longAPR: bigint;
                makerAPR: bigint;
                shortAPR: bigint;
                timestamp: string;
            }[];
            makerAccumulation: {
                exposure: bigint;
                funding: bigint;
                interest: bigint;
                positionFee: bigint;
            };
            market: SupportedMarket;
            takerVolumes: {
                longNotional: bigint;
                shortNotional: bigint;
                timestamp: string;
            }[];
        }>>);
        openOrders: ((args?) => Promise<{
            account: `0x${string}`;
            associatedOrder?: null | {
                collateral: string;
                depositTotal: string;
                withdrawalTotal: string;
            };
            blockTimestamp: string;
            market: SupportedMarket;
            marketAddress: `0x${string}`;
            nonce: string;
            source: `0x${string}`;
            transactionHash: string;
            triggerOrderComparison: number;
            triggerOrderDelta: string;
            triggerOrderFee: string;
            triggerOrderPrice: string;
            triggerOrderSide: number;
        }[]>);
        settlementFees: ((args?) => Promise<SupportedMarketMapping<{
            commitmentCost: bigint;
            settlementCost: bigint;
            totalCost: bigint;
        }>>);
        subPositions: ((args) => Promise<{
            delta: bigint;
            depositTotal: bigint;
            executionPrice: bigint;
            executionPriceWithOffset: bigint;
            feeAccumulations: RealizedFeeAccumulations;
            guaranteePrice: null | bigint;
            liquidation: boolean;
            liquidationFee: bigint;
            magnitude: bigint;
            market: SupportedMarket;
            netDeposits: bigint;
            netPnl: bigint;
            netPnlPercent: bigint;
            orderId: bigint;
            pnlAccumulations: RealizedAccumulations;
            side: PositionSide;
            startCollateral: bigint;
            totalFees: bigint;
            totalPnl: bigint;
            transactionHashes: string[];
            valid: boolean;
            version: bigint;
            withdrawalTotal: bigint;
        }[]>);
        tradeHistory: ((args?) => Promise<{
            delta: bigint;
            depositTotal: bigint;
            executionPrice: bigint;
            executionPriceWithOffset: bigint;
            feeAccumulations: RealizedFeeAccumulations;
            guaranteePrice: null | bigint;
            liquidation: boolean;
            liquidationFee: bigint;
            magnitude: bigint;
            market: SupportedMarket;
            netDeposits: bigint;
            netPnl: bigint;
            netPnlPercent: bigint;
            orderId: bigint;
            pnlAccumulations: RealizedAccumulations;
            side: PositionSide;
            startCollateral: bigint;
            totalFees: bigint;
            totalPnl: bigint;
            transactionHashes: string[];
            valid: boolean;
            version: bigint;
            withdrawalTotal: bigint;
        }[]>);
        waitForOrderSettlement: ((txHash, onSettlement?) => Promise<TransactionReceipt>);
    }

    • activePositionHistory: ((args) => Promise<{
          delta: bigint;
          depositTotal: bigint;
          executionPrice: bigint;
          executionPriceWithOffset: bigint;
          feeAccumulations: RealizedFeeAccumulations;
          guaranteePrice: null | bigint;
          liquidation: boolean;
          liquidationFee: bigint;
          magnitude: bigint;
          market: SupportedMarket;
          netDeposits: bigint;
          netPnl: bigint;
          netPnlPercent: bigint;
          orderId: bigint;
          pnlAccumulations: RealizedAccumulations;
          side: PositionSide;
          startCollateral: bigint;
          totalFees: bigint;
          totalPnl: bigint;
          transactionHashes: string[];
          valid: boolean;
          version: bigint;
          withdrawalTotal: bigint;
      }[]>)

      Fetches active position history for a given address

      Returns

      User's position history for an active position.

        • (args): Promise<{
              delta: bigint;
              depositTotal: bigint;
              executionPrice: bigint;
              executionPriceWithOffset: bigint;
              feeAccumulations: RealizedFeeAccumulations;
              guaranteePrice: null | bigint;
              liquidation: boolean;
              liquidationFee: bigint;
              magnitude: bigint;
              market: SupportedMarket;
              netDeposits: bigint;
              netPnl: bigint;
              netPnlPercent: bigint;
              orderId: bigint;
              pnlAccumulations: RealizedAccumulations;
              side: PositionSide;
              startCollateral: bigint;
              totalFees: bigint;
              totalPnl: bigint;
              transactionHashes: string[];
              valid: boolean;
              version: bigint;
              withdrawalTotal: bigint;
          }[]>
        • Parameters

          • args: OmitBound<{
                address: `0x${string}`;
                chainId: 1424 | 42161 | 60850 | 421614;
                first?: number;
                graphClient: GraphQLClient;
                market: SupportedMarket;
                positionId: bigint;
                skip?: number;
            }> & OptionalAddress

          Returns Promise<{
              delta: bigint;
              depositTotal: bigint;
              executionPrice: bigint;
              executionPriceWithOffset: bigint;
              feeAccumulations: RealizedFeeAccumulations;
              guaranteePrice: null | bigint;
              liquidation: boolean;
              liquidationFee: bigint;
              magnitude: bigint;
              market: SupportedMarket;
              netDeposits: bigint;
              netPnl: bigint;
              netPnlPercent: bigint;
              orderId: bigint;
              pnlAccumulations: RealizedAccumulations;
              side: PositionSide;
              startCollateral: bigint;
              totalFees: bigint;
              totalPnl: bigint;
              transactionHashes: string[];
              valid: boolean;
              version: bigint;
              withdrawalTotal: bigint;
          }[]>

    • activePositionsPnl: ((args?) => Promise<SupportedMarketMapping<{
          averageEntryPrice: bigint;
          averageExitPrice: bigint;
          endVersion: null | bigint;
          feeAccumulations: RealizedFeeAccumulations;
          liquidation: boolean;
          liquidationFee: bigint;
          market: SupportedMarket;
          marketAddress: `0x${string}`;
          netDeposits: bigint;
          netPnl: bigint;
          netPnlPercent: bigint;
          pnlAccumulations: RealizedAccumulations;
          positionId: bigint;
          side: PositionSide;
          startCollateral: bigint;
          startPrice: bigint;
          startSize: bigint;
          startTransactionHash: null | string;
          startVersion: bigint;
          totalFees: bigint;
          totalNotional: bigint;
          totalPnl: bigint;
          trades: bigint;
      } & {
          pendingMarkToMarketAccumulations: null | RealizedAccumulations;
          realtime: bigint;
          realtimePercent: bigint;
      }>>)

      Fetches position PnL for a given market and Address

      Returns

      User's PnL for an active position.

        • (args?): Promise<SupportedMarketMapping<{
              averageEntryPrice: bigint;
              averageExitPrice: bigint;
              endVersion: null | bigint;
              feeAccumulations: RealizedFeeAccumulations;
              liquidation: boolean;
              liquidationFee: bigint;
              market: SupportedMarket;
              marketAddress: `0x${string}`;
              netDeposits: bigint;
              netPnl: bigint;
              netPnlPercent: bigint;
              pnlAccumulations: RealizedAccumulations;
              positionId: bigint;
              side: PositionSide;
              startCollateral: bigint;
              startPrice: bigint;
              startSize: bigint;
              startTransactionHash: null | string;
              startVersion: bigint;
              totalFees: bigint;
              totalNotional: bigint;
              totalPnl: bigint;
              trades: bigint;
          } & {
              pendingMarkToMarketAccumulations: null | RealizedAccumulations;
              realtime: bigint;
              realtimePercent: bigint;
          }>>
        • Parameters

          • args: OmitBound<{
                address: `0x${string}`;
                chainId: 1424 | 42161 | 60850 | 421614;
                graphClient: GraphQLClient;
                markToMarket?: boolean;
                marketOracles?: SupportedMarketMapping<{
                    commitmentGasOracle: `0x${string}`;
                    id: `0x${string}`;
                    market: SupportedMarket;
                    marketAddress: `0x${string}`;
                    maxSettlementFee: bigint;
                    minValidTime: bigint;
                    oracleAddress: `0x${string}`;
                    oracleFactoryAddress: `0x${string}`;
                    oracleName: string;
                    settlementGasOracle: `0x${string}`;
                    staleAfter: bigint;
                    subOracleAddress: `0x${string}`;
                    subOracleFactoryAddress: `0x${string}`;
                    subOracleFactoryType: string;
                    underlyingId: `0x${string}`;
                }>;
                marketSnapshots?: {
                    blockNumber: bigint;
                    commitments: readonly `0x${string}`[];
                    market: {
                        aero: undefined | MarketSnapshot;
                        arb: undefined | MarketSnapshot;
                        bnb: undefined | MarketSnapshot;
                        btc: undefined | MarketSnapshot;
                        btc²: undefined | MarketSnapshot;
                        doge: undefined | MarketSnapshot;
                        eth: undefined | MarketSnapshot;
                        eth²: undefined | MarketSnapshot;
                        eur: undefined | MarketSnapshot;
                        gbp: undefined | MarketSnapshot;
                        jpy: undefined | MarketSnapshot;
                        jup: undefined | MarketSnapshot;
                        link: undefined | MarketSnapshot;
                        meem: undefined | MarketSnapshot;
                        mkr: undefined | MarketSnapshot;
                        mog: undefined | MarketSnapshot;
                        pol: undefined | MarketSnapshot;
                        popcat: undefined | MarketSnapshot;
                        rlb: undefined | MarketSnapshot;
                        sol: undefined | MarketSnapshot;
                        tia: undefined | MarketSnapshot;
                        unknown: undefined | MarketSnapshot;
                        xau: undefined | MarketSnapshot;
                        xrp: undefined | MarketSnapshot;
                    };
                    updates: readonly `0x${string}`[];
                    user: undefined | SupportedMarketMapping<UserMarketSnapshot>;
                };
                markets: SupportedMarket[];
                minBlock?: number;
                oracleClients: OracleClients;
                publicClient: {
                    account: undefined;
                    batch?: {
                        multicall?: boolean | {
                            batchSize?: (...) | (...);
                            wait?: (...) | (...);
                        };
                    };
                    cacheTime: number;
                    call: ((parameters) => Promise<CallReturnType>);
                    ccipRead?: false | {
                        request?: ((parameters) => Promise<(...)>);
                    };
                    chain: undefined | Chain;
                    createBlockFilter: (() => Promise<{
                        id: `0x${string}`;
                        request: EIP1193RequestFn<readonly [(...), (...), (...)]>;
                        type: "block";
                    }>);
                    createContractEventFilter: (<const TAbi, TEventName, TArgs, TStrict, TFromBlock, TToBlock>(args) => Promise<CreateContractEventFilterReturnType<TAbi, TEventName, TArgs, TStrict, TFromBlock, TToBlock>>);
                    createEventFilter: (<const TAbiEvent, const TAbiEvents, TStrict, TFromBlock, TToBlock, _EventName, _Args>(args?) => Promise<{
                        [K in string | number | symbol]: Filter<(...), (...), (...), (...), (...), (...), (...)>[K]
                    }>);
                    createPendingTransactionFilter: (() => Promise<{
                        id: `0x${string}`;
                        request: EIP1193RequestFn<readonly [(...), (...), (...)]>;
                        type: "transaction";
                    }>);
                    estimateContractGas: (<TChain, const abi, functionName, args>(args) => Promise<bigint>);
                    estimateFeesPerGas: (<TChainOverride, TType>(args?) => Promise<EstimateFeesPerGasReturnType>);
                    estimateGas: ((args) => Promise<bigint>);
                    estimateMaxPriorityFeePerGas: (<TChainOverride>(args?) => Promise<bigint>);
                    extend: (<const client>(fn) => Client<Transport, undefined | Chain, undefined, PublicRpcSchema, {
                        [K in (...) | (...) | (...)]: (...)[(...)]
                    } & PublicActions<Transport, (...) | (...)>>);
                    getBalance: ((args) => Promise<bigint>);
                    getBlobBaseFee: (() => Promise<bigint>);
                    getBlock: (<TIncludeTransactions, TBlockTag>(args?) => Promise<{
                        baseFeePerGas: null | bigint;
                        blobGasUsed: bigint;
                        difficulty: bigint;
                        excessBlobGas: bigint;
                        extraData: `0x${string}`;
                        gasLimit: bigint;
                        gasUsed: bigint;
                        hash: TBlockTag extends "pending"
                            ? null
                            : `0x${(...)}`;
                        logsBloom: TBlockTag extends "pending"
                            ? null
                            : `0x${(...)}`;
                        miner: `0x${string}`;
                        mixHash: `0x${string}`;
                        nonce: TBlockTag extends "pending"
                            ? null
                            : `0x${(...)}`;
                        number: TBlockTag extends "pending"
                            ? null
                            : bigint;
                        parentHash: `0x${string}`;
                        receiptsRoot: `0x${string}`;
                        sealFields: `0x${(...)}`[];
                        sha3Uncles: `0x${string}`;
                        size: bigint;
                        stateRoot: `0x${string}`;
                        timestamp: bigint;
                        totalDifficulty: null | bigint;
                        transactions: TIncludeTransactions extends true
                            ? (...)[]
                            : (...)[];
                        transactionsRoot: `0x${string}`;
                        uncles: `0x${(...)}`[];
                        withdrawals?: (...)[];
                        withdrawalsRoot?: `0x${(...)}`;
                    }>);
                    getBlockNumber: ((args?) => Promise<bigint>);
                    getBlockTransactionCount: ((args?) => Promise<number>);
                    getBytecode: ((args) => Promise<GetBytecodeReturnType>);
                    getChainId: (() => Promise<number>);
                    getContractEvents: (<const abi, eventName, strict, fromBlock, toBlock>(args) => Promise<GetContractEventsReturnType<abi, eventName, strict, fromBlock, toBlock>>);
                    getEnsAddress: ((args) => Promise<GetEnsAddressReturnType>);
                    getEnsAvatar: ((args) => Promise<GetEnsAvatarReturnType>);
                    getEnsName: ((args) => Promise<GetEnsNameReturnType>);
                    getEnsResolver: ((args) => Promise<`0x${string}`>);
                    getEnsText: ((args) => Promise<GetEnsTextReturnType>);
                    getFeeHistory: ((args) => Promise<GetFeeHistoryReturnType>);
                    getFilterChanges: (<TFilterType, const TAbi, TEventName, TStrict, TFromBlock, TToBlock>(args) => Promise<GetFilterChangesReturnType<TFilterType, TAbi, TEventName, TStrict, TFromBlock, TToBlock>>);
                    getFilterLogs: (<const TAbi, TEventName, TStrict, TFromBlock, TToBlock>(args) => Promise<GetFilterLogsReturnType<TAbi, TEventName, TStrict, TFromBlock, TToBlock>>);
                    getGasPrice: (() => Promise<bigint>);
                    getLogs: (<const TAbiEvent, const TAbiEvents, TStrict, TFromBlock, TToBlock>(args?) => Promise<GetLogsReturnType<TAbiEvent, TAbiEvents, TStrict, TFromBlock, TToBlock>>);
                    getProof: ((args) => Promise<GetProofReturnType>);
                    getStorageAt: ((args) => Promise<GetStorageAtReturnType>);
                    getTransaction: (<TBlockTag>(args) => Promise<{
                        accessList?: undefined;
                        blobVersionedHashes?: undefined;
                        blockHash: (...) extends (...)
                            ? (...)
                            : (...);
                        blockNumber: (...) extends (...)
                            ? (...)
                            : (...);
                        chainId?: (...) | (...);
                        from: `0x${(...)}`;
                        gas: bigint;
                        gasPrice: bigint;
                        hash: `0x${(...)}`;
                        input: `0x${(...)}`;
                        maxFeePerBlobGas?: undefined;
                        maxFeePerGas?: undefined;
                        maxPriorityFeePerGas?: undefined;
                        nonce: number;
                        r: `0x${(...)}`;
                        s: `0x${(...)}`;
                        to: (...) | (...);
                        transactionIndex: (...) extends (...)
                            ? (...)
                            : (...);
                        type: "legacy";
                        typeHex: (...) | (...);
                        v: bigint;
                        value: bigint;
                        yParity?: undefined;
                    } | {
                        accessList: AccessList;
                        blobVersionedHashes?: undefined;
                        blockHash: (...) extends (...)
                            ? (...)
                            : (...);
                        blockNumber: (...) extends (...)
                            ? (...)
                            : (...);
                        chainId: number;
                        from: `0x${(...)}`;
                        gas: bigint;
                        gasPrice: bigint;
                        hash: `0x${(...)}`;
                        input: `0x${(...)}`;
                        maxFeePerBlobGas?: undefined;
                        maxFeePerGas?: undefined;
                        maxPriorityFeePerGas?: undefined;
                        nonce: number;
                        r: `0x${(...)}`;
                        s: `0x${(...)}`;
                        to: (...) | (...);
                        transactionIndex: (...) extends (...)
                            ? (...)
                            : (...);
                        type: "eip2930";
                        typeHex: (...) | (...);
                        v: bigint;
                        value: bigint;
                        yParity: number;
                    } | {
                        accessList: AccessList;
                        blobVersionedHashes?: undefined;
                        blockHash: (...) extends (...)
                            ? (...)
                            : (...);
                        blockNumber: (...) extends (...)
                            ? (...)
                            : (...);
                        chainId: number;
                        from: `0x${(...)}`;
                        gas: bigint;
                        gasPrice?: undefined;
                        hash: `0x${(...)}`;
                        input: `0x${(...)}`;
                        maxFeePerBlobGas?: undefined;
                        maxFeePerGas: bigint;
                        maxPriorityFeePerGas: bigint;
                        nonce: number;
                        r: `0x${(...)}`;
                        s: `0x${(...)}`;
                        to: (...) | (...);
                        transactionIndex: (...) extends (...)
                            ? (...)
                            : (...);
                        type: "eip1559";
                        typeHex: (...) | (...);
                        v: bigint;
                        value: bigint;
                        yParity: number;
                    } | {
                        accessList: AccessList;
                        blobVersionedHashes: (...)[];
                        blockHash: (...) extends (...)
                            ? (...)
                            : (...);
                        blockNumber: (...) extends (...)
                            ? (...)
                            : (...);
                        chainId: number;
                        from: `0x${(...)}`;
                        gas: bigint;
                        gasPrice?: undefined;
                        hash: `0x${(...)}`;
                        input: `0x${(...)}`;
                        maxFeePerBlobGas: bigint;
                        maxFeePerGas: bigint;
                        maxPriorityFeePerGas: bigint;
                        nonce: number;
                        r: `0x${(...)}`;
                        s: `0x${(...)}`;
                        to: (...) | (...);
                        transactionIndex: (...) extends (...)
                            ? (...)
                            : (...);
                        type: "eip4844";
                        typeHex: (...) | (...);
                        v: bigint;
                        value: bigint;
                        yParity: number;
                    }>);
                    getTransactionConfirmations: ((args) => Promise<bigint>);
                    getTransactionCount: ((args) => Promise<number>);
                    getTransactionReceipt: ((args) => Promise<TransactionReceipt>);
                    key: string;
                    multicall: (<const contracts, allowFailure>(args) => Promise<MulticallReturnType<contracts, allowFailure>>);
                    name: string;
                    pollingInterval: number;
                    prepareTransactionRequest: (<const TRequest, TChainOverride, TAccountOverride>(args) => Promise<{
                        [K in string | number | symbol]: ((...) & (...))[K]
                    }>);
                    readContract: (<const abi, functionName, args>(args) => Promise<ReadContractReturnType<abi, functionName, args>>);
                    request: EIP1193RequestFn<PublicRpcSchema>;
                    sendRawTransaction: ((args) => Promise<`0x${string}`>);
                    simulateContract: (<const abi, functionName, args, chainOverride, accountOverride>(args) => Promise<SimulateContractReturnType<abi, functionName, args, undefined | Chain, undefined | Account, chainOverride, accountOverride>>);
                    transport: TransportConfig<string, EIP1193RequestFn> & Record<string, any>;
                    type: string;
                    uid: string;
                    uninstallFilter: ((args) => Promise<boolean>);
                    verifyMessage: ((args) => Promise<boolean>);
                    verifyTypedData: ((args) => Promise<boolean>);
                    waitForTransactionReceipt: ((args) => Promise<TransactionReceipt>);
                    watchBlockNumber: ((args) => WatchBlockNumberReturnType);
                    watchBlocks: (<TIncludeTransactions, TBlockTag>(args) => WatchBlocksReturnType);
                    watchContractEvent: (<const TAbi, TEventName, TStrict>(args) => WatchContractEventReturnType);
                    watchEvent: (<const TAbiEvent, const TAbiEvents, TStrict>(args) => WatchEventReturnType);
                    watchPendingTransactions: ((args) => WatchPendingTransactionsReturnType);
                };
            }> & OptionalAddress & OptionalMarkets = {}

          Returns Promise<SupportedMarketMapping<{
              averageEntryPrice: bigint;
              averageExitPrice: bigint;
              endVersion: null | bigint;
              feeAccumulations: RealizedFeeAccumulations;
              liquidation: boolean;
              liquidationFee: bigint;
              market: SupportedMarket;
              marketAddress: `0x${string}`;
              netDeposits: bigint;
              netPnl: bigint;
              netPnlPercent: bigint;
              pnlAccumulations: RealizedAccumulations;
              positionId: bigint;
              side: PositionSide;
              startCollateral: bigint;
              startPrice: bigint;
              startSize: bigint;
              startTransactionHash: null | string;
              startVersion: bigint;
              totalFees: bigint;
              totalNotional: bigint;
              totalPnl: bigint;
              trades: bigint;
          } & {
              pendingMarkToMarketAccumulations: null | RealizedAccumulations;
              realtime: bigint;
              realtimePercent: bigint;
          }>>

    • historicalPositions: ((args?) => Promise<{
          averageEntryPrice: bigint;
          averageExitPrice: bigint;
          endVersion: null | bigint;
          feeAccumulations: RealizedFeeAccumulations;
          liquidation: boolean;
          liquidationFee: bigint;
          market: SupportedMarket;
          marketAddress: `0x${string}`;
          netDeposits: bigint;
          netPnl: bigint;
          netPnlPercent: bigint;
          pnlAccumulations: RealizedAccumulations;
          positionId: bigint;
          side: PositionSide;
          startCollateral: bigint;
          startPrice: bigint;
          startSize: bigint;
          startTransactionHash: null | string;
          startVersion: bigint;
          totalFees: bigint;
          totalNotional: bigint;
          totalPnl: bigint;
          trades: bigint;
      }[]>)

      Fetches the position history for a given address

      Returns

      User's position history.

        • (args?): Promise<{
              averageEntryPrice: bigint;
              averageExitPrice: bigint;
              endVersion: null | bigint;
              feeAccumulations: RealizedFeeAccumulations;
              liquidation: boolean;
              liquidationFee: bigint;
              market: SupportedMarket;
              marketAddress: `0x${string}`;
              netDeposits: bigint;
              netPnl: bigint;
              netPnlPercent: bigint;
              pnlAccumulations: RealizedAccumulations;
              positionId: bigint;
              side: PositionSide;
              startCollateral: bigint;
              startPrice: bigint;
              startSize: bigint;
              startTransactionHash: null | string;
              startVersion: bigint;
              totalFees: bigint;
              totalNotional: bigint;
              totalPnl: bigint;
              trades: bigint;
          }[]>
        • Parameters

          • args: OmitBound<{
                address: `0x${string}`;
                chainId: 1424 | 42161 | 60850 | 421614;
                first?: number;
                fromTs?: bigint;
                graphClient: GraphQLClient;
                maker?: boolean;
                markets: SupportedMarket[];
                minBlock?: number;
                skip?: number;
                toTs?: bigint;
            }> & OptionalAddress & OptionalMarkets = {}

          Returns Promise<{
              averageEntryPrice: bigint;
              averageExitPrice: bigint;
              endVersion: null | bigint;
              feeAccumulations: RealizedFeeAccumulations;
              liquidation: boolean;
              liquidationFee: bigint;
              market: SupportedMarket;
              marketAddress: `0x${string}`;
              netDeposits: bigint;
              netPnl: bigint;
              netPnlPercent: bigint;
              pnlAccumulations: RealizedAccumulations;
              positionId: bigint;
              side: PositionSide;
              startCollateral: bigint;
              startPrice: bigint;
              startSize: bigint;
              startTransactionHash: null | string;
              startVersion: bigint;
              totalFees: bigint;
              totalNotional: bigint;
              totalPnl: bigint;
              trades: bigint;
          }[]>

    • marketOracles: (() => Promise<SupportedMarketMapping<{
          commitmentGasOracle: `0x${string}`;
          id: `0x${string}`;
          market: SupportedMarket;
          marketAddress: `0x${string}`;
          maxSettlementFee: bigint;
          minValidTime: bigint;
          oracleAddress: `0x${string}`;
          oracleFactoryAddress: `0x${string}`;
          oracleName: string;
          settlementGasOracle: `0x${string}`;
          staleAfter: bigint;
          subOracleAddress: `0x${string}`;
          subOracleFactoryAddress: `0x${string}`;
          subOracleFactoryType: string;
          underlyingId: `0x${string}`;
      }>>)

      Fetches the MarketOracles

      Returns

      The MarketOracles.

        • (): Promise<SupportedMarketMapping<{
              commitmentGasOracle: `0x${string}`;
              id: `0x${string}`;
              market: SupportedMarket;
              marketAddress: `0x${string}`;
              maxSettlementFee: bigint;
              minValidTime: bigint;
              oracleAddress: `0x${string}`;
              oracleFactoryAddress: `0x${string}`;
              oracleName: string;
              settlementGasOracle: `0x${string}`;
              staleAfter: bigint;
              subOracleAddress: `0x${string}`;
              subOracleFactoryAddress: `0x${string}`;
              subOracleFactoryType: string;
              underlyingId: `0x${string}`;
          }>>
        • Returns Promise<SupportedMarketMapping<{
              commitmentGasOracle: `0x${string}`;
              id: `0x${string}`;
              market: SupportedMarket;
              marketAddress: `0x${string}`;
              maxSettlementFee: bigint;
              minValidTime: bigint;
              oracleAddress: `0x${string}`;
              oracleFactoryAddress: `0x${string}`;
              oracleName: string;
              settlementGasOracle: `0x${string}`;
              staleAfter: bigint;
              subOracleAddress: `0x${string}`;
              subOracleFactoryAddress: `0x${string}`;
              subOracleFactoryType: string;
              underlyingId: `0x${string}`;
          }>>

    • marketSnapshots: ((args?) => Promise<{
          blockNumber: bigint;
          commitments: readonly `0x${string}`[];
          market: {
              aero: undefined | MarketSnapshot;
              arb: undefined | MarketSnapshot;
              bnb: undefined | MarketSnapshot;
              btc: undefined | MarketSnapshot;
              btc²: undefined | MarketSnapshot;
              doge: undefined | MarketSnapshot;
              eth: undefined | MarketSnapshot;
              eth²: undefined | MarketSnapshot;
              eur: undefined | MarketSnapshot;
              gbp: undefined | MarketSnapshot;
              jpy: undefined | MarketSnapshot;
              jup: undefined | MarketSnapshot;
              link: undefined | MarketSnapshot;
              meem: undefined | MarketSnapshot;
              mkr: undefined | MarketSnapshot;
              mog: undefined | MarketSnapshot;
              pol: undefined | MarketSnapshot;
              popcat: undefined | MarketSnapshot;
              rlb: undefined | MarketSnapshot;
              sol: undefined | MarketSnapshot;
              tia: undefined | MarketSnapshot;
              unknown: undefined | MarketSnapshot;
              xau: undefined | MarketSnapshot;
              xrp: undefined | MarketSnapshot;
          };
          updates: readonly `0x${string}`[];
          user: undefined | SupportedMarketMapping<UserMarketSnapshot>;
      }>)

      Fetches the MarketSnapshots

      Returns

      The MarketSnapshots.

        • (args?): Promise<{
              blockNumber: bigint;
              commitments: readonly `0x${string}`[];
              market: {
                  aero: undefined | MarketSnapshot;
                  arb: undefined | MarketSnapshot;
                  bnb: undefined | MarketSnapshot;
                  btc: undefined | MarketSnapshot;
                  btc²: undefined | MarketSnapshot;
                  doge: undefined | MarketSnapshot;
                  eth: undefined | MarketSnapshot;
                  eth²: undefined | MarketSnapshot;
                  eur: undefined | MarketSnapshot;
                  gbp: undefined | MarketSnapshot;
                  jpy: undefined | MarketSnapshot;
                  jup: undefined | MarketSnapshot;
                  link: undefined | MarketSnapshot;
                  meem: undefined | MarketSnapshot;
                  mkr: undefined | MarketSnapshot;
                  mog: undefined | MarketSnapshot;
                  pol: undefined | MarketSnapshot;
                  popcat: undefined | MarketSnapshot;
                  rlb: undefined | MarketSnapshot;
                  sol: undefined | MarketSnapshot;
                  tia: undefined | MarketSnapshot;
                  unknown: undefined | MarketSnapshot;
                  xau: undefined | MarketSnapshot;
                  xrp: undefined | MarketSnapshot;
              };
              updates: readonly `0x${string}`[];
              user: undefined | SupportedMarketMapping<UserMarketSnapshot>;
          }>
        • Parameters

          • args: OmitBound<{
                address: `0x${string}`;
                chainId: 1424 | 42161 | 60850 | 421614;
                marketOracles?: SupportedMarketMapping<{
                    commitmentGasOracle: `0x${string}`;
                    id: `0x${string}`;
                    market: SupportedMarket;
                    marketAddress: `0x${string}`;
                    maxSettlementFee: bigint;
                    minValidTime: bigint;
                    oracleAddress: `0x${string}`;
                    oracleFactoryAddress: `0x${string}`;
                    oracleName: string;
                    settlementGasOracle: `0x${string}`;
                    staleAfter: bigint;
                    subOracleAddress: `0x${string}`;
                    subOracleFactoryAddress: `0x${string}`;
                    subOracleFactoryType: string;
                    underlyingId: `0x${string}`;
                }>;
                markets?: SupportedMarket[];
                onError?: (() => void);
                onSuccess?: (() => void);
                oracleClients: OracleClients;
                publicClient: {
                    account: undefined;
                    batch?: {
                        multicall?: boolean | {
                            batchSize?: (...) | (...);
                            wait?: (...) | (...);
                        };
                    };
                    cacheTime: number;
                    call: ((parameters) => Promise<CallReturnType>);
                    ccipRead?: false | {
                        request?: ((parameters) => Promise<(...)>);
                    };
                    chain: undefined | Chain;
                    createBlockFilter: (() => Promise<{
                        id: `0x${string}`;
                        request: EIP1193RequestFn<readonly [(...), (...), (...)]>;
                        type: "block";
                    }>);
                    createContractEventFilter: (<const TAbi, TEventName, TArgs, TStrict, TFromBlock, TToBlock>(args) => Promise<CreateContractEventFilterReturnType<TAbi, TEventName, TArgs, TStrict, TFromBlock, TToBlock>>);
                    createEventFilter: (<const TAbiEvent, const TAbiEvents, TStrict, TFromBlock, TToBlock, _EventName, _Args>(args?) => Promise<{
                        [K in string | number | symbol]: Filter<(...), (...), (...), (...), (...), (...), (...)>[K]
                    }>);
                    createPendingTransactionFilter: (() => Promise<{
                        id: `0x${string}`;
                        request: EIP1193RequestFn<readonly [(...), (...), (...)]>;
                        type: "transaction";
                    }>);
                    estimateContractGas: (<TChain, const abi, functionName, args>(args) => Promise<bigint>);
                    estimateFeesPerGas: (<TChainOverride, TType>(args?) => Promise<EstimateFeesPerGasReturnType>);
                    estimateGas: ((args) => Promise<bigint>);
                    estimateMaxPriorityFeePerGas: (<TChainOverride>(args?) => Promise<bigint>);
                    extend: (<const client>(fn) => Client<Transport, undefined | Chain, undefined, PublicRpcSchema, {
                        [K in (...) | (...) | (...)]: (...)[(...)]
                    } & PublicActions<Transport, (...) | (...)>>);
                    getBalance: ((args) => Promise<bigint>);
                    getBlobBaseFee: (() => Promise<bigint>);
                    getBlock: (<TIncludeTransactions, TBlockTag>(args?) => Promise<{
                        baseFeePerGas: null | bigint;
                        blobGasUsed: bigint;
                        difficulty: bigint;
                        excessBlobGas: bigint;
                        extraData: `0x${string}`;
                        gasLimit: bigint;
                        gasUsed: bigint;
                        hash: TBlockTag extends "pending"
                            ? null
                            : `0x${(...)}`;
                        logsBloom: TBlockTag extends "pending"
                            ? null
                            : `0x${(...)}`;
                        miner: `0x${string}`;
                        mixHash: `0x${string}`;
                        nonce: TBlockTag extends "pending"
                            ? null
                            : `0x${(...)}`;
                        number: TBlockTag extends "pending"
                            ? null
                            : bigint;
                        parentHash: `0x${string}`;
                        receiptsRoot: `0x${string}`;
                        sealFields: `0x${(...)}`[];
                        sha3Uncles: `0x${string}`;
                        size: bigint;
                        stateRoot: `0x${string}`;
                        timestamp: bigint;
                        totalDifficulty: null | bigint;
                        transactions: TIncludeTransactions extends true
                            ? (...)[]
                            : (...)[];
                        transactionsRoot: `0x${string}`;
                        uncles: `0x${(...)}`[];
                        withdrawals?: (...)[];
                        withdrawalsRoot?: `0x${(...)}`;
                    }>);
                    getBlockNumber: ((args?) => Promise<bigint>);
                    getBlockTransactionCount: ((args?) => Promise<number>);
                    getBytecode: ((args) => Promise<GetBytecodeReturnType>);
                    getChainId: (() => Promise<number>);
                    getContractEvents: (<const abi, eventName, strict, fromBlock, toBlock>(args) => Promise<GetContractEventsReturnType<abi, eventName, strict, fromBlock, toBlock>>);
                    getEnsAddress: ((args) => Promise<GetEnsAddressReturnType>);
                    getEnsAvatar: ((args) => Promise<GetEnsAvatarReturnType>);
                    getEnsName: ((args) => Promise<GetEnsNameReturnType>);
                    getEnsResolver: ((args) => Promise<`0x${string}`>);
                    getEnsText: ((args) => Promise<GetEnsTextReturnType>);
                    getFeeHistory: ((args) => Promise<GetFeeHistoryReturnType>);
                    getFilterChanges: (<TFilterType, const TAbi, TEventName, TStrict, TFromBlock, TToBlock>(args) => Promise<GetFilterChangesReturnType<TFilterType, TAbi, TEventName, TStrict, TFromBlock, TToBlock>>);
                    getFilterLogs: (<const TAbi, TEventName, TStrict, TFromBlock, TToBlock>(args) => Promise<GetFilterLogsReturnType<TAbi, TEventName, TStrict, TFromBlock, TToBlock>>);
                    getGasPrice: (() => Promise<bigint>);
                    getLogs: (<const TAbiEvent, const TAbiEvents, TStrict, TFromBlock, TToBlock>(args?) => Promise<GetLogsReturnType<TAbiEvent, TAbiEvents, TStrict, TFromBlock, TToBlock>>);
                    getProof: ((args) => Promise<GetProofReturnType>);
                    getStorageAt: ((args) => Promise<GetStorageAtReturnType>);
                    getTransaction: (<TBlockTag>(args) => Promise<{
                        accessList?: undefined;
                        blobVersionedHashes?: undefined;
                        blockHash: (...) extends (...)
                            ? (...)
                            : (...);
                        blockNumber: (...) extends (...)
                            ? (...)
                            : (...);
                        chainId?: (...) | (...);
                        from: `0x${(...)}`;
                        gas: bigint;
                        gasPrice: bigint;
                        hash: `0x${(...)}`;
                        input: `0x${(...)}`;
                        maxFeePerBlobGas?: undefined;
                        maxFeePerGas?: undefined;
                        maxPriorityFeePerGas?: undefined;
                        nonce: number;
                        r: `0x${(...)}`;
                        s: `0x${(...)}`;
                        to: (...) | (...);
                        transactionIndex: (...) extends (...)
                            ? (...)
                            : (...);
                        type: "legacy";
                        typeHex: (...) | (...);
                        v: bigint;
                        value: bigint;
                        yParity?: undefined;
                    } | {
                        accessList: AccessList;
                        blobVersionedHashes?: undefined;
                        blockHash: (...) extends (...)
                            ? (...)
                            : (...);
                        blockNumber: (...) extends (...)
                            ? (...)
                            : (...);
                        chainId: number;
                        from: `0x${(...)}`;
                        gas: bigint;
                        gasPrice: bigint;
                        hash: `0x${(...)}`;
                        input: `0x${(...)}`;
                        maxFeePerBlobGas?: undefined;
                        maxFeePerGas?: undefined;
                        maxPriorityFeePerGas?: undefined;
                        nonce: number;
                        r: `0x${(...)}`;
                        s: `0x${(...)}`;
                        to: (...) | (...);
                        transactionIndex: (...) extends (...)
                            ? (...)
                            : (...);
                        type: "eip2930";
                        typeHex: (...) | (...);
                        v: bigint;
                        value: bigint;
                        yParity: number;
                    } | {
                        accessList: AccessList;
                        blobVersionedHashes?: undefined;
                        blockHash: (...) extends (...)
                            ? (...)
                            : (...);
                        blockNumber: (...) extends (...)
                            ? (...)
                            : (...);
                        chainId: number;
                        from: `0x${(...)}`;
                        gas: bigint;
                        gasPrice?: undefined;
                        hash: `0x${(...)}`;
                        input: `0x${(...)}`;
                        maxFeePerBlobGas?: undefined;
                        maxFeePerGas: bigint;
                        maxPriorityFeePerGas: bigint;
                        nonce: number;
                        r: `0x${(...)}`;
                        s: `0x${(...)}`;
                        to: (...) | (...);
                        transactionIndex: (...) extends (...)
                            ? (...)
                            : (...);
                        type: "eip1559";
                        typeHex: (...) | (...);
                        v: bigint;
                        value: bigint;
                        yParity: number;
                    } | {
                        accessList: AccessList;
                        blobVersionedHashes: (...)[];
                        blockHash: (...) extends (...)
                            ? (...)
                            : (...);
                        blockNumber: (...) extends (...)
                            ? (...)
                            : (...);
                        chainId: number;
                        from: `0x${(...)}`;
                        gas: bigint;
                        gasPrice?: undefined;
                        hash: `0x${(...)}`;
                        input: `0x${(...)}`;
                        maxFeePerBlobGas: bigint;
                        maxFeePerGas: bigint;
                        maxPriorityFeePerGas: bigint;
                        nonce: number;
                        r: `0x${(...)}`;
                        s: `0x${(...)}`;
                        to: (...) | (...);
                        transactionIndex: (...) extends (...)
                            ? (...)
                            : (...);
                        type: "eip4844";
                        typeHex: (...) | (...);
                        v: bigint;
                        value: bigint;
                        yParity: number;
                    }>);
                    getTransactionConfirmations: ((args) => Promise<bigint>);
                    getTransactionCount: ((args) => Promise<number>);
                    getTransactionReceipt: ((args) => Promise<TransactionReceipt>);
                    key: string;
                    multicall: (<const contracts, allowFailure>(args) => Promise<MulticallReturnType<contracts, allowFailure>>);
                    name: string;
                    pollingInterval: number;
                    prepareTransactionRequest: (<const TRequest, TChainOverride, TAccountOverride>(args) => Promise<{
                        [K in string | number | symbol]: ((...) & (...))[K]
                    }>);
                    readContract: (<const abi, functionName, args>(args) => Promise<ReadContractReturnType<abi, functionName, args>>);
                    request: EIP1193RequestFn<PublicRpcSchema>;
                    sendRawTransaction: ((args) => Promise<`0x${string}`>);
                    simulateContract: (<const abi, functionName, args, chainOverride, accountOverride>(args) => Promise<SimulateContractReturnType<abi, functionName, args, undefined | Chain, undefined | Account, chainOverride, accountOverride>>);
                    transport: TransportConfig<string, EIP1193RequestFn> & Record<string, any>;
                    type: string;
                    uid: string;
                    uninstallFilter: ((args) => Promise<boolean>);
                    verifyMessage: ((args) => Promise<boolean>);
                    verifyTypedData: ((args) => Promise<boolean>);
                    waitForTransactionReceipt: ((args) => Promise<TransactionReceipt>);
                    watchBlockNumber: ((args) => WatchBlockNumberReturnType);
                    watchBlocks: (<TIncludeTransactions, TBlockTag>(args) => WatchBlocksReturnType);
                    watchContractEvent: (<const TAbi, TEventName, TStrict>(args) => WatchContractEventReturnType);
                    watchEvent: (<const TAbiEvent, const TAbiEvents, TStrict>(args) => WatchEventReturnType);
                    watchPendingTransactions: ((args) => WatchPendingTransactionsReturnType);
                };
            }> & OptionalAddress & OptionalMarkets = {}

          Returns Promise<{
              blockNumber: bigint;
              commitments: readonly `0x${string}`[];
              market: {
                  aero: undefined | MarketSnapshot;
                  arb: undefined | MarketSnapshot;
                  bnb: undefined | MarketSnapshot;
                  btc: undefined | MarketSnapshot;
                  btc²: undefined | MarketSnapshot;
                  doge: undefined | MarketSnapshot;
                  eth: undefined | MarketSnapshot;
                  eth²: undefined | MarketSnapshot;
                  eur: undefined | MarketSnapshot;
                  gbp: undefined | MarketSnapshot;
                  jpy: undefined | MarketSnapshot;
                  jup: undefined | MarketSnapshot;
                  link: undefined | MarketSnapshot;
                  meem: undefined | MarketSnapshot;
                  mkr: undefined | MarketSnapshot;
                  mog: undefined | MarketSnapshot;
                  pol: undefined | MarketSnapshot;
                  popcat: undefined | MarketSnapshot;
                  rlb: undefined | MarketSnapshot;
                  sol: undefined | MarketSnapshot;
                  tia: undefined | MarketSnapshot;
                  unknown: undefined | MarketSnapshot;
                  xau: undefined | MarketSnapshot;
                  xrp: undefined | MarketSnapshot;
              };
              updates: readonly `0x${string}`[];
              user: undefined | SupportedMarketMapping<UserMarketSnapshot>;
          }>

    • markets24hrData: ((args?) => Promise<SupportedMarketMapping<{
          address: `0x${string}`;
          fundingRates: {
              longAPR: bigint;
              makerAPR: bigint;
              shortAPR: bigint;
              timestamp: string;
          }[];
          interestRates: {
              longAPR: bigint;
              makerAPR: bigint;
              shortAPR: bigint;
              timestamp: string;
          }[];
          makerAccumulation: {
              exposure: bigint;
              funding: bigint;
              interest: bigint;
              positionFee: bigint;
          };
          market: SupportedMarket;
          takerVolumes: {
              longNotional: bigint;
              shortNotional: bigint;
              timestamp: string;
          }[];
      }>>)

      Fetches the 24hr volume data for a list of market

      Returns

      Markets 24hr volume data.

        • (args?): Promise<SupportedMarketMapping<{
              address: `0x${string}`;
              fundingRates: {
                  longAPR: bigint;
                  makerAPR: bigint;
                  shortAPR: bigint;
                  timestamp: string;
              }[];
              interestRates: {
                  longAPR: bigint;
                  makerAPR: bigint;
                  shortAPR: bigint;
                  timestamp: string;
              }[];
              makerAccumulation: {
                  exposure: bigint;
                  funding: bigint;
                  interest: bigint;
                  positionFee: bigint;
              };
              market: SupportedMarket;
              takerVolumes: {
                  longNotional: bigint;
                  shortNotional: bigint;
                  timestamp: string;
              }[];
          }>>
        • Parameters

          Returns Promise<SupportedMarketMapping<{
              address: `0x${string}`;
              fundingRates: {
                  longAPR: bigint;
                  makerAPR: bigint;
                  shortAPR: bigint;
                  timestamp: string;
              }[];
              interestRates: {
                  longAPR: bigint;
                  makerAPR: bigint;
                  shortAPR: bigint;
                  timestamp: string;
              }[];
              makerAccumulation: {
                  exposure: bigint;
                  funding: bigint;
                  interest: bigint;
                  positionFee: bigint;
              };
              market: SupportedMarket;
              takerVolumes: {
                  longNotional: bigint;
                  shortNotional: bigint;
                  timestamp: string;
              }[];
          }>>

    • marketsHistoricalData: ((args) => Promise<SupportedMarketMapping<{
          address: `0x${string}`;
          fundingRates: {
              longAPR: bigint;
              makerAPR: bigint;
              shortAPR: bigint;
              timestamp: string;
          }[];
          interestRates: {
              longAPR: bigint;
              makerAPR: bigint;
              shortAPR: bigint;
              timestamp: string;
          }[];
          makerAccumulation: {
              exposure: bigint;
              funding: bigint;
              interest: bigint;
              positionFee: bigint;
          };
          market: SupportedMarket;
          takerVolumes: {
              longNotional: bigint;
              shortNotional: bigint;
              timestamp: string;
          }[];
      }>>)

      Fetches Historical data for markets

      Returns

      Market 7d data.

        • (args): Promise<SupportedMarketMapping<{
              address: `0x${string}`;
              fundingRates: {
                  longAPR: bigint;
                  makerAPR: bigint;
                  shortAPR: bigint;
                  timestamp: string;
              }[];
              interestRates: {
                  longAPR: bigint;
                  makerAPR: bigint;
                  shortAPR: bigint;
                  timestamp: string;
              }[];
              makerAccumulation: {
                  exposure: bigint;
                  funding: bigint;
                  interest: bigint;
                  positionFee: bigint;
              };
              market: SupportedMarket;
              takerVolumes: {
                  longNotional: bigint;
                  shortNotional: bigint;
                  timestamp: string;
              }[];
          }>>
        • Parameters

          Returns Promise<SupportedMarketMapping<{
              address: `0x${string}`;
              fundingRates: {
                  longAPR: bigint;
                  makerAPR: bigint;
                  shortAPR: bigint;
                  timestamp: string;
              }[];
              interestRates: {
                  longAPR: bigint;
                  makerAPR: bigint;
                  shortAPR: bigint;
                  timestamp: string;
              }[];
              makerAccumulation: {
                  exposure: bigint;
                  funding: bigint;
                  interest: bigint;
                  positionFee: bigint;
              };
              market: SupportedMarket;
              takerVolumes: {
                  longNotional: bigint;
                  shortNotional: bigint;
                  timestamp: string;
              }[];
          }>>

    • openOrders: ((args?) => Promise<{
          account: `0x${string}`;
          associatedOrder?: null | {
              collateral: string;
              depositTotal: string;
              withdrawalTotal: string;
          };
          blockTimestamp: string;
          market: SupportedMarket;
          marketAddress: `0x${string}`;
          nonce: string;
          source: `0x${string}`;
          transactionHash: string;
          triggerOrderComparison: number;
          triggerOrderDelta: string;
          triggerOrderFee: string;
          triggerOrderPrice: string;
          triggerOrderSide: number;
      }[]>)

      Fetches the open orders for a given address

      Returns

      User's open orders.

        • (args?): Promise<{
              account: `0x${string}`;
              associatedOrder?: null | {
                  collateral: string;
                  depositTotal: string;
                  withdrawalTotal: string;
              };
              blockTimestamp: string;
              market: SupportedMarket;
              marketAddress: `0x${string}`;
              nonce: string;
              source: `0x${string}`;
              transactionHash: string;
              triggerOrderComparison: number;
              triggerOrderDelta: string;
              triggerOrderFee: string;
              triggerOrderPrice: string;
              triggerOrderSide: number;
          }[]>
        • Parameters

          Returns Promise<{
              account: `0x${string}`;
              associatedOrder?: null | {
                  collateral: string;
                  depositTotal: string;
                  withdrawalTotal: string;
              };
              blockTimestamp: string;
              market: SupportedMarket;
              marketAddress: `0x${string}`;
              nonce: string;
              source: `0x${string}`;
              transactionHash: string;
              triggerOrderComparison: number;
              triggerOrderDelta: string;
              triggerOrderFee: string;
              triggerOrderPrice: string;
              triggerOrderSide: number;
          }[]>

    • settlementFees: ((args?) => Promise<SupportedMarketMapping<{
          commitmentCost: bigint;
          settlementCost: bigint;
          totalCost: bigint;
      }>>)

      Fetches the market settlement fees for a list of markets

      Returns

      Markets settlement fees.

        • (args?): Promise<SupportedMarketMapping<{
              commitmentCost: bigint;
              settlementCost: bigint;
              totalCost: bigint;
          }>>
        • Parameters

          • args: OmitBound<{
                chainId: 1424 | 42161 | 60850 | 421614;
                marketOracles?: SupportedMarketMapping<{
                    commitmentGasOracle: `0x${string}`;
                    id: `0x${string}`;
                    market: SupportedMarket;
                    marketAddress: `0x${string}`;
                    maxSettlementFee: bigint;
                    minValidTime: bigint;
                    oracleAddress: `0x${string}`;
                    oracleFactoryAddress: `0x${string}`;
                    oracleName: string;
                    settlementGasOracle: `0x${string}`;
                    staleAfter: bigint;
                    subOracleAddress: `0x${string}`;
                    subOracleFactoryAddress: `0x${string}`;
                    subOracleFactoryType: string;
                    underlyingId: `0x${string}`;
                }>;
                markets: SupportedMarket[];
                publicClient: {
                    account: undefined;
                    batch?: {
                        multicall?: boolean | {
                            batchSize?: (...) | (...);
                            wait?: (...) | (...);
                        };
                    };
                    cacheTime: number;
                    call: ((parameters) => Promise<CallReturnType>);
                    ccipRead?: false | {
                        request?: ((parameters) => Promise<(...)>);
                    };
                    chain: undefined | Chain;
                    createBlockFilter: (() => Promise<{
                        id: `0x${string}`;
                        request: EIP1193RequestFn<readonly [(...), (...), (...)]>;
                        type: "block";
                    }>);
                    createContractEventFilter: (<const TAbi, TEventName, TArgs, TStrict, TFromBlock, TToBlock>(args) => Promise<CreateContractEventFilterReturnType<TAbi, TEventName, TArgs, TStrict, TFromBlock, TToBlock>>);
                    createEventFilter: (<const TAbiEvent, const TAbiEvents, TStrict, TFromBlock, TToBlock, _EventName, _Args>(args?) => Promise<{
                        [K in string | number | symbol]: Filter<(...), (...), (...), (...), (...), (...), (...)>[K]
                    }>);
                    createPendingTransactionFilter: (() => Promise<{
                        id: `0x${string}`;
                        request: EIP1193RequestFn<readonly [(...), (...), (...)]>;
                        type: "transaction";
                    }>);
                    estimateContractGas: (<TChain, const abi, functionName, args>(args) => Promise<bigint>);
                    estimateFeesPerGas: (<TChainOverride, TType>(args?) => Promise<EstimateFeesPerGasReturnType>);
                    estimateGas: ((args) => Promise<bigint>);
                    estimateMaxPriorityFeePerGas: (<TChainOverride>(args?) => Promise<bigint>);
                    extend: (<const client>(fn) => Client<Transport, undefined | Chain, undefined, PublicRpcSchema, {
                        [K in (...) | (...) | (...)]: (...)[(...)]
                    } & PublicActions<Transport, (...) | (...)>>);
                    getBalance: ((args) => Promise<bigint>);
                    getBlobBaseFee: (() => Promise<bigint>);
                    getBlock: (<TIncludeTransactions, TBlockTag>(args?) => Promise<{
                        baseFeePerGas: null | bigint;
                        blobGasUsed: bigint;
                        difficulty: bigint;
                        excessBlobGas: bigint;
                        extraData: `0x${string}`;
                        gasLimit: bigint;
                        gasUsed: bigint;
                        hash: TBlockTag extends "pending"
                            ? null
                            : `0x${(...)}`;
                        logsBloom: TBlockTag extends "pending"
                            ? null
                            : `0x${(...)}`;
                        miner: `0x${string}`;
                        mixHash: `0x${string}`;
                        nonce: TBlockTag extends "pending"
                            ? null
                            : `0x${(...)}`;
                        number: TBlockTag extends "pending"
                            ? null
                            : bigint;
                        parentHash: `0x${string}`;
                        receiptsRoot: `0x${string}`;
                        sealFields: `0x${(...)}`[];
                        sha3Uncles: `0x${string}`;
                        size: bigint;
                        stateRoot: `0x${string}`;
                        timestamp: bigint;
                        totalDifficulty: null | bigint;
                        transactions: TIncludeTransactions extends true
                            ? (...)[]
                            : (...)[];
                        transactionsRoot: `0x${string}`;
                        uncles: `0x${(...)}`[];
                        withdrawals?: (...)[];
                        withdrawalsRoot?: `0x${(...)}`;
                    }>);
                    getBlockNumber: ((args?) => Promise<bigint>);
                    getBlockTransactionCount: ((args?) => Promise<number>);
                    getBytecode: ((args) => Promise<GetBytecodeReturnType>);
                    getChainId: (() => Promise<number>);
                    getContractEvents: (<const abi, eventName, strict, fromBlock, toBlock>(args) => Promise<GetContractEventsReturnType<abi, eventName, strict, fromBlock, toBlock>>);
                    getEnsAddress: ((args) => Promise<GetEnsAddressReturnType>);
                    getEnsAvatar: ((args) => Promise<GetEnsAvatarReturnType>);
                    getEnsName: ((args) => Promise<GetEnsNameReturnType>);
                    getEnsResolver: ((args) => Promise<`0x${string}`>);
                    getEnsText: ((args) => Promise<GetEnsTextReturnType>);
                    getFeeHistory: ((args) => Promise<GetFeeHistoryReturnType>);
                    getFilterChanges: (<TFilterType, const TAbi, TEventName, TStrict, TFromBlock, TToBlock>(args) => Promise<GetFilterChangesReturnType<TFilterType, TAbi, TEventName, TStrict, TFromBlock, TToBlock>>);
                    getFilterLogs: (<const TAbi, TEventName, TStrict, TFromBlock, TToBlock>(args) => Promise<GetFilterLogsReturnType<TAbi, TEventName, TStrict, TFromBlock, TToBlock>>);
                    getGasPrice: (() => Promise<bigint>);
                    getLogs: (<const TAbiEvent, const TAbiEvents, TStrict, TFromBlock, TToBlock>(args?) => Promise<GetLogsReturnType<TAbiEvent, TAbiEvents, TStrict, TFromBlock, TToBlock>>);
                    getProof: ((args) => Promise<GetProofReturnType>);
                    getStorageAt: ((args) => Promise<GetStorageAtReturnType>);
                    getTransaction: (<TBlockTag>(args) => Promise<{
                        accessList?: undefined;
                        blobVersionedHashes?: undefined;
                        blockHash: (...) extends (...)
                            ? (...)
                            : (...);
                        blockNumber: (...) extends (...)
                            ? (...)
                            : (...);
                        chainId?: (...) | (...);
                        from: `0x${(...)}`;
                        gas: bigint;
                        gasPrice: bigint;
                        hash: `0x${(...)}`;
                        input: `0x${(...)}`;
                        maxFeePerBlobGas?: undefined;
                        maxFeePerGas?: undefined;
                        maxPriorityFeePerGas?: undefined;
                        nonce: number;
                        r: `0x${(...)}`;
                        s: `0x${(...)}`;
                        to: (...) | (...);
                        transactionIndex: (...) extends (...)
                            ? (...)
                            : (...);
                        type: "legacy";
                        typeHex: (...) | (...);
                        v: bigint;
                        value: bigint;
                        yParity?: undefined;
                    } | {
                        accessList: AccessList;
                        blobVersionedHashes?: undefined;
                        blockHash: (...) extends (...)
                            ? (...)
                            : (...);
                        blockNumber: (...) extends (...)
                            ? (...)
                            : (...);
                        chainId: number;
                        from: `0x${(...)}`;
                        gas: bigint;
                        gasPrice: bigint;
                        hash: `0x${(...)}`;
                        input: `0x${(...)}`;
                        maxFeePerBlobGas?: undefined;
                        maxFeePerGas?: undefined;
                        maxPriorityFeePerGas?: undefined;
                        nonce: number;
                        r: `0x${(...)}`;
                        s: `0x${(...)}`;
                        to: (...) | (...);
                        transactionIndex: (...) extends (...)
                            ? (...)
                            : (...);
                        type: "eip2930";
                        typeHex: (...) | (...);
                        v: bigint;
                        value: bigint;
                        yParity: number;
                    } | {
                        accessList: AccessList;
                        blobVersionedHashes?: undefined;
                        blockHash: (...) extends (...)
                            ? (...)
                            : (...);
                        blockNumber: (...) extends (...)
                            ? (...)
                            : (...);
                        chainId: number;
                        from: `0x${(...)}`;
                        gas: bigint;
                        gasPrice?: undefined;
                        hash: `0x${(...)}`;
                        input: `0x${(...)}`;
                        maxFeePerBlobGas?: undefined;
                        maxFeePerGas: bigint;
                        maxPriorityFeePerGas: bigint;
                        nonce: number;
                        r: `0x${(...)}`;
                        s: `0x${(...)}`;
                        to: (...) | (...);
                        transactionIndex: (...) extends (...)
                            ? (...)
                            : (...);
                        type: "eip1559";
                        typeHex: (...) | (...);
                        v: bigint;
                        value: bigint;
                        yParity: number;
                    } | {
                        accessList: AccessList;
                        blobVersionedHashes: (...)[];
                        blockHash: (...) extends (...)
                            ? (...)
                            : (...);
                        blockNumber: (...) extends (...)
                            ? (...)
                            : (...);
                        chainId: number;
                        from: `0x${(...)}`;
                        gas: bigint;
                        gasPrice?: undefined;
                        hash: `0x${(...)}`;
                        input: `0x${(...)}`;
                        maxFeePerBlobGas: bigint;
                        maxFeePerGas: bigint;
                        maxPriorityFeePerGas: bigint;
                        nonce: number;
                        r: `0x${(...)}`;
                        s: `0x${(...)}`;
                        to: (...) | (...);
                        transactionIndex: (...) extends (...)
                            ? (...)
                            : (...);
                        type: "eip4844";
                        typeHex: (...) | (...);
                        v: bigint;
                        value: bigint;
                        yParity: number;
                    }>);
                    getTransactionConfirmations: ((args) => Promise<bigint>);
                    getTransactionCount: ((args) => Promise<number>);
                    getTransactionReceipt: ((args) => Promise<TransactionReceipt>);
                    key: string;
                    multicall: (<const contracts, allowFailure>(args) => Promise<MulticallReturnType<contracts, allowFailure>>);
                    name: string;
                    pollingInterval: number;
                    prepareTransactionRequest: (<const TRequest, TChainOverride, TAccountOverride>(args) => Promise<{
                        [K in string | number | symbol]: ((...) & (...))[K]
                    }>);
                    readContract: (<const abi, functionName, args>(args) => Promise<ReadContractReturnType<abi, functionName, args>>);
                    request: EIP1193RequestFn<PublicRpcSchema>;
                    sendRawTransaction: ((args) => Promise<`0x${string}`>);
                    simulateContract: (<const abi, functionName, args, chainOverride, accountOverride>(args) => Promise<SimulateContractReturnType<abi, functionName, args, undefined | Chain, undefined | Account, chainOverride, accountOverride>>);
                    transport: TransportConfig<string, EIP1193RequestFn> & Record<string, any>;
                    type: string;
                    uid: string;
                    uninstallFilter: ((args) => Promise<boolean>);
                    verifyMessage: ((args) => Promise<boolean>);
                    verifyTypedData: ((args) => Promise<boolean>);
                    waitForTransactionReceipt: ((args) => Promise<TransactionReceipt>);
                    watchBlockNumber: ((args) => WatchBlockNumberReturnType);
                    watchBlocks: (<TIncludeTransactions, TBlockTag>(args) => WatchBlocksReturnType);
                    watchContractEvent: (<const TAbi, TEventName, TStrict>(args) => WatchContractEventReturnType);
                    watchEvent: (<const TAbiEvent, const TAbiEvents, TStrict>(args) => WatchEventReturnType);
                    watchPendingTransactions: ((args) => WatchPendingTransactionsReturnType);
                };
            }> & OptionalMarkets = {}

          Returns Promise<SupportedMarketMapping<{
              commitmentCost: bigint;
              settlementCost: bigint;
              totalCost: bigint;
          }>>

    • subPositions: ((args) => Promise<{
          delta: bigint;
          depositTotal: bigint;
          executionPrice: bigint;
          executionPriceWithOffset: bigint;
          feeAccumulations: RealizedFeeAccumulations;
          guaranteePrice: null | bigint;
          liquidation: boolean;
          liquidationFee: bigint;
          magnitude: bigint;
          market: SupportedMarket;
          netDeposits: bigint;
          netPnl: bigint;
          netPnlPercent: bigint;
          orderId: bigint;
          pnlAccumulations: RealizedAccumulations;
          side: PositionSide;
          startCollateral: bigint;
          totalFees: bigint;
          totalPnl: bigint;
          transactionHashes: string[];
          valid: boolean;
          version: bigint;
          withdrawalTotal: bigint;
      }[]>)

      Fetches the sub positions activity for a given position

      Returns

      User's sub positions.

        • (args): Promise<{
              delta: bigint;
              depositTotal: bigint;
              executionPrice: bigint;
              executionPriceWithOffset: bigint;
              feeAccumulations: RealizedFeeAccumulations;
              guaranteePrice: null | bigint;
              liquidation: boolean;
              liquidationFee: bigint;
              magnitude: bigint;
              market: SupportedMarket;
              netDeposits: bigint;
              netPnl: bigint;
              netPnlPercent: bigint;
              orderId: bigint;
              pnlAccumulations: RealizedAccumulations;
              side: PositionSide;
              startCollateral: bigint;
              totalFees: bigint;
              totalPnl: bigint;
              transactionHashes: string[];
              valid: boolean;
              version: bigint;
              withdrawalTotal: bigint;
          }[]>
        • Parameters

          • args: OmitBound<{
                address: `0x${string}`;
                chainId: 1424 | 42161 | 60850 | 421614;
                first?: number;
                graphClient: GraphQLClient;
                market: SupportedMarket;
                minBlock?: number;
                positionId: bigint;
                skip?: number;
            }> & OptionalAddress

          Returns Promise<{
              delta: bigint;
              depositTotal: bigint;
              executionPrice: bigint;
              executionPriceWithOffset: bigint;
              feeAccumulations: RealizedFeeAccumulations;
              guaranteePrice: null | bigint;
              liquidation: boolean;
              liquidationFee: bigint;
              magnitude: bigint;
              market: SupportedMarket;
              netDeposits: bigint;
              netPnl: bigint;
              netPnlPercent: bigint;
              orderId: bigint;
              pnlAccumulations: RealizedAccumulations;
              side: PositionSide;
              startCollateral: bigint;
              totalFees: bigint;
              totalPnl: bigint;
              transactionHashes: string[];
              valid: boolean;
              version: bigint;
              withdrawalTotal: bigint;
          }[]>

    • tradeHistory: ((args?) => Promise<{
          delta: bigint;
          depositTotal: bigint;
          executionPrice: bigint;
          executionPriceWithOffset: bigint;
          feeAccumulations: RealizedFeeAccumulations;
          guaranteePrice: null | bigint;
          liquidation: boolean;
          liquidationFee: bigint;
          magnitude: bigint;
          market: SupportedMarket;
          netDeposits: bigint;
          netPnl: bigint;
          netPnlPercent: bigint;
          orderId: bigint;
          pnlAccumulations: RealizedAccumulations;
          side: PositionSide;
          startCollateral: bigint;
          totalFees: bigint;
          totalPnl: bigint;
          transactionHashes: string[];
          valid: boolean;
          version: bigint;
          withdrawalTotal: bigint;
      }[]>)

      Fetches the trade history across all markets for a given address

      Returns

      User's trade history.

        • (args?): Promise<{
              delta: bigint;
              depositTotal: bigint;
              executionPrice: bigint;
              executionPriceWithOffset: bigint;
              feeAccumulations: RealizedFeeAccumulations;
              guaranteePrice: null | bigint;
              liquidation: boolean;
              liquidationFee: bigint;
              magnitude: bigint;
              market: SupportedMarket;
              netDeposits: bigint;
              netPnl: bigint;
              netPnlPercent: bigint;
              orderId: bigint;
              pnlAccumulations: RealizedAccumulations;
              side: PositionSide;
              startCollateral: bigint;
              totalFees: bigint;
              totalPnl: bigint;
              transactionHashes: string[];
              valid: boolean;
              version: bigint;
              withdrawalTotal: bigint;
          }[]>
        • Parameters

          Returns Promise<{
              delta: bigint;
              depositTotal: bigint;
              executionPrice: bigint;
              executionPriceWithOffset: bigint;
              feeAccumulations: RealizedFeeAccumulations;
              guaranteePrice: null | bigint;
              liquidation: boolean;
              liquidationFee: bigint;
              magnitude: bigint;
              market: SupportedMarket;
              netDeposits: bigint;
              netPnl: bigint;
              netPnlPercent: bigint;
              orderId: bigint;
              pnlAccumulations: RealizedAccumulations;
              side: PositionSide;
              startCollateral: bigint;
              totalFees: bigint;
              totalPnl: bigint;
              transactionHashes: string[];
              valid: boolean;
              version: bigint;
              withdrawalTotal: bigint;
          }[]>

    • waitForOrderSettlement: ((txHash, onSettlement?) => Promise<TransactionReceipt>)

      Waits for a perennial transaction to settle and invokes an optional callback

        • (txHash, onSettlement?): Promise<TransactionReceipt>
        • Parameters

          • txHash: `0x${string}`

            Transaction hash

          • Optional onSettlement: ((res) => void)

            Optional callback to invoke on settlement

              • (res): void
              • Parameters

                • res: {
                      txReceipt?: TransactionReceipt;
                      version?: {
                          price: bigint;
                          timestamp: bigint;
                          valid: boolean;
                      };
                  }
                  • Optional txReceipt?: TransactionReceipt
                  • Optional version?: {
                        price: bigint;
                        timestamp: bigint;
                        valid: boolean;
                    }
                    • price: bigint
                    • timestamp: bigint
                    • valid: boolean

                Returns void

          Returns Promise<TransactionReceipt>

  • get write(): {
        cancelOrder: ((...args) => Promise<`0x${string}`>);
        claimFee: ((...args) => Promise<`0x${string}`>);
        limitOrder: ((...args) => Promise<`0x${string}`>);
        modifyPosition: ((...args) => Promise<`0x${string}`>);
        placeOrder: ((...args) => Promise<`0x${string}`>);
        stopLoss: ((...args) => Promise<`0x${string}`>);
        takeProfit: ((...args) => Promise<`0x${string}`>);
        update: ((...args) => Promise<`0x${string}`>);
        updateIntent: ((...args) => Promise<`0x${string}`>);
    }
  • Returns {
        cancelOrder: ((...args) => Promise<`0x${string}`>);
        claimFee: ((...args) => Promise<`0x${string}`>);
        limitOrder: ((...args) => Promise<`0x${string}`>);
        modifyPosition: ((...args) => Promise<`0x${string}`>);
        placeOrder: ((...args) => Promise<`0x${string}`>);
        stopLoss: ((...args) => Promise<`0x${string}`>);
        takeProfit: ((...args) => Promise<`0x${string}`>);
        update: ((...args) => Promise<`0x${string}`>);
        updateIntent: ((...args) => Promise<`0x${string}`>);
    }

    • cancelOrder: ((...args) => Promise<`0x${string}`>)

      Send a cancel order transaction

      Returns

      Transaction Hash.

    • claimFee: ((...args) => Promise<`0x${string}`>)

      Send a claim fee transaction

    • limitOrder: ((...args) => Promise<`0x${string}`>)

      Send a limit order transaction

      Returns

      Transaction hash.

    • modifyPosition: ((...args) => Promise<`0x${string}`>)

      Send a modify position transaction. Can be used to increase/decrease an existing position, open/close a position and deposit or withdraw collateral.

      Returns

      Transaction Hash

    • placeOrder: ((...args) => Promise<`0x${string}`>)

      Send a place order transaction. Can be used to set limit, stop loss and take profit orders.

      Returns

      Transaction Hash.

    • stopLoss: ((...args) => Promise<`0x${string}`>)

      Send a stop loss order transaction

      Returns

      Transaction hash.

    • takeProfit: ((...args) => Promise<`0x${string}`>)

      Send a take profit order transaction

      Returns

      Transaction hash.

    • update: ((...args) => Promise<`0x${string}`>)

      Send an update market transaction. Can be used to increase/decrease an existing position, open/close a position and deposit or withdraw collateral

      Returns

      Transaction Hash.

    • updateIntent: ((...args) => Promise<`0x${string}`>)

      Send a update intent transaction