Hyperion Docs
  • Home
  • Overview
    • Introduction
    • Contact
    • Glossary
    • Roadmap
  • Concepts
    • Concentrated Liquidity
    • Fees
    • Swap
    • Liquidity Mining
    • Range Order
    • Drips
  • Guides
    • FAQ
    • How to Swap
    • How to Create New Position
    • How to Add/Remove Liquidity
    • How to Create a New Pool
    • How to Place a Limit Order
  • Developer
    • Dev Overview
    • via SDK
      • Getting Started
      • Prerequisites
      • Features Available
        • Get pools
        • Get positions
        • Get ticks
        • Create pool
        • Add Liquidity
        • Remove Liquidity
        • Fee & Rewards
        • Swap
        • Types
    • via Contract
      • Get Started
      • Data structure
      • Features available
        • Create pool
        • Swap
        • Open position
        • Add liquidity
        • Remove liquidity
        • Collect fees
        • Collect rewards
    • via API
    • Contract ErrorCode
  • Security
    • Audits
  • Resource
    • Brand Asset
Powered by GitBook
On this page
  • 1. Get all pools
  • Example
  • 2. Get pool by poolId
  • 3. Get pool by token asset types and feeTier
  1. Developer
  2. via SDK
  3. Features Available

Get pools

1. Get all pools

use sdk.Pool.fetchAllPools method.

Example

async function fetchAllPools() {
    const poolItems = await sdk.Pool.fetchAllPools();
    console.log(poolItems)
}

2. Get pool by poolId

async function fetchOnePool() {
    const pool = await sdk.Pool.fetchPoolById({
        poolId: '0xf108...876b5'
    })
}

3. Get pool by token asset types and feeTier

(from v0.0.7)

async function fetchOnePool() {
    const pool = await sdk.Pool.getPoolByTokenPairAndFeeTier({
        token1: '0x1::aptos_coin::AptosCoin',
        token2: '0x6926bff1eab5554fa72ae167ed736acf623ab17fe81ebf2ea0d2138f8c533f77::type::T',
        feeTier: FeeTierIndex["PER_0.01_SPACING_1"],
    })
}

PreviousFeatures AvailableNextGet positions

Last updated 2 months ago