Skip to content
Overview

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