API Connections

HelloDEX Subgraph Query Documentation

Introduction

This document outlines the GraphQL queries used to fetch data from the HelloDEX Subgraph. These queries allow

developers to retrieve on-chain data related to liquidity pools, positions, and user interactions on the HelloDEX platform.

Query: All Pools

Fetches a list of all liquidity pools with relevant details.

Query

query MyQuery {

pools {

amount0

amount1

blockNumber

blockTimestamp

id

liquidity

owner

tokenId

transactionHash

}

}


Field Descriptions

amount0 (String): Amount of token0 in the pool.

amount1 (String): Amount of token1 in the pool.

blockNumber (Int): Block number at which the data was recorded.

blockTimestamp (Int): Unix timestamp of the event.

id (ID): Unique pool identifier.

liquidity (String): Current liquidity in the pool.

owner (String): Address of the pool owner.

tokenId (String): NFT or LP token ID tied to the pool.

transactionHash (String): Hash of the transaction related to this pool event.HelloDEX Subgraph Query Documentation

Response Example

{

"data": {

"pools": [

{

"amount0": "1000000000000000000",

"amount1": "500000000000000000",

"blockNumber": 18902730,

"blockTimestamp": 1691432000,

"id": "0xabc123...",

"liquidity": "1200000",

"owner": "0xdef456...",

"tokenId": "42",

"transactionHash": "0x789ghi..."

}

]

}

}


Query: Single Pool by ID

Fetches data about a specific pool using its id.

Query

query MyQuery {

pool(id: "1") {

amount0

amount1

blockNumber

blockTimestamp

id

liquidity

owner

tokenId

transactionHash

}

}


Field Descriptions

amount0 (String): Amount of token0 in the pool.

amount1 (String): Amount of token1 in the pool.

blockNumber (Int): Block number at which this pools data was recorded.

blockTimestamp (Int): Timestamp of the event (Unix).

id (ID): Unique identifier of the pool.

liquidity (String): Liquidity provided in the pool.

owner (String): Address of the pool owner.

tokenId (String): LP token ID associated with the pool.

transactionHash (String): Related transaction hash.


Response Example

{

"data": {

"pool": {

"amount0": "5000000000000000000",

"amount1": "2000000000000000000",

"blockNumber": 18908888,

"blockTimestamp": 1691440000,

"id": "1",

"liquidity": "7000000",

"owner": "0xabc123...",

"tokenId": "17",

"transactionHash": "0xhashabc..."

}

}

}


Notes

  • All amount0 and amount1 values are raw integers (e.g., in wei). Use token decimals to format them properly.

  • Use pagination options like first, skip, orderBy, and filters with where for advanced queries.

  • Ensure id passed to pool(id: "...") exists, or the query will return null.


LP Locks

BSC

BASE

ETH


DEX

BSC

BASE

ETH

Last updated