Hydra DEX API

Summary

The public GET request endpoints are intended to allow access to market data. Endpoints return results in JSON format. HydraDex-Info uses GraphQL as query language and technology.

Hydradex.org's API can be accessed via https://info.hydradex.org/graphql

You can access the web-app for testing and for exploring the schema, and you can also directly send POST requests to interact with the public API.

Complete Schema

The API follows the same standard as Uniswap v.2 Subgraph Public API. You can access the DOCS and Schema by playing with the GraphQL public web-app, or refer to the following list:
// type User {
id: String!
liquidityPositions: [String!]!
usdSwapped: BigGQL!
}
# The `BigGQL` scalar type to represent currency values
scalar BigGQL
type Token {
id: String!
tokenAddress: String!
symbol: String!
name: String!
decimals: Int!
totalSupply: Int!
tradeVolume: BigGQL!
tradeVolumeUSD: BigGQL!
untrackedVolumeUSD: BigGQL!
txCount: Int!
totalLiquidity: BigGQL!
derivedHYDRA: BigGQL!
}
type Pair {
id: String!
pairAddress: String
token0: Token!
token1: Token!
reserve0: BigGQL!
reserve1: BigGQL!
totalSupply: BigGQL!
reserveHYDRA: BigGQL!
reserveUSD: BigGQL!
trackedReserveHYDRA: BigGQL!
token0Price: BigGQL!
token1Price: BigGQL!
volumeToken0: BigGQL!
volumeToken1: BigGQL!
volumeUSD: BigGQL!
untrackedVolumeUSD: BigGQL!
txCount: Int!
createdAtTimestamp: Int!
createdAtBlockNumber: Int!
liquidityProviderCount: Int!
_oneDayVolumeUSD: BigGQL!
_oneWeekVolumeUSD: BigGQL!
}
type Burn {
id: String!
transactionHash: String!
transaction: Transaction!
timestamp: Int!
pair: Pair
liquidity: BigGQL!
sender: String!
amount0: BigGQL!
amount1: BigGQL!
to: String!
logIndex: Int!
amountUSD: BigGQL!
needsComplete: Boolean!
feeTo: String!
feeLiquidity: BigGQL!
}
type Mint {
id: String!
transactionHash: String!
transaction: Transaction!
timestamp: Int!
pair: Pair!
to: String!
liquidity: BigGQL!
sender: String!
amount0: BigGQL!
amount1: BigGQL!
amountUSD: BigGQL!
logIndex: Int!
feeTo: BigGQL!
feeLiquidity: BigGQL!
}
type Transaction {
id: String!
txHash: String!
blockNumber: Int!
timestamp: Int!
mints: [Mint!]!
burns: [Burn!]!
swaps: [Swap!]!
}
type Swap {
id: String!
transactionHash: String!
transaction: Transaction!
timestamp: Int!
pair: Pair
sender: User!
from: String!
amount0In: BigGQL!
amount1In: BigGQL!
amount0Out: BigGQL!
amount1Out: BigGQL!
logIndex: Int!
to: String!
amountUSD: BigGQL!
}
type Block {
hash: String!
height: Int!
timestamp: Int!
timestamp_from: Int
id: String
number: Int
}
type Bundle {
id: String!
hydraPrice: BigGQL!
}
type LiquidityPosition {
id: String!
user: User!
pair: Pair!
liquidityTokenBalance: BigGQL!
}
type LiquidityPositionSnapshot {
id: String!
liquidityPosition: LiquidityPosition!
timestamp: Int!
block: Int!
user: User!
pair: Pair!
token0PriceUSD: BigGQL!
token1PriceUSD: BigGQL!
reserve0: BigGQL!
reserve1: BigGQL!
reserveUSD: BigGQL!
liquidityTokenTotalSupply: BigGQL!
liquidityTokenBalance: BigGQL!
}
type PairDayData {
id: String!
date: Int!
pair: Pair!
token0: Token!
token1: Token!
reserve0: BigGQL!
reserve1: BigGQL!
totalSupply: BigGQL!
reserveUSD: BigGQL!
dailyVolumeToken0: BigGQL!
dailyVolumeToken1: BigGQL!
dailyVolumeUSD: BigGQL!
dailyTxns: Int!
}
type PairHourData {
id: String!
hourStartUnix: Int!
pair: Pair!
reserve0: BigGQL!
reserve1: BigGQL!
totalSupply: BigGQL!
reserveUSD: BigGQL!
hourlyVolumeToken0: BigGQL!
hourlyVolumeToken1: BigGQL!
hourlyVolumeUSD: BigGQL!
hourlyTxns: Int!
}
type TokenDayData {
id: String!
date: Int!
token: Token!
dailyVolumeToken: BigGQL!
dailyVolumeHYDRA: BigGQL!
dailyVolumeUSD: BigGQL!
dailyTxns: Int!
totalLiquidityToken: BigGQL!
totalLiquidityHYDRA: BigGQL!
totalLiquidityUSD: BigGQL!
priceUSD: BigGQL!
}
type Factory {
id: String!
factoryAddress: String!
pairCount: Int!
totalVolumeUSD: BigGQL!
totalVolumeHYDRA: BigGQL!
untrackedVolumeUSD: BigGQL!
totalLiquidityUSD: BigGQL!
totalLiquidityHYDRA: BigGQL!
txCount: Int!
}
type HydraswapDayData {
id: String!
date: Int!
dailyVolumeHYDRA: BigGQL!
dailyVolumeUSD: BigGQL!
dailyVolumeUntracked: BigGQL!
totalVolumeHYDRA: BigGQL!
totalLiquidityHYDRA: BigGQL!
totalVolumeUSD: BigGQL!
totalLiquidityUSD: BigGQL!
txCount: Int!
}
type SubgraphIndexingStatus {
health: String!
synced: Boolean!
chains: [HydraIndexingStatus!]!
}
type HydraIndexingStatus {
chainHeadBlock: Block!
latestBlock: Block!
}
type Query {
pairs(
block: ListPairBlockInput
where: ListPairInput
orderDirection: String
orderBy: String
skip: Int
first: Float
): [Pair!]!
pair(block: ListPairBlockInput, id: String!): Pair!
blocks(
orderDirection: String!
orderBy: String!
first: Float!
where: ListBlockInput!
): [Block!]
getTokens: [Token!]!
token(block: ListTokenBlockInput, id: String!): Token!
tokens(
orderDirection: String
orderBy: String
block: ListTokenBlockInput
where: ListTokenInput
skip: Int
first: Float
): [Token!]!
getLiquidityPositionById(id: String!): LiquidityPosition!
getLiquidityPositionByUser(userAddress: String!): [LiquidityPosition!]!
liquidityPositions(
first: Int!
orderDirection: String!
orderBy: String!
where: ListLiquidityPositionsInput!
): [LiquidityPosition!]!
liquidityPositionSnapshots: [LiquidityPositionSnapshot!]!
getSnapshotsByLiquidityPosition(
liquidityPosition: String!
): [LiquidityPositionSnapshot!]!
getSnapshotsByPair(pairAddress: String!): [LiquidityPositionSnapshot!]!
getSnapshotsByUser(userAddress: String!): [LiquidityPositionSnapshot!]!
users: [User!]!
bundle(block: ListBundleBlockInput, id: String!): Bundle!
bundles(where: ListBundleInput!, block: ListBundleBlockInput): [Bundle!]!
getPairDayDataById(id: String!): [PairHourData!]!
getPairDayDataByPair(pairAddress: String!): [PairHourData!]!
getPairDayDataByDay(day: String!): [PairDayData!]!
getPairDayDataByToken(token: String!): [PairDayData!]!
pairDayDatas(
where: ListPairDayDataInput!
orderDirection: String!
orderBy: String!
skip: Int
first: Float!
): [PairDayData!]!
getTokenDayData: [TokenDayData!]!
getTokenDayDataByToken(tokenAddress: String!): [TokenDayData!]!
tokenDayDatas(
where: ListTokenDayDataInput!
orderDirection: String!
orderBy: String!
skip: Int
first: Float!
): [TokenDayData!]!
getPairHourDatas: [PairHourData!]!
getPairDayDataByHour(hour: String!): [PairHourData!]!
getPairDayDataByHourStartUnix(hourStartUnix: String!): [PairHourData!]!
getMints: [Mint!]!
getMintByTx(txHash: String!): Mint!
mints(
where: ListMintInput
orderDirection: String!
orderBy: String!
first: Float!
): [Mint!]!
getTransactions: [Transaction!]!
getTransactionByTxHash(txHash: String!): Transaction!
getTransactionsByBlockNumber(blockNumber: String!): [Transaction!]!
transactions(
orderDirection: String!
orderBy: String!
first: Float!
): [Transaction!]!
getBurns: [Burn!]!
getBurnByTx(txHash: String!): Burn!
burns(
where: ListBurnInput
orderDirection: String!
orderBy: String!
first: Float!
): [Burn!]!
swaps(
where: ListSwapInput
orderDirection: String!
orderBy: String!
first: Float!
): [Swap!]!
getSwapByTx(txHash: String!): [Swap!]!
getSwapByPair(pairAddress: String!): [Swap!]!
getSwapByUser(userAddress: String!): [Swap!]!
factories: [Factory!]!
getFactoryByAddress(address: String!): Factory!
hydraswapFactories(
where: ListFactoryInput!
block: ListFactoryBlockInput
): [Factory!]!
getHydraswapDayDatas: [HydraswapDayData!]!
getHydraswapDayDataByDate(date: String!): HydraswapDayData!
getHydraswapDayDataById(id: String!): HydraswapDayData!
hydraswapDayDatas(
orderDirection: String!
orderBy: String!
where: ListHydraswapDayDataInput!
skip: Int!
first: Int!
): [HydraswapDayData!]!
indexingStatusForCurrentVersion: SubgraphIndexingStatus!
}
input ListPairBlockInput {
number: Float!
}
input ListPairInput {
id_in: [String!]
id: String
token0: String
token1: String
token0_in: [String!]
token1_in: [String!]
}
input ListBlockInput {
timestamp_gt: Int!
timestamp_lt: Int!
}
input ListTokenBlockInput {
number: Float!
}
input ListTokenInput {
id_in: [String!]
id: String
symbol_contains: String
name_contains: String
}
input ListLiquidityPositionsInput {
pair: String!
}
input ListBundleBlockInput {
number: Int!
}
input ListBundleInput {
id: String!
}
input ListPairDayDataInput {
pairAddress: String
}
input ListTokenDayDataInput {
date_gt: String
token: String
}
input ListMintInput {
pair_in: [String!]
}
input ListBurnInput {
pair_in: [String!]
}
input ListSwapInput {
pair_in: [String!]
}
input ListFactoryInput {
id: String!
}
input ListFactoryBlockInput {
number: Float!
}
input ListHydraswapDayDataInput {
date_gt: Int!
}

Endpoint Overview

Name
Category
Description
Indexing Status for Current Version
Health status for the graph server
Blocks
General block information and hydra price by block or timestamp
Bundles
Current hydra price (or by block number)
Burns
General information about liquidity burns on the exchange
Factories
General information about Hydra DEX factory like current volume, liqudity and pair numbers (up to two weeks history)
Day Data
Information about Hydra DEX factory by day, like daily volume, daily transactions count and liquidity
Mints
General information about the liquidity mint history on the exchange
Pairs
Information about Hydra DEX pairs like addresses, tokens a pair consist of, token reserves, token prices, volume etc... (up to one week)
Pair Day Data
Information about Hydra DEX pairs for particular days
Swaps
General information about token swaps on the exchange
Tokens
Information about pair tokens like address, symbol, decimals, total transaction count from the exchange pairs, total supply, trade volume etc... for current time or over last 2 days
Token Day Data
Information about a token pair for particular days
Transactions
General information about last 'x' number of swap, burn or mint transactions on Hydra DEX
Liqudity Positions
Information about top addresses liquidity positions on Hydra DEX pairs

Summary Endpoint

IndexingStatusForCurrentVersion
{
"data": {
"indexingStatusForCurrentVersion": {
"synced": true,
"health": "healthy",
"chains": [
{
"chainHeadBlock": {
"number": 241834,
"__typename": "Block"
},
"latestBlock": {
"number": 241834,
"__typename": "Block"
},
"__typename": "HydraIndexingStatus"
}
],
"__typename": "SubgraphIndexingStatus"
}
}
}
Name
Type
Description
data
Object
Default GraphQL response object
indexingStatusForCurrentVersion
Object
Name of GraphQL request query
synced
string
Health status of server:
healthy – server has all the information till current moment and its ready for work.
unhealthy - server is still syncing or failed to sync for some reason.
chains
Array
Current chain head block and server last block synced

Endpoint A1 (Blocks)

Parametes:
Name
Type
Description
where.timestamp_gt
int
Look for block greated than timestamp
where.timestamp_lt
int
Look for block lesser than timestamp
first
int
First 'x' number of block that is found
orderBy
string
Ordered by some field (usualy block number)
orderDirection
string
Order direction of blocks of returned responce
{
"data": {
"blocks": [
{
"id": "93506568085a1b0f2e6306db826fe5e1d799cde02a4f265855756dba33201e32",
"number": 241162,
"timestamp": 1636636320,
"hydraPrice": "15.042536939257017",
"__typename": "Block"
}
]
}
}
or multiple
{
"data": {
"t1636636312": [
{
"number": 241184,
"__typename": "Block"
}
],
"t1636549912": [
{
"number": 240509,
"__typename": "Block"
}
]
}
}
Blocks response descriptions:
Name
Type
Description
data
Object
Default GraphQL response object
blocks
Object
Name of GraphQL request query
id
string
Unique hash value of a block
number
number
Block height in the blockchain
timestamp
decimal
Timestamp of block mined time
hydraPrice
string
Hydra price for block number

Endpoint A2 (Bundles)

Parameters:
Name
Type
Description
block.number
int
Look for bundle by block number
where.id
string
Always value of 1
{
"data": {
"bundles": [
{
"id": "1",
"hydraPrice": "15.042536939257017",
"__typename": "Bundle"
}
]
}
}
Bundles responce description:
Name
Type
Description
data
Object
Default GraphQL response object
bundles
Object
Name of GraphQL request query
id
string
Bundle id – it is constant (always equals to 1)
hydraPrice
string
Current Hydra price or by block number

Endpoint A3 (Burns)

Parameters:
Name
Type
Description
where.pair_in
string
Look for burns that happened in a perticular pair
first
int
First 'x' number of burns that is found
orderBy
string
Ordered by some field
orderDirection
string
Order direction of returned responce
{
"data": {
"burns": [
{
"transaction": {
"txHash": "aec9359bfa952259ef33837a6b66a103fd2138e94f0946b1bfa6a940ef8288a6",
"timestamp": 1635955696,
"__typename": "Transaction"
},
"pair": {
"token0": {
"tokenAddress": "4ab26aaa1803daa638910d71075c06386e391147",
"symbol": "LOC",
"__typename": "Token"
},
"token1": {
"tokenAddress": "6d9115a21863ce31b44cd231e4c4ccc87566222f",
"symbol": "WHYDRA",
"__typename": "Token"
},
"__typename": "Pair"
},
"sender": "HHFdtHmnRW6vYxZ5vgAZkdtvtz8xuG6Xk3",
"liquidity": "6.07223061",
"amount0": "8.95868882",
"amount1": "4.14558088",
"amountUSD": "228.8899858177729923598998904770681",
"__typename": "Burn"
}
]
}
}
Burns response descriptions.
Name
Type
Description
data
Object
Default GraphQL response object
burns
Array
Name of GraphQL request query
transaction
Object
Transaction object with metadata for it like unique hash and timestamp
txHash
string
Hash of burn transaction
timestamp
int
Timestamp of burn transaction
pair
Object
Tokens pair/pool in which the burn transaction is linked to
token0
Object
One of the two tokens of which the pair/pool is created from
token1
Object
Second token of wihich the pair/pool is created from
tokenAddress
string
Blockchain address of the deployed HRC20 token
symbol
string
Symbol abbreviation of the deployed HRC20 token
sender
string
Address of the user who has executed the burn transaction
liquidity
string
Amount of LP tokens sent by the sender address to pair address to be burned
amount0
string
Amount of token0 to be released by pair address and sent to sender address
amount1
string
Amount of token1 to be released by pair address and sent to sender address
amountUSD
string
Amount of tokens converted to USD

Endpoint A4 (Factories)

Parameters:
Name
Type
Description
block.number
int
Looks for factory data by block number
where.id
int
Looks for factory by its contract address
{
"data": {
"hydraswapFactories": [
{
"id": "5a2a927bea6c5f4a48d4e0116049c1e36d52a528",
"totalVolumeUSD": "358685.06788043550968532958908",
"totalVolumeHYDRA": "20020.86112041",
"untrackedVolumeUSD": "7.411694177004923798240936043590744650931272062038152981943902e+30",
"totalLiquidityUSD": "178881.19973338456520281651928",
"totalLiquidityHYDRA": "12482.73786436",
"txCount": 468,
"pairCount": 10,
"__typename": "Factory"
}
]
}
}
Factories response descriptions:
Name
Type
Description
data
Object
Default GraphQL response object
hydraswapFactories
Array
Array that holds Hydra DEX Factory data information object on index 0
id
string
Contract address of the deployed factory
totalVolumeUSD
string
Total volume converted to USD that passed through factory pairs/pools till current moment or given block number
totalVolumeHYDRA
string
Total volume converted to HYDRA that passed through factory pairs/pools till current moment or given block number
untrackedVolumeUSD
string
Untracked volume converted to USD that passed through factory pairs/pools till current moment or given block number
totalLiquidityUSD
string
Total liqudity converted to USD that factory pairs/pools hold till current moment or given block number
totalLiquidityHYDRA
string
Total liqudity converted to HYDRA that factory pairs/pools hold till current moment or given block number
txCount
string
Total transactions count that went through factory pairs/pools till current moment or given block number
pairCount
string
Total pairs/pools count that factory holds till current moment or given block number

Endpoint A5 (Day Data)

Parameters:
Name
Type
Description
first
int
First 'x' number of day data that is found
skip
int
Skips 'x' number of day data
orderBy
string
Ordered by some field
orderDirection
string
Order direction of returned responce
{
"data": {
"hydraswapDayDatas": [
{
"id": "18946",
"date": 1636934400,
"totalVolumeUSD": "359861.80719992833508720906516",
"dailyVolumeUSD": "1176.73931949282540187947608",
"dailyVolumeHYDRA": "82.30170444",
"totalLiquidityUSD": "184483.66148170780114863117792",
"totalLiquidityHYDRA": "12660.88530596",
"__typename": "HydraswapDayData"
},
{
"id": "18947",
"date": 1637020800,
"totalVolumeUSD": "389879.18391747133351371801759",
"dailyVolumeUSD": "30017.37671754299842650895243",
"dailyVolumeHYDRA": "2168.65893338",
"totalLiquidityUSD": "411875.44901453406069810494792",
"totalLiquidityHYDRA": "30055.64978338",
"__typename": "HydraswapDayData"
},
{
"id": "18948",
"date": 1637107200,
"totalVolumeUSD": "389879.18391747133351371801759",
"dailyVolumeUSD": "0",
"dailyVolumeHYDRA": "0",
"totalLiquidityUSD": "403584.6405452823010114",
"totalLiquidityHYDRA": "30051.62228582",
"__typename": "HydraswapDayData"
}
]
}
}
Factories response description:
Name
Type
Description
data
Object
Default GraphQL response object
hydraswapDayDatas
Array
Array that holds Hydra DEX Day Data information objects by day
id
string
Day id composed of transaction timestamp diveded by 86400 and rounded to integer
date
int
Start of the day timestamp
totalVolumeUSD
string
Total volume converted in USD passed through Hydra DEX factory till current day
dailyVolumeUSD
string
Daily volume converted in USD passed through Hydra DEX factory
dailyVolumeHYDRA
string
Daily volume converted in HYDRA passed through Hydra DEX factory
totalLiqudityUSD
string
Total liquidity converted in USD tha Hydra DEX factory pairs hold till current day
totalLiqudityHYDRA
string
Total liquidity converted in HYDRA that Hydra DEX factory pairs hold till current day

Endpoint A6 (Mints)

Parameters:
Name
Type
Description
first
int
First 'x' number of mints that are found
where.pairs_in
Array
Array of pair addresses to check mints from
orderBy
string
Ordered by some field
orderDirection
string
Order direction of returned responce
{
"data": {
"mints": [
{
"transaction": {
"txHash": "ee987b550c130ff1945c7fb41e877f9ad9879c8dbb1744a5c720a5f1ad1bcdc9",
"timestamp": 1635909376,
"__typename": "Transaction"
},
"pair": {
"token0": {
"tokenAddress": "4ab26aaa1803daa638910d71075c06386e391147",
"symbol": "LOC",
"__typename": "Token"
},
"token1": {
"tokenAddress": "6d9115a21863ce31b44cd231e4c4ccc87566222f",
"symbol": "WHYDRA",
"__typename": "Token"
},
"__typename": "Pair"
},
"to": "HHFdtHmnRW6vYxZ5vgAZkdtvtz8xuG6Xk3",
"liquidity": "6.07223061",
"amount0": "9.28376418",
"amount1": "3.99999999",
"amountUSD": "594.7191850797705301743471178534177",
"__typename": "Mint"
}
]
}
}
Mints response description:
Name
Type
Description
data
Object
Default GraphQL response object
mints
Array
Name of GraphQL request query
transaction
Object
Transaction object with metadata for it like unique hash and timestamp
txHash
string
Hash of mint transaction
timestamp
int
Timestamp of mint transaction
pair
Object
Tokens pair/pool in which the mint transaction is linked to
token0
Object
One of the two tokens of which the pair/pool is created from
token1
Object
Second token of wihich the pair/pool is created from
tokenAddress
string
Blockchain address of the deployed HRC20 token
symbol
string
Symbol abbreviation of the deployed HRC20 token
to
string
Address of the user who has recieved the LP tokens
liquidity
string
Amount of newly minted LP tokens recieved by the user address from pair address
amount0
string
Amount of token0 to be locked in pair address by user address
amount1
string
Amount of token1 to be locked in pair address by user address
amountUSD
string
Amount of tokens converted to USD

Endpoint A7 (Pairs)

Parameters:
Name
Type
Description
first
int
First 'x' number of pairs that are found
skip
int
Skips 'x' number of pairs
where.id_in
Array
Array of pair addresses to get information for
where.id
string
Single pair address to get information for
where.token0
string
Single token address that pairs should hold as token0 in the contract
where.token1
string
Single token address that pairs should hold as token1 in the contract