Skip to content
Overview

Retrieve a paginated list of liquidity pools with sorting and optional protocol filtering.

This query returns AMM pools (currently sourced from a single protocol used by the Sushi team) including reserves, TVL (USD), volume, fees, APR, and recent activity metrics. Prices for TVL/volume/fees are computed using DIA data (https://api.diadata.org) refreshed approximately every 5 minutes.

Use orderBy to sort by TVL, 24h/7d volume, 24h APR, or 24h transaction count (ASC/DESC), and protocolAddress to limit results to a specific protocol/module name on Kadena. Results support cursor-based pagination.

Arguments

after

Cursor to start paginating after a specific result (forward pagination).

before

Cursor to start paginating before a specific result (backward pagination).

first

Maximum number of pools to return when paginating forward.

last

Maximum number of pools to return when paginating backward.

Default:"TVL_USD_DESC"

Sort order for the returned pools.

protocolAddress

The protocol/module name (on Kadena) to filter by. Use this to restrict results to a specific DEX implementation.

Return type

QueryPoolsConnection!
pageInfo
PageInfo!,non-null
totalCount
Int!,non-null
Query sample
query pools(
  $after: String
  $before: String
  $first: Int
  $last: Int
  $orderBy: PoolOrderBy
  $protocolAddress: String
) {
  pools(
    after: $after
    before: $before
    first: $first
    last: $last
    orderBy: $orderBy
    protocolAddress: $protocolAddress
  ) {
    edges {
      cursor 
      node {
        id 
        address 
        token0 {
          __typename
          # ...TokenFragment
        }
        token1 {
          __typename
          # ...TokenFragment
        }
        reserve0 
        reserve1 
        totalSupply 
        key 
        tvlUsd 
        tvlChange24h 
        volume24hUsd 
        volumeChange24h 
        volume7dUsd 
        fees24hUsd 
        feesChange24h 
        transactionCount24h 
        transactionCountChange24h 
        apr24h 
        createdAt 
        updatedAt 
        charts(
          # Arguments Here
        ) {
          __typename
          # ...PoolChartsFragment
        }
        transactions(
          # Arguments Here
        ) {
          __typename
          # ...PoolTransactionsConnectionFragment
        }
      }
    }
    pageInfo {
      startCursor 
      endCursor 
      hasNextPage 
      hasPreviousPage 
    }
    totalCount 
  }
}
Variables
{ "after": "Example String", "before": "Example String", "first": 40, "last": 40, "orderBy": "TVL_USD_ASC", "protocolAddress": "Example String" }
Response sample
{ "data": { "edges": [ { "cursor": "Example String", "node": { "id": "9cfb1c81-4c79-452f-b1f5-8ee6571276b4", "address": "Example String", "token0": { "__typename": "Token" }, "token1": { "__typename": "Token" }, "reserve0": "Example String", "reserve1": "Example String", "totalSupply": "Example String", "key": "Example String", "tvlUsd": 40, "tvlChange24h": 40, "volume24hUsd": 40, "volumeChange24h": 40, "volume7dUsd": 40, "fees24hUsd": 40, "feesChange24h": 40, "transactionCount24h": 40, "transactionCountChange24h": 40, "apr24h": 40, "createdAt": "Example Custom Scalar", "updatedAt": "Example Custom Scalar", "charts": { "__typename": "PoolCharts" }, "transactions": { "__typename": "PoolTransactionsConnection" } } } ], "pageInfo": { "startCursor": "Example String", "endCursor": "Example String", "hasNextPage": true, "hasPreviousPage": true }, "totalCount": 40 } }

Retrieve a specific liquidity pool by its unique ID.

This query returns detailed information about a single AMM liquidity pool, including its reserves, paired tokens, TVL, trading volume, APR, and recent performance metrics. It’s commonly used by explorers, dashboards, and analytics tools to power individual pool detail views.

You can optionally provide a timeFrame to shape the data returned in metrics and charts, and a type to filter transactions by category (e.g., swaps, adds, removes).

⚠️ Note: While first, after, last, and before arguments are accepted for API consistency, they are not used by the internal resolvers of this query. Pagination of pool transactions is handled by the parent pool resolver, not directly here.

Arguments

id
ID!,non-nullrequired

The globally unique ID of the pool to retrieve.

timeFrame

Optional time frame used for calculating and returning chart data.

Optional transaction type filter (e.g., swaps, adds, removes) applied to the returned transactions.

first

Accepted for API consistency but not used by this resolver.

after

Accepted for API consistency but not used by this resolver.

last

Accepted for API consistency but not used by this resolver.

before

Accepted for API consistency but not used by this resolver.

Return type

Pool
id
ID!,non-null

Globally unique identifier for this pool node.

address
String!,non-null

The on-chain address / module reference for this pool.

token0
Token!,non-null

The first token in the pair (base/slot-0).

token1
Token!,non-null

The second token in the pair (quote/slot-1).

reserve0
String!,non-null

Current on-chain reserve of token0 held by the pool (as a string for full precision).

reserve1
String!,non-null

Current on-chain reserve of token1 held by the pool (as a string for full precision).

totalSupply
String!,non-null

Total supply of the pool’s LP (liquidity provider) tokens (as a string for full precision).

key
String!,non-null

A stable key for the pool (e.g., a deterministic pair identifier).

tvlUsd
Float!,non-null

Total value locked (USD) in this pool, derived from reserves and external pricing.

tvlChange24h
Float!,non-null

24-hour percentage change in TVL.

volume24hUsd
Float!,non-null

Notional 24-hour traded volume (USD).

volumeChange24h
Float!,non-null

24-hour percentage change in volume.

volume7dUsd
Float!,non-null

Notional 7-day traded volume (USD).

fees24hUsd
Float!,non-null

Notional 24-hour fees accrued by the pool (USD).

feesChange24h
Float!,non-null

24-hour percentage change in fees.

transactionCount24h
Int!,non-null

Count of pool transactions over the last 24 hours.

transactionCountChange24h
Float!,non-null

24-hour percentage change in transaction count.

apr24h
Float!,non-null

24-hour APR estimate derived from recent fees relative to TVL (as a percentage).

createdAt
DateTime!,non-null

Timestamp when this pool record was created.

updatedAt
DateTime!,non-null

Timestamp when this pool record was last updated.

charts
PoolCharts!,non-null

Get chart/series data for this pool over a specified timeframe (e.g., TVL, volume).

timeFrame*

Get transactions related to this pool, with optional type filtering and cursor-based pagination.

typefirstafterlastbefore
Query sample
query pool(
  $id: ID!
  $timeFrame: TimeFrame
  $type: PoolTransactionType
  $first: Int
  $after: String
  $last: Int
  $before: String
) {
  pool(
    id: $id
    timeFrame: $timeFrame
    type: $type
    first: $first
    after: $after
    last: $last
    before: $before
  ) {
    id 
    address 
    token0 {
      __typename
      # ...TokenFragment
    }
    token1 {
      __typename
      # ...TokenFragment
    }
    reserve0 
    reserve1 
    totalSupply 
    key 
    tvlUsd 
    tvlChange24h 
    volume24hUsd 
    volumeChange24h 
    volume7dUsd 
    fees24hUsd 
    feesChange24h 
    transactionCount24h 
    transactionCountChange24h 
    apr24h 
    createdAt 
    updatedAt 
    charts(
      # Arguments Here
    ) {
      __typename
      # ...PoolChartsFragment
    }
    transactions(
      # Arguments Here
    ) {
      __typename
      # ...PoolTransactionsConnectionFragment
    }
  }
}
Variables
{ "id": "9cfb1c81-4c79-452f-b1f5-8ee6571276b4", "timeFrame": "DAY", "type": "SWAP", "first": 40, "after": "Example String", "last": 40, "before": "Example String" }
Response sample
{ "data": { "id": "9cfb1c81-4c79-452f-b1f5-8ee6571276b4", "address": "Example String", "token0": { "__typename": "Token" }, "token1": { "__typename": "Token" }, "reserve0": "Example String", "reserve1": "Example String", "totalSupply": "Example String", "key": "Example String", "tvlUsd": 40, "tvlChange24h": 40, "volume24hUsd": 40, "volumeChange24h": 40, "volume7dUsd": 40, "fees24hUsd": 40, "feesChange24h": 40, "transactionCount24h": 40, "transactionCountChange24h": 40, "apr24h": 40, "createdAt": "Example Custom Scalar", "updatedAt": "Example Custom Scalar", "charts": { "__typename": "PoolCharts" }, "transactions": { "__typename": "PoolTransactionsConnection" } } }

Retrieve a paginated list of transactions for a specific liquidity pool.

This query returns all on-chain transactions related to a given AMM pool, such as swaps, liquidity additions, and removals. It is most often used by explorers, analytics dashboards, and dApps to display pool activity, analyze trading behavior, or calculate historical metrics.

You must provide the pairId (the unique pool identifier), and you can optionally filter by type to restrict results to a specific category of transactions.

Arguments

pairId
String!,non-nullrequired

The unique identifier of the liquidity pool pair whose transactions you want to retrieve.

Optional transaction type filter to narrow down results. Examples: SWAP, ADD_LIQUIDITY, REMOVE_LIQUIDITY

first

Maximum number of transactions to return when paginating forward.

after

Cursor to start paginating after a specific result. Used for forward pagination.

last

Maximum number of transactions to return when paginating backward.

before

Cursor to start paginating before a specific result. Used for backward pagination.

Return type

PoolTransactionsConnection

List of transaction edges

pageInfo

Pagination information

totalCount

Total number of transactions

Query sample
query poolTransactions(
  $pairId: String!
  $type: PoolTransactionType
  $first: Int
  $after: String
  $last: Int
  $before: String
) {
  poolTransactions(
    pairId: $pairId
    type: $type
    first: $first
    after: $after
    last: $last
    before: $before
  ) {
    edges {
      cursor 
      node {
        id 
        maker 
        amount0In 
        amount1In 
        amount0Out 
        amount1Out 
        amountUsd 
        timestamp 
        transactionId 
        requestkey 
        transactionType 
      }
    }
    pageInfo {
      startCursor 
      endCursor 
      hasNextPage 
      hasPreviousPage 
    }
    totalCount 
  }
}
Variables
{ "pairId": "Example String", "type": "SWAP", "first": 40, "after": "Example String", "last": 40, "before": "Example String" }
Response sample
{ "data": { "edges": [ { "cursor": "Example String", "node": { "id": "9cfb1c81-4c79-452f-b1f5-8ee6571276b4", "maker": "Example String", "amount0In": "Example Custom Scalar", "amount1In": "Example Custom Scalar", "amount0Out": "Example Custom Scalar", "amount1Out": "Example Custom Scalar", "amountUsd": "Example Custom Scalar", "timestamp": "Example Custom Scalar", "transactionId": 40, "requestkey": "Example String", "transactionType": "SWAP" } } ], "pageInfo": { "startCursor": "Example String", "endCursor": "Example String", "hasNextPage": true, "hasPreviousPage": true }, "totalCount": 40 } }

Retrieve a paginated list of a user's liquidity positions across all supported pools.

This query returns all active liquidity positions associated with a given Kadena account (walletAddress), including the amount of liquidity provided, its USD value, and the 24h APR for each position. Each position also includes the underlying pool details for deeper insights.

It is commonly used by wallets, dashboards, and DeFi analytics tools to show a user's liquidity distribution, portfolio value, and performance metrics across supported AMM protocols (currently limited to the Sushi-integrated DEX).

Arguments

walletAddress
String!,non-nullrequired

The Kadena account address whose liquidity positions you want to retrieve. Example: "k:abcd1234..."

first

Maximum number of liquidity positions to return when paginating forward.

after

Cursor to start paginating after a specific result. Used for forward pagination.

last

Maximum number of liquidity positions to return when paginating backward.

before

Cursor to start paginating before a specific result. Used for backward pagination.

Default:"VALUE_USD_DESC"

Sort order for the returned positions. Defaults to VALUE_USD_DESC. Options:

  • VALUE_USD_ASC / VALUE_USD_DESC
  • LIQUIDITY_ASC / LIQUIDITY_DESC
  • APR_ASC / APR_DESC

Return type

LiquidityPositionsConnection!
pageInfo
PageInfo!,non-null
totalCount
Int!,non-null
Query sample
query liquidityPositions(
  $walletAddress: String!
  $first: Int
  $after: String
  $last: Int
  $before: String
  $orderBy: LiquidityPositionOrderBy
) {
  liquidityPositions(
    walletAddress: $walletAddress
    first: $first
    after: $after
    last: $last
    before: $before
    orderBy: $orderBy
  ) {
    edges {
      cursor 
      node {
        id 
        pairId 
        liquidity 
        walletAddress 
        valueUsd 
        apr24h 
        pair {
          __typename
          # ...PoolFragment
        }
        createdAt 
        updatedAt 
      }
    }
    pageInfo {
      startCursor 
      endCursor 
      hasNextPage 
      hasPreviousPage 
    }
    totalCount 
  }
}
Variables
{ "walletAddress": "Example String", "first": 40, "after": "Example String", "last": 40, "before": "Example String", "orderBy": "VALUE_USD_ASC" }
Response sample
{ "data": { "edges": [ { "cursor": "Example String", "node": { "id": "9cfb1c81-4c79-452f-b1f5-8ee6571276b4", "pairId": "Example String", "liquidity": "Example String", "walletAddress": "Example String", "valueUsd": "Example Custom Scalar", "apr24h": "Example Custom Scalar", "pair": { "__typename": "Pool" }, "createdAt": "Example Custom Scalar", "updatedAt": "Example Custom Scalar" } } ], "pageInfo": { "startCursor": "Example String", "endCursor": "Example String", "hasNextPage": true, "hasPreviousPage": true }, "totalCount": 40 } }

Retrieve key metrics for the decentralized exchange (DEX), including total value locked (TVL), trading volume, and pool count, with optional historical data.

This query aggregates protocol-level statistics across all pools under a supported DEX (currently limited to the Sushi-integrated deployment) and is commonly used by dashboards, explorers, and analytics tools to visualize network-wide DeFi activity.

If startDate and endDate are not provided, the query defaults to a 30-day historical range. Use protocolAddress to filter metrics for a specific DEX module on Kadena.

Returned data includes the current TVL, total pool count, total volume over the selected period, and historical time series data for both TVL and volume.

Arguments

startDate

(Optional) Start date for the historical range used to calculate TVL and volume metrics.

endDate

(Optional) End date for the historical range used to calculate TVL and volume metrics.

protocolAddress

(Optional) Filter metrics by the protocol’s module name on Kadena. Useful when multiple DEX protocols are supported.

Return type

DexMetrics!
totalPools
Int!,non-null

The total number of liquidity pools deployed under the protocol.

currentTvlUsd
Decimal!,non-null

The current total value locked (TVL) across all pools, expressed in USD. This reflects the combined liquidity available in the protocol at the time of the query.

tvlHistory

Historical time-series data points representing TVL evolution over the selected time range. Useful for charting liquidity growth and analyzing protocol trends.

volumeHistory

Historical time-series data points representing trading volume over the selected time range. Useful for charting market activity and usage patterns.

totalVolumeUsd
Decimal!,non-null

The total cumulative trading volume (in USD) observed over the specified time range.

Query sample
query dexMetrics(
  $startDate: DateTime
  $endDate: DateTime
  $protocolAddress: String
) {
  dexMetrics(
    startDate: $startDate
    endDate: $endDate
    protocolAddress: $protocolAddress
  ) {
    totalPools 
    currentTvlUsd 
    tvlHistory {
      __typename
      # ...ChartDataPointFragment
    }
    volumeHistory {
      __typename
      # ...ChartDataPointFragment
    }
    totalVolumeUsd 
  }
}
Variables
{ "startDate": "Example Custom Scalar", "endDate": "Example Custom Scalar", "protocolAddress": "Example String" }
Response sample
{ "data": { "totalPools": 40, "currentTvlUsd": "Example Custom Scalar", "tvlHistory": [ { "__typename": "ChartDataPoint" } ], "volumeHistory": [ { "__typename": "ChartDataPoint" } ], "totalVolumeUsd": "Example Custom Scalar" } }

Retrieve the latest price of a specific token denominated in KDA.

This query returns the most recent known price of a given token relative to Kadena’s native token (KDA), based on aggregated on-chain data and pricing information from supported sources.

Arguments

moduleName
String!,non-nullrequired

The module name of the token whose price you want to retrieve. Example: `"kaddex.token"``.

Return type

Decimal

Floats that will have a value of 0 or more.

Query sample
query lastTokenPriceInKda($moduleName: String!) {
  lastTokenPriceInKda(moduleName: $moduleName) 
}
Variables
{ "moduleName": "Example String" }
Response sample
{ "data": "Example Custom Scalar" }

Retrieve the latest price information for a specific token.

This query behaves like tokenPrices but returns the price data for a single token instead of a list. It includes the token's price in both KDA and USD, the protocol where the price was sourced, and the timestamp of the latest update.

Use this when you only need pricing information for a single token rather than fetching the full list.

Arguments

tokenAddress
String!,non-nullrequired

The on-chain address (module name) of the token whose price you want to retrieve. Example: "kaddex.token"

protocolAddress

(Optional) The module name of the DEX protocol to query the price from. If omitted, the default supported protocol (currently Sushi) is used.

Return type

TokenPrice
id
ID!,non-null

Globally unique identifier for this token price entry.

token
Token!,non-null

The token associated with this price data.

priceInKda
Decimal!,non-null

The current price of the token denominated in KDA.

priceInUsd
Decimal!,non-null

The current price of the token denominated in USD.

protocolAddress
String!,non-null

The protocol/module name on Kadena where this price was retrieved from.

updatedAt
DateTime!,non-null

The timestamp of the most recent price update.

Query sample
query tokenPrice($tokenAddress: String!, $protocolAddress: String) {
  tokenPrice(tokenAddress: $tokenAddress, protocolAddress: $protocolAddress) {
    id 
    token {
      __typename
      # ...TokenFragment
    }
    priceInKda 
    priceInUsd 
    protocolAddress 
    updatedAt 
  }
}
Variables
{ "tokenAddress": "Example String", "protocolAddress": "Example String" }
Response sample
{ "data": { "id": "9cfb1c81-4c79-452f-b1f5-8ee6571276b4", "token": { "__typename": "Token" }, "priceInKda": "Example Custom Scalar", "priceInUsd": "Example Custom Scalar", "protocolAddress": "Example String", "updatedAt": "Example Custom Scalar" } }

Retrieve the latest price information for all tokens available in a specific protocol.

This query returns a list of TokenPrice objects, each containing the current price of a token in both KDA and USD, along with metadata about the protocol and the timestamp of the most recent update.

It is commonly used by explorers, analytics dashboards, and DEX frontends to power price feeds, portfolio valuations, and liquidity analytics.

You can optionally specify a protocolAddress to restrict the results to a particular DEX module. If omitted, the default supported protocol (currently Sushi) is used.

Arguments

protocolAddress

(Optional) The module name of the DEX protocol whose token prices you want to retrieve. If omitted, the default supported protocol (currently Sushi) is used.

Return type

[TokenPrice!]!
id
ID!,non-null

Globally unique identifier for this token price entry.

token
Token!,non-null

The token associated with this price data.

priceInKda
Decimal!,non-null

The current price of the token denominated in KDA.

priceInUsd
Decimal!,non-null

The current price of the token denominated in USD.

protocolAddress
String!,non-null

The protocol/module name on Kadena where this price was retrieved from.

updatedAt
DateTime!,non-null

The timestamp of the most recent price update.

Query sample
query tokenPrices($protocolAddress: String) {
  tokenPrices(protocolAddress: $protocolAddress) {
    id 
    token {
      __typename
      # ...TokenFragment
    }
    priceInKda 
    priceInUsd 
    protocolAddress 
    updatedAt 
  }
}
Variables
{ "protocolAddress": "Example String" }
Response sample
{ "data": [ { "id": "9cfb1c81-4c79-452f-b1f5-8ee6571276b4", "token": { "__typename": "Token" }, "priceInKda": "Example Custom Scalar", "priceInUsd": "Example Custom Scalar", "protocolAddress": "Example String", "updatedAt": "Example Custom Scalar" } ] }
Overview
Overview
Overview
Overview
Overview
Overview
Overview