LogoLogo
  • Welcome to FlowX Finance
    • 🔮Protocol Overview
    • 🕶️Our Advantages
    • 🚩Getting Started
    • 🗺️Roadmap
  • PROTOCOL
    • ⚖️Swap
    • 🛞DEX Aggregator
    • 🎰Lucky Swap
    • ⚗️Liquidity Pools
    • 🎚️Position Management
    • 🪣Farming as a Service
    • 💰Earning Protocol Fee
    • 🏁Trading Competition
    • 💬Referral
  • REFERENCES
    • 🛡️Audit
    • 🖼️Media Kit
    • 🤝Partners
    • 🧰SDK
    • 🖥️Aggregator Widget
  • Developer
    • Overview
    • FlowX SDK
      • Getting Started
      • Retrieve coin
      • Swap Aggregator
      • AMM Management
        • Pool Management
        • Position Management
      • CLMM Management
        • Pool Management
        • Position Management
      • Auto Invest
      • Limit Order
    • FlowX Widget
  • Tokenomics
    • 🚇FLX Token
    • 🚊xFLX Governance Token
  • 🔦Guide
    • How to add Liquidity V3
  • Privacy & Terms
    • Risk Disclaimer
    • Terms of Service
Powered by GitBook

App

  • Aggregator
  • Liquidity Hub
  • Stake

Connect with us

  • X
  • Discord
  • Telegram Group

Find us

  • DefiLlama
  • Dexscreener
  • Coingecko

© 2025 FlowX Finance

On this page
  • Get user position detail
  • Create Position
  • Increase Position

Was this helpful?

  1. Developer
  2. FlowX SDK
  3. AMM Management

Position Management

Get user position detail

const positionManager = new AmmPositionManager('mainnet');
const positions = await positionManager.getUserPositions('userAddress');

Create Position

const pool = new AmmPool({
      objectId: '',
      coins: [
        new Coin(
          '0xd1b72982e40348d069bb1ff701e634c117bb5f741f44dff91e472d3b01461e55::stsui::STSUI'
        ),
        new Coin(
          '0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP'
        ),
      ],
      reserves: [0, 0],
      feeRate: 0,
      liquiditySupply: 0,
      kLast: 0,
    });

    const position = Position.fromAmounts({
      owner:
        '0xUserAddress',
      pool: pool,
      amountX: 0,
      amountY: 0,
    });

    const mintAmounts = position.mintAmountsWithSlippage(new Percent(0.0001));

Increase Position

const poolManager = new AmmPoolManager('mainnet');

    const pool = await poolManager.getPool({
      coinX: new Coin('0x2::sui::SUI'),
      coinY: new Coin(
        '0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC'
      ),
    });

    const position = Position.fromAmounts({
      owner:
        '0xUserAddrexx',
      pool: pool,
      amountX: 1e9,
      amountY: 1e5,
    });

    const mintAmounts = position.mintAmountsWithSlippage(new Percent(0.0001));
PreviousPool ManagementNextCLMM Management

Last updated 2 months ago

Was this helpful?