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
Summary Endpoint
IndexingStatusForCurrentVersion
{
"data": {
"indexingStatusForCurrentVersion": {
"synced": true,
"health": "healthy",
"chains": [
{
"chainHeadBlock": {
"number": 241834,
"__typename": "Block"
},
"latestBlock": {
"number": 241834,
"__typename": "Block"
},
"__typename": "HydraIndexingStatus"
}
],
"__typename": "SubgraphIndexingStatus"
}
}
}
Endpoint A1 (Blocks)
Parametes:
{
"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:
Endpoint A2 (Bundles)
Parameters:
{
"data": {
"bundles": [
{
"id": "1",
"hydraPrice": "15.042536939257017",
"__typename": "Bundle"
}
]
}
}
Bundles responce description:
Endpoint A3 (Burns)
Parameters:
{
"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.
Endpoint A4 (Factories)
Parameters:
{
"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:
Endpoint A5 (Day Data)
Parameters:
{
"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:
Endpoint A6 (Mints)
Parameters:
{
"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:
Endpoint A7 (Pairs)
Parameters:
{
"data": {
"pairs": [
{
"pairAddress": "1f487cf98b69d4dc43592bca5b89751c146652ff",
"txCount": 94,
"token0": {
"tokenAddress": "6d9115a21863ce31b44cd231e4c4ccc87566222f",
"symbol": "WHYDRA",
"name": "Wrapped Hydra",
"totalLiquidity": "3275.92822728",
"derivedHYDRA": "1",
"__typename": "Token"
},
"token1": {
"tokenAddress": "7b8dd012ec9e1f11e008376ef21d29ba4cc78e24",
"symbol": "GOMT",
"name": "GoMeat",
"totalLiquidity": "65209.49501157",
"derivedHYDRA": "0.13251822883978420769",
"__typename": "Token"
},
"reserve0": "8641.44678247",
"reserve1": "65209.49501157",
"reserveUSD": "347951.7583316664736847482572914729",
"totalSupply": "95736.74797472",
"trackedReserveHYDRA": "17282.89356494",
"reserveHYDRA": "17282.8935649400000001163198329733",
"volumeUSD": "29155.34392696878264625759235",
"untrackedVolumeUSD": "9153015.614500110481274498874262316",
"token0Price": "0.13251822883978420769",
"token1Price": "7.54613164358700764229",
"createdAtTimestamp": 1636832048,
"__typename": "Pair"
}
]
}
}
Pairs response description:
Endpoint A8 (Day Pair Data)
Parameters:
{
"data": {
"pairDayDatas": [
{
"id": "dc7ba676dc8ded3b476ee6d25a4571002964321e-18947",
"date": 1637020800,
"dailyVolumeToken0": "278.47760389",
"dailyVolumeToken1": "67.26289722",
"dailyVolumeUSD": "934.32585451049780660854624",
"reserveUSD": "282220.6776219950517036714504472221",
"__typename": "PairDayData"
},
{
"id": "dc7ba676dc8ded3b476ee6d25a4571002964321e-18948",
"date": 1637107200,
"dailyVolumeToken0": "162.70434047",
"dailyVolumeToken1": "40",
"dailyVolumeUSD": "548.15045022555536",
"reserveUSD": "270818.7301208406840840287689589212",
"__typename": "PairDayData"
}
]
}
}
Pair Day Data response description:
Endpoint A9 (Swaps)
Parameters:
{
"data": {
"swaps": [
{
"transaction": {
"txHash": "17947e682246e296c43486e403fe1c4288d9d27c1c97b057e926311856a52d0e",
"timestamp": 1636037536,
"__typename": "Transaction"
},
"id": "17947e682246e296c43486e403fe1c4288d9d27c1c97b057e926311856a52d0e-0",
"pair": {
"token0": {
"tokenAddress": "4ab26aaa1803daa638910d71075c06386e391147",
"symbol": "LOC",
"__typename": "Token"
},
"token1": {
"tokenAddress": "6d9115a21863ce31b44cd231e4c4ccc87566222f",
"symbol": "WHYDRA",
"__typename": "Token"
},
"__typename": "Pair"
},
"amount0In": "1500",
"amount0Out": "0",
"amount1In": "0",
"amount1Out": "528.15065251",
"amountUSD": "6568.55724026305028378063235",
"to": "H6ssQa8tGEqazq5BbGgaKKAjvCmHgLWMKG",
"__typename": "Swap"
}
]
}
}
Endpoint A10 (Tokens)
Parameters:
{
"data": {
"tokens": [
{
"id": "4ab26aaa1803daa638910d71075c06386e391147",
"name": "LockTrip",
"symbol": "LOC",
"derivedHYDRA": "0.24670083962341685214",
"tradeVolume": "59919.7993523",
"tradeVolumeUSD": "361249.76600571377050862229743",
"untrackedVolumeUSD": "4.641666930948025425202765473435793e+25",
"totalLiquidity": "24627.61879609",
"txCount": 472,
"__typename": "Token"
},
{
"id": "6d9115a21863ce31b44cd231e4c4ccc87566222f",
"name": "Wrapped Hydra",
"symbol": "WHYDRA",
"derivedHYDRA": "1",
"tradeVolume": "22534.01459216",
"tradeVolumeUSD": "393429.00696961071684379051813",
"untrackedVolumeUSD": "4.078102090490297843129053769621566e+31",
"totalLiquidity": "3166.43539335",
"txCount": 592,
"__typename": "Token"
}
]
}
}
Endpoint A11 (Token Day Data)
Parameters:
{
"data": {
"tokenDayDatas": [
{
"id": "4ab26aaa1803daa638910d71075c06386e391147-18947",
"date": 1637020800,
"priceUSD": "4.496803945523902310997723294336857",
"totalLiquidityToken": "24798.59218395",
"totalLiquidityUSD": "83962.89571994544054461579985268684",
"totalLiquidityHYDRA": "6039.164192901680059650670124808",
"dailyVolumeHYDRA": "67.6474091746756411462788909687",
"dailyVolumeToken": "278.47760389",
"dailyVolumeUSD": "1369.195051861220383034884996311406",
"__typename": "TokenDayData"
},
{
"id": "4ab26aaa1803daa638910d71075c06386e391147-18948",
"date": 1637107200,
"priceUSD": "4.491830518875072979303273998973722",
"totalLiquidityToken": "24627.61879609",
"totalLiquidityUSD": "83259.31510716658890447419372476519",
"totalLiquidityHYDRA": "6075.6542349208455050723243401326",
"dailyVolumeHYDRA": "40.1392974043232820953222081058",
"dailyVolumeToken": "162.70434047",
"dailyVolumeUSD": "550.0593485979318175551753679394968",
"__typename": "TokenDayData"
}
]
}
}
Endpoint A12 (Transactions)
Parameters:
{
"data": {
"transactions": [
{
"mints": [
{
"transaction": {
"txHash": "4c5e91be0dfa64c6e6885a03edce977827d80e4d79ef877454d90df068a98ad2",
"timestamp": 1637027328,
"__typename": "Transaction"
},
"pair": {
"token0": {
"tokenAddress": "6d9115a21863ce31b44cd231e4c4ccc87566222f",
"symbol": "WHYDRA",
"__typename": "Token"
},
"token1": {
"tokenAddress": "7b8dd012ec9e1f11e008376ef21d29ba4cc78e24",
"symbol": "GOMT",
"__typename": "Token"
},
"__typename": "Pair"
},
"to": "HLhspJPd76shxFAUCQnxkHafr6MWzPgLv6",
"liquidity": "12.12363183",
"amount0": "3.99999999",
"amount1": "36.88112963",
"amountUSD": "387.4988298778651280812833761830751",
"__typename": "Mint"
}
],
"burns": [],
"swaps": [],
"__typename": "Transaction"
},
{
"mints": [],
"burns": [],
"swaps": [
{
"transaction": {
"txHash": "b05dbca0ff16fb54ffcc90cd89024566fe96d324ddff69d623696be60f229ba5",
"timestamp": 1637024688,
"__typename": "Transaction"
},
"pair": {
"token0": {
"tokenAddress": "6d9115a21863ce31b44cd231e4c4ccc87566222f",
"symbol": "WHYDRA",
"__typename": "Token"
},
"token1": {
"tokenAddress": "7b8dd012ec9e1f11e008376ef21d29ba4cc78e24",
"symbol": "GOMT",
"__typename": "Token"
},
"__typename": "Pair"
},
"amount0In": "30.29",
"amount0Out": "0",
"amount1In": "0",
"amount1Out": "279.52827222",
"amountUSD": "418.5892011919932964",
"to": "HCY4wMv2nFbA6iFy1iUKxT5rRJv6tnLM4f",
"__typename": "Swap"
}
],
"__typename": "Transaction"
}
]
}
}
Endpoint A13 (Liquidity)
In works
Last updated