💰
Sudo Gitbook
  • 👋Welcome to Sudo
  • Overview
    • 💡What is Sudo
    • ✨Sudo Features
  • Trade on Sudo
    • 💎Start trading
      • Supported Assets
      • Fees
      • Market Hours
    • 📚Educational Resources
      • What Are Perpetual Futures?
      • Using Leverage Wisely
      • Risk Management Fundamentals
      • What is Sharpe Ratio
      • Real Trading Scenarios
      • Avoiding Rookie Mistakes
  • Liquidity Providers
    • 💰How to provide liquidity
    • 🛰️SLP
    • 🏦SLP Staking
  • S Rewards
    • S Card
      • Getting S Card
      • S Points
      • Using Your S Card
  • Sudo API
    • Sudo API Reference
      • Trader Data
      • Market Info
  • Sudo SDK
    • Introduction to Sudo SDK
    • Core Concepts
    • Installation and Setup
    • Quick Start
    • 📚v0.0.6
      • API Reference
        • SudoAPI
          • Open Position
          • Decrease Position
          • Pledge In Position
          • Redeem From Position
          • Cancel Order
          • getPositionCapInfoList
          • getPositionInfoList
          • getPositionConfig
        • OracleAPI
          • subOraclePrices
      • Changelog
    • Best Practices
    • Troubleshooting
  • Feature Details
    • Algorithm Balanced Funding Rate (ABFR)
    • Risk control
    • FAQ
    • Roadmap
    • On-chain program
Powered by GitBook
On this page
  1. Sudo SDK
  2. v0.0.6
  3. API Reference
  4. SudoAPI

getPositionCapInfoList

The getPositionCapInfoList function retrieves a list of position cap information for a given owner address.

Function Signature

getPositionCapInfoList(owner: string): Promise<IPositionCapInfo[]>

Parameters

  • owner: A string representing the owner's address.

Return Value

Returns a Promise that resolves to an array of IPositionCapInfo objects. Each IPositionCapInfo object has the following structure:

interface IPositionCapInfo {
  positionCapId: string;
  symbol0: string;
  symbol1: string;
  long: boolean;
}
  • positionCapId: The ID of the position cap.

  • symbol0: The first symbol in the trading pair.

  • symbol1: The second symbol in the trading pair.

  • long: A boolean indicating whether the position is long (true) or short (false).

Description

This function fetches all position caps owned by the specified address. It filters for objects of type PositionCap and extracts relevant information from each position cap.

Usage Example

const owner = "0x1234..."; // Replace with actual owner address
const sudoAPI = new SudoAPI(network, provider);

try {
  const positionCaps = await sudoAPI.getPositionCapInfoList(owner);
  console.log("Position Caps:", positionCaps);
} catch (error) {
  console.error("Error fetching position caps:", error);
}
PreviousCancel OrderNextgetPositionInfoList

Last updated 9 months ago

📚