- tokenPrices
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
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
Maximum number of transactions to return when paginating forward.
Cursor to start paginating after a specific result. Used for forward pagination.
Maximum number of transactions to return when paginating backward.
Cursor to start paginating before a specific result. Used for backward pagination.
Return type
PoolList of transaction edges
Pagination information
Total number of transactions
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
}
}
{ "pairId": "Example String", "type": "SWAP", "first": 40, "after": "Example String", "last": 40, "before": "Example String" }
{ "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
The Kadena account address whose liquidity positions you want to retrieve.
Example: "k:abcd1234..."
Maximum number of liquidity positions to return when paginating forward.
Cursor to start paginating after a specific result. Used for forward pagination.
Maximum number of liquidity positions to return when paginating backward.
Cursor to start paginating before a specific result. Used for backward pagination.
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
Liquidityquery 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
}
}
{ "walletAddress": "Example String", "first": 40, "after": "Example String", "last": 40, "before": "Example String", "orderBy": "VALUE_USD_ASC" }
{ "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
(Optional) Start date for the historical range used to calculate TVL and volume metrics.
(Optional) End date for the historical range used to calculate TVL and volume metrics.
(Optional) Filter metrics by the protocol’s module name on Kadena. Useful when multiple DEX protocols are supported.
Return type
DexThe total number of liquidity pools deployed under the protocol.
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.
Historical time-series data points representing TVL evolution over the selected time range. Useful for charting liquidity growth and analyzing protocol trends.
Historical time-series data points representing trading volume over the selected time range. Useful for charting market activity and usage patterns.
The total cumulative trading volume (in USD) observed over the specified time range.
query dexMetrics(
$startDate: DateTime
$endDate: DateTime
$protocolAddress: String
) {
dexMetrics(
startDate: $startDate
endDate: $endDate
protocolAddress: $protocolAddress
) {
totalPools
currentTvlUsd
tvlHistory {
__typename
# ...ChartDataPointFragment
}
volumeHistory {
__typename
# ...ChartDataPointFragment
}
totalVolumeUsd
}
}
{ "startDate": "Example Custom Scalar", "endDate": "Example Custom Scalar", "protocolAddress": "Example String" }
{ "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
The module name of the token whose price you want to retrieve. Example: `"kaddex.token"``.
Return type
DecimalFloats that will have a value of 0 or more.
query lastTokenPriceInKda($moduleName: String!) {
lastTokenPriceInKda(moduleName: $moduleName)
}
{ "moduleName": "Example String" }
{ "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
The on-chain address (module name) of the token whose price you want to retrieve.
Example: "kaddex.token"
(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
TokenGlobally unique identifier for this token price entry.
The token associated with this price data.
The current price of the token denominated in KDA.
The current price of the token denominated in USD.
The protocol/module name on Kadena where this price was retrieved from.
The timestamp of the most recent price update.
query tokenPrice($tokenAddress: String!, $protocolAddress: String) {
tokenPrice(tokenAddress: $tokenAddress, protocolAddress: $protocolAddress) {
id
token {
__typename
# ...TokenFragment
}
priceInKda
priceInUsd
protocolAddress
updatedAt
}
}
{ "tokenAddress": "Example String", "protocolAddress": "Example String" }
{ "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
(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
[TokenGlobally unique identifier for this token price entry.
The token associated with this price data.
The current price of the token denominated in KDA.
The current price of the token denominated in USD.
The protocol/module name on Kadena where this price was retrieved from.
The timestamp of the most recent price update.
query tokenPrices($protocolAddress: String) {
tokenPrices(protocolAddress: $protocolAddress) {
id
token {
__typename
# ...TokenFragment
}
priceInKda
priceInUsd
protocolAddress
updatedAt
}
}
{ "protocolAddress": "Example String" }
{ "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" } ] }