DeFI APIs
Easiest way to read defi data on Solana.
Defi data on Solana is scattered across multiple dexes, making it very difficult to work with. In order to read, one needs to handle each DEX separately, either through its SDK or raw RPC calls. Some functionality is notoriously slow since we need to use `getProgramAccounts` RPC call.
Enter Shyft Defi APIs
Accurate defi data across multiple dexes at blazingly fast speeds.
A simple call to fetch all pools of a token can take ~10 seconds or more, with the new Defi APIs it be done in under 500ms. Moreover all pools are returned in a parsed format, so you don't have to deal with IDLs on your end.
Following DEXs are supported by DeFi APIs currently.
DEX Name | Address |
---|---|
fluxbeam | FLUXubRmkEi2q6K3Y9kBPg9248ggaZVsoSFhtJHSrm1X |
meteoraAmm | Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB |
meteoraDlmm | LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo |
openbookV2 | opnb2LAfJYbRMAHHvqjCwQxanZn7ReEHp1k81EohpZb |
orca | whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc |
raydiumAmm | 675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8 |
raydiumClmm | CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK |
raydiumCpmm | CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C |
Base URL for DeFi APIs: https://defi.shyft.to
Get Pool By Address
Accepts a pool address and returns all pool details including the DEX to which it belongs to.
GET /v0/pools/get_by_address
Query Params:
address: Address of the pool for which we want to fetch data. We automatically detect which dex this pools belongs to and parse accordingly.
const myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("x-api-key", "<YOUR-API-KEY>");
const requestOptions = {
method: "GET",
headers: myHeaders,
redirect: "follow"
};
fetch("https://defi.shyft.to/v0/pools/get_by_address?address=cHR79RPHM8PKMN1vkoetC3PSofXCUXnd92nPeKvhvom", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));
{
"success": true,
"message": "Pool fetched successfully",
"result": {
"dex": "orca",
"programId": "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc",
"poolInfo": {
"whirlpoolsConfig": "2LecshUwdy9xi7meFgHtFJQNSKk4KdTrcpvaB56dP2NQ",
"whirlpoolBump": [
255
],
"tickSpacing": 256,
"tickSpacingSeed": [
0,
1
],
"feeRate": 20000,
"protocolFeeRate": 1300,
"liquidity": 0,
"sqrtPrice": 5.852265938261555e+21,
"tickCurrentIndex": 115199,
"protocolFeeOwedA": 0,
"protocolFeeOwedB": 0,
"tokenMintA": "So11111111111111111111111111111111111111112",
"tokenVaultA": "3ftEP3LhbrK6pCMJ7CmbLrpeghKbQigySs7LcnssoPLf",
"feeGrowthGlobalA": 14160276998311468,
"tokenMintB": "5ZCFjVZyNw8yUuYfBcqTJ2EVCfkXx7ZcHUgYyurbywMr",
"tokenVaultB": "CXg5EMwdi2jBQunQQVon24ETGsNa3NBHBfCjrfsG6r7o",
"feeGrowthGlobalB": 618434501757853800000,
"rewardLastUpdatedTimestamp": 1712398469,
"rewardInfos": [
{
"authority": "DjDsi34mSB66p2nhBL6YvhbcLtZbkGfNybFeLDjJqxJW",
"emissionsPerSecondX64": "0",
"growthGlobalX64": "0",
"mint": "11111111111111111111111111111111",
"vault": "11111111111111111111111111111111"
},
{
"authority": "DjDsi34mSB66p2nhBL6YvhbcLtZbkGfNybFeLDjJqxJW",
"emissionsPerSecondX64": "0",
"growthGlobalX64": "0",
"mint": "11111111111111111111111111111111",
"vault": "11111111111111111111111111111111"
},
{
"authority": "DjDsi34mSB66p2nhBL6YvhbcLtZbkGfNybFeLDjJqxJW",
"emissionsPerSecondX64": "0",
"growthGlobalX64": "0",
"mint": "11111111111111111111111111111111",
"vault": "11111111111111111111111111111111"
}
],
"pubkey": "cHR79RPHM8PKMN1vkoetC3PSofXCUXnd92nPeKvhvom",
"lamports": 5435760,
"_updatedAt": "2024-09-04T20:28:28.265093Z"
}
}
}
Get Pools by Token Pair
Takes a pair of token addresses and returns all pools across DEXs with the specified liquidity pair. This API supports pagination and can also filter pools to a specific DEX if needed.
GET /v0/pools/get_by_pair
Query Params:
tokenA: Address of one of the Tokens in the Pair.
tokenB: Address of the other Token in the Liquidity Pair. The order of the token does not matter.
dex: (optional) Specifies an array of DEXes (string names) for which we will be receiving the pools.
limit: (optional) Specifies the number of items to display per page. The default value is 100.
page: (optional) Specifies the page number when displaying items specified by limit.
Let's say we want to fetch 50 pools from a particular DEX. We would set the limit
parameter to 50 and the page
parameter to 1. To get the next 50 pools, we would keep the limit
at 50 but increase the page
to 2.
To get the 5th set of 50 pools, we'd set the limit
to 50 and the page
to 5.
If a DEX doesn't have enough pools for a specific page, it will return an empty response.
const myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("x-api-key", "<YOUR-API-KEY>");
const requestOptions = {
method: "GET",
headers: myHeaders,
redirect: "follow"
};
fetch("https://defi.shyft.to/v0/pools/get_by_pair?tokenA=So11111111111111111111111111111111111111112&tokenB=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&page=1&limit=10", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));
{
"success": true,
"message": "Pools fetched successfully",
"result": {
"page": 1,
"limit": 10, //response shortened
"dexes": {
"fluxbeam": {
"pools": [
{
"version": 1,
"isInitialized": 1,
"bumpSeed": 255,
"poolTokenProgramId": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb",
"tokenAccountA": "6Mstdw2bFRpsu8QtwZb7u1waHmSbWMnT2SDhs4kaMG32",
"TokenAccountB": "3bXv4ztf78aCpsqcL9ncNvrkWr1XcF1vvYzG1SKVrDW1",
"tokenPool": "GDX61hU9HdW45LgQ36tzXYDQVMLyRjWX1tpAKyvSgxgR",
"mintA": "So11111111111111111111111111111111111111112",
"mintB": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"feeAccouunt": "AfC9vs3F2g2uUfAoAeU74rt8No5Ytm8aQdAbrgUgHvr9",
"tradeFeeNumerator": 20,
"tradeFeeDenominator": 1000,
"ownerTradeFeeNumerator": 5,
"ownerTradeFeeDenominator": 1000,
"ownerWithdrawFeeNumerator": 0,
"ownerWithdrawFeeDenominator": 1000,
"hostFeeNumerator": 20,
"hostFeeDenominator": 1000,
"curveType": 0,
"curveParameters": "{\"type\":\"Buffer\",\"data\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}",
"pubkey": "CZEZDGDkzsn4zTfdw6XRm4U1o6GatotMhhRmVEzdwGS3",
"lamports": 3145920,
"_updatedAt": "2024-05-29T08:42:59.78Z"
}
],
"programId": "FLUXubRmkEi2q6K3Y9kBPg9248ggaZVsoSFhtJHSrm1X"
},
"meteoraAmm": {
"pools": [
{
"lpMint": "EydaSJmYgYh4Xub5nq8R7GTuwT2L2jLTw94CXpt63Lf9",
"tokenAMint": "So11111111111111111111111111111111111111112",
"tokenBMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"aVault": "FERjPVNEa7Udq8CEv68h6tPL46Tq7ieE49HrE2wea3XT",
"bVault": "3ESUFCnRNgZ7Mn2mPPUMmXYaKU8jpnV9VtA17M7t2mHQ",
"aVaultLp": "CpLW813hiVHWVrssx3HcUCvu7kJ1rakEBdrKzyAaMbd4",
"bVaultLp": "B91CQTDW6Brix1ybhrwchr3t5QsZPnfqG4CKjAxPMcw9",
"aVaultBump": 255,
"enabled": true,
"adminTokenAFee": "BB47VB2m4Us2hhixF27rxPzkgGUcqX86d6NVgbZLUHD6",
"adminTokenBFee": "BouVFMjp2FLC5bYTh5x277NaMSaZFqt5FYcd6B66Y59y",
"admin": "5unTfT2kssBuNvHPY6LbJfJpLqEcdMxGYLWHwShaeTLi",
"fees": {
"ownerTradeFeeDenominator": "100000",
"ownerTradeFeeNumerator": "0",
"tradeFeeDenominator": "100000",
"tradeFeeNumerator": "40"
},
"poolType": {
"permissionless": {}
},
"stake": "11111111111111111111111111111111",
"totalLockedLp": 0,
"curveType": {
"stable": {
"amp": "100",
"depeg": {
"baseCacheUpdated": "0",
"baseVirtualPrice": "0",
"depegType": {
"none": {}
}
},
"lastAmpUpdatedTimestamp": "0",
"tokenMultiplier": {
"precisionFactor": 9,
"tokenAMultiplier": "1",
"tokenBMultiplier": "1000"
}
}
},
"pubkey": "4u6zAdnwt39uPtuDkAiCrYU1C2oGj66dTahrqv6BfGP4",
"_lamports": 7461120,
"_updatedAt": "2024-10-22T16:11:33.666Z"
}
],
"programId": "Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB"
},
"openbookV2": {
"pools": [
{
"pubkey": "6MtzKJytr6EgyGVQefP2TJBUH75aBMqwA5Zp7yukNJmL",
"lamports": 6792960,
"bump": 255,
"baseDecimals": 9,
"quoteDecimals": 6,
"padding1": 0,
"marketAuthority": "5AvWpZvN84LX49DSwoKGFGBxbtYZsx6BxiVszXShxTQr",
"timeExpiry": 0,
"collectFeeAdmin": "ob2htHLoCu2P6tX7RrNVtiG1mYTas8NGJEVLaFEUngk",
"openOrdersAdmin": {
"key": "11111111111111111111111111111111"
},
"consumeEventsAdmin": {
"key": "11111111111111111111111111111111"
},
"closeMarketAdmin": {
"key": "ob2htHLoCu2P6tX7RrNVtiG1mYTas8NGJEVLaFEUngk"
},
"name": 83,
"bids": "21byvGA4qEGFwZoyizb4avPtP5Ys7zLAqfocpLg4vvPF",
"asks": "8sC8MSHZkqUpwdeVpovyA3M66Gf4zf1hvL84vyJ1ZtZ",
"eventHeap": "4B141dhuPyS2ThK67tY1K1Qa8zTDFt9Gy7XWwEKkf2UW",
"oracleA": {
"key": "11111111111111111111111111111111"
},
"oracleB": {
"key": "11111111111111111111111111111111"
},
"oracleConfig": {
"confFilter": "0.10000000149011612",
"maxStalenessSlots": "100",
"reserved": 0
},
"quoteLotSize": 100,
"baseLotSize": 10000000,
"seqNum": 0,
"registrationTime": 1711625075,
"makerFee": 1000,
"takerFee": 1000,
"feesAccrued": 0,
"feesToReferrers": 0,
"referrerRebatesAccrued": 0,
"feesAvailable": 0,
"makerVolume": 0,
"takerVolumeWoOo": 0,
"baseMint": "So11111111111111111111111111111111111111112",
"quoteMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"marketBaseVault": "7uYgEqTeqZBdGwab1Qv7zen3PJxw6DErLY4iyC5ekoqb",
"baseDepositTotal": 0,
"marketQuoteVault": "AJwJS6mCE5Y3CeQ7eEtA9eLhWe7EUSrdPL3W57UiC1Qh",
"quoteDepositTotal": 0,
"reserved": 0,
"_updatedAt": "2024-04-10T08:50:27.621Z"
}
],
"programId": "opnb2LAfJYbRMAHHvqjCwQxanZn7ReEHp1k81EohpZb"
},
"orca": {
"pools": [
{
"whirlpoolsConfig": "2LecshUwdy9xi7meFgHtFJQNSKk4KdTrcpvaB56dP2NQ",
"whirlpoolBump": [
255
],
"tickSpacing": 8,
"tickSpacingSeed": [
8,
0
],
"feeRate": 500,
"protocolFeeRate": 1,
"liquidity": 4333114772458,
"sqrtPrice": 7955113484095176000,
"tickCurrentIndex": -16823,
"protocolFeeOwedA": 14537046,
"protocolFeeOwedB": 2077779,
"tokenMintA": "So11111111111111111111111111111111111111112",
"tokenVaultA": "9RfZwn2Prux6QesG1Noo4HzMEBv3rPndJ2bN2Wwd6a7p",
"feeGrowthGlobalA": 24043789596251267000,
"tokenMintB": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"tokenVaultB": "BVNo8ftg2LkkssnWT4ZWdtoFaevnfD6ExYeramwM27pe",
"feeGrowthGlobalB": 1089920830426709200,
"rewardLastUpdatedTimestamp": 1730904586,
"rewardInfos": [
{
"authority": "DjDsi34mSB66p2nhBL6YvhbcLtZbkGfNybFeLDjJqxJW",
"emissionsPerSecondX64": "0",
"growthGlobalX64": "1366725375216936208",
"mint": "orcaEKTdK7LKz57vaAYr9QeNsVEPfiu6QeMU1kektZE",
"vault": "5aN8t512S6WQEHnwXMZADP57oJWekVw892MnhJ7XYm1P"
},
{
"authority": "DjDsi34mSB66p2nhBL6YvhbcLtZbkGfNybFeLDjJqxJW",
"emissionsPerSecondX64": "0",
"growthGlobalX64": "0",
"mint": "11111111111111111111111111111111",
"vault": "11111111111111111111111111111111"
},
{
"authority": "DjDsi34mSB66p2nhBL6YvhbcLtZbkGfNybFeLDjJqxJW",
"emissionsPerSecondX64": "0",
"growthGlobalX64": "0",
"mint": "11111111111111111111111111111111",
"vault": "11111111111111111111111111111111"
}
],
"pubkey": "7qbRF6YsyGuLUVs6Y1q64bdVrfe4ZcUUz1JRdoVNUJnm",
"lamports": 997698302,
"_updatedAt": "2024-11-06T14:49:47.64Z"
}
],
"programId": "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc"
},
"raydiumAmm": {
"pools": [
{
"pubkey": "GUZWuwD2qhuGZ13PVtTH9yJrB1kGEExN8YBVDiaS7DmL",
"lamports": 6124800,
"status": 6,
"nonce": 254,
"maxOrder": 7,
"depth": 3,
"baseDecimal": 9,
"quoteDecimal": 6,
"state": 2,
"resetFlag": 0,
"minSize": 1000000000,
"volMaxCutRatio": 500,
"amountWaveRatio": 0,
"baseLotSize": 1000000000,
"quoteLotSize": 10000000,
"minPriceMultiplier": 1,
"maxPriceMultiplier": 1000000000,
"systemDecimalValue": 1000000000,
"minSeparateNumerator": 5,
"minSeparateDenominator": 10000,
"tradeFeeNumerator": 25,
"tradeFeeDenominator": 10000,
"pnlNumerator": 12,
"pnlDenominator": 100,
"swapFeeNumerator": 25,
"swapFeeDenominator": 10000,
"baseNeedTakePnl": 82870,
"quoteNeedTakePnl": 1792,
"quoteTotalPnl": 14940,
"baseTotalPnl": 690590,
"poolOpenTime": 1683581973,
"punishPcAmount": 0,
"punishCoinAmount": 0,
"orderbookToInitTime": 0,
"swapBaseInAmount": 341096376543,
"swapQuoteOutAmount": 7034258204,
"swapBase2QuoteFee": 17589816,
"swapQuoteInAmount": 7035733864,
"swapBaseOutAmount": 341544296833,
"swapQuote2BaseFee": 852741273,
"baseVault": "3ieB79dHTcfBQtDtVrdBToWhytpheJF6HTkHcJVZ9CgH",
"quoteVault": "gRRwgkTD2CYa7uqhde6GguiM746qgyGhgC4eoyoLuaS",
"baseMint": "So11111111111111111111111111111111111111112",
"quoteMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"lpMint": "8UqHbFufcpyAFTGyXF3s2Jrb6sWeyRAj8RZbiZ4cGM6G",
"openOrders": "2VcMb6coXASiqpoqvoikgM1bSbFGt739REJi5JJ3siPM",
"marketId": "FTm9NDDWuBXeVfvVgxQ37XNvWdLvrxxShdfSmeZiq8xB",
"marketProgramId": "srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX",
"targetOrders": "Ffr7BTny8taS3Mivx8PbVwL5hVEQozqV7Y291tWkBRDE",
"withdrawQueue": "11111111111111111111111111111111",
"lpVault": "11111111111111111111111111111111",
"owner": "GThUX1Atko4tqhN2NaiTazWSeFWMuiUvfFnyJyUghFMJ",
"lpReserve": 1000000,
"padding": [
0,
694,
0
],
"_updatedAt": "2024-11-06T12:03:59.711Z"
}
],
"programId": "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"
},
"raydiumClmm": {
"pools": [
{
"bump": [
254
],
"ammConfig": "9EeWRCL8CJnikDFCDzG8rtmBs5KQR1jEYKCR5rRZ2NEi",
"owner": "HqDGLMCEEP4XBRjrQ9k3QxTUtRnWUXn5GN29NwetcwLK",
"tokenMint0": "So11111111111111111111111111111111111111112",
"tokenMint1": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"tokenVault0": "6PqdCQ9tqhfG4dt7a8MCKLBzdcXxeBgHqVs8BdWxPcQY",
"tokenVault1": "CsWhij2EZYT6WaHQUFJyPNqQUSnLEC1G9whSBdwy9wob",
"observationKey": "5o2Gu2FxDuQDZrmvVLoFPnBx4Yn1UTKXwZBzhQZyrM85",
"mintDecimals0": 9,
"mintDecimals1": 6,
"tickSpacing": 1,
"liquidity": 209592497,
"sqrtPriceX64": 7959168357173569000,
"tickCurrent": -16813,
"observationIndex": 0,
"observationUpdateDuration": 0,
"feeGrowthGlobal0X64": 517846876068501570,
"feeGrowthGlobal1X64": 78449053283502140,
"protocolFeesToken0": 3067298,
"protocolFeesToken1": 537456,
"swapInAmountToken0": 4705295410001,
"swapOutAmountToken0": 705817082734,
"swapInAmountToken1": 707692755939,
"swapOutAmountToken1": 4714360720785,
"status": 0,
"rewardInfos": [
{
"authority": "HqDGLMCEEP4XBRjrQ9k3QxTUtRnWUXn5GN29NwetcwLK",
"emissionsPerSecondX64": "0",
"endTime": "0",
"lastUpdateTime": "0",
"openTime": "0",
"rewardClaimed": "0",
"rewardGrowthGlobalX64": "0",
"rewardState": 0,
"rewardTotalEmissioned": "0",
"tokenMint": "11111111111111111111111111111111",
"tokenVault": "11111111111111111111111111111111"
},
{
"authority": "HqDGLMCEEP4XBRjrQ9k3QxTUtRnWUXn5GN29NwetcwLK",
"emissionsPerSecondX64": "0",
"endTime": "0",
"lastUpdateTime": "0",
"openTime": "0",
"rewardClaimed": "0",
"rewardGrowthGlobalX64": "0",
"rewardState": 0,
"rewardTotalEmissioned": "0",
"tokenMint": "11111111111111111111111111111111",
"tokenVault": "11111111111111111111111111111111"
},
{
"authority": "HqDGLMCEEP4XBRjrQ9k3QxTUtRnWUXn5GN29NwetcwLK",
"emissionsPerSecondX64": "0",
"endTime": "0",
"lastUpdateTime": "0",
"openTime": "0",
"rewardClaimed": "0",
"rewardGrowthGlobalX64": "0",
"rewardState": 0,
"rewardTotalEmissioned": "0",
"tokenMint": "11111111111111111111111111111111",
"tokenVault": "11111111111111111111111111111111"
}
],
"tickArrayBitmap": [
0,
8192,
33554432,
536870912,
32
],
"totalFeesToken0": 1186028533,
"totalFeesClaimedToken0": 641151081,
"totalFeesToken1": 178501164,
"totalFeesClaimedToken1": 92020280,
"fundFeesToken0": 21529486,
"fundFeesToken1": 3458594,
"openTime": 1722943672,
"pubkey": "7PLpcezEnTV2xXU6eL3j4kLi9MJJFUngsWQvUNKyjE2V",
"lamports": 11637120,
"_updatedAt": "2024-11-06T14:48:58.72Z"
}
],
"programId": "CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK"
},
"raydiumCpmm": {
"pools": [
{
"ammConfig": "2fGXL8uhqxJ4tpgtosHZXT4zcQap6j62z3bMDxdkMvy5",
"poolCreator": "4xSZEyiAw2NCxr4vYPxY6qeyvSzAeo9wjMW6shFH8haq",
"token0Vault": "6FghY4izwEJ4dq4jVLgbiQeJQBxAHQcyFEbH3ePNqAPw",
"token1Vault": "4kVkYx1ZL2BS5ndNBDCv6AUrmXj7q5wtQhiCaY1UXo9u",
"lpMint": "4wETSJG3woeMzonzp3xRHZdc9TzzTQdZPyoGHWE6ALC4",
"token0Mint": "So11111111111111111111111111111111111111112",
"token1Mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"token0Program": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"token1Program": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"observationKey": "Ckw9LZj6JZvQGg7cFq394ewu8zuundgNuaM3kqeY4MrL",
"authBump": 253,
"status": false,
"lpMintDecimals": 9,
"mint0Decimals": 9,
"mint1Decimals": 6,
"lpSupply": 100,
"protocolFeesToken0": 399,
"protocolFeesToken1": 10041,
"fundFeesToken0": 133,
"fundFeesToken1": 3347,
"openTime": 1723744072,
"pubkey": "Hx6EoXCzvYzcdtTvEm2QsXUFVe9pJzhH9FuMxmLw589D",
"lamports": 5324400,
"_updatedAt": "2024-11-01T18:47:19.313Z"
}
],
"programId": "CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C"
}
}
}
}
Get All Pools For a Token
Accepts a single token address, and fetche all pools for that particular token across supported DEXes. This API also supports pagination.
GET /v0/pools/get_by_token
Query Params:
token: Address of the token for which we are fetching pools.
limit: (optional) Specifies the number of items to display per page. The default value is 100.
page: (optional) Specifies the page number when displaying items specified by limit.
Let's say we want to fetch 50 pools from a particular DEX. We would set the limit
parameter to 50 and the page
parameter to 1. To get the next 50 pools, we would keep the limit
at 50 but increase the page
to 2.
To get the 5th set of 50 pools, we'd set the limit
to 50 and the page
to 5. If a DEX doesn't have enough pools for a specific page, it will return an empty response.
const myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("x-api-key", "<YOUR-API-KEY>");
const requestOptions = {
method: "GET",
headers: myHeaders,
redirect: "follow"
};
fetch("https://defi.shyft.to/v0/pools/get_by_token?token=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&page=1&limit=10", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));
{
"success": true,
"message": "Pools fetched successfully",
"result": {
"page": 1,
"limit": 1,
"dexes": {
"fluxbeam": {
"pools": [
{
"version": 1,
"isInitialized": 1,
"bumpSeed": 255,
"poolTokenProgramId": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb",
"tokenAccountA": "6ZtopVUYLKuQPq7VnY2B9sUSazB9JHzuLuTJbQ4ScFWj",
"TokenAccountB": "3He9T9hfdzzRMDKwdw1d4Yf49K48ZWcgJBt3QBxYwwPu",
"tokenPool": "5MknxczbktqmMRpdQ3awBoLyw3Pn2dwuBaBMr1LKjA5n",
"mintA": "HDnNLYDyXwSXusAAuf4iGkLs2apz5eEYQP9dHmRmypoy",
"mintB": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"feeAccouunt": "5CBPaQ1EhUixz3EFLDWzzJc4FiUjk1ZHNKDGpJpTjvbx",
"tradeFeeNumerator": 20,
"tradeFeeDenominator": 1000,
"ownerTradeFeeNumerator": 5,
"ownerTradeFeeDenominator": 1000,
"ownerWithdrawFeeNumerator": 0,
"ownerWithdrawFeeDenominator": 0,
"hostFeeNumerator": 20,
"hostFeeDenominator": 1000,
"curveType": 0,
"curveParameters": "{\"type\":\"Buffer\",\"data\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}",
"pubkey": "75AT5Xgrz6muMRGNctDavEcN1Ho2SP6n897zzs33LEPJ",
"lamports": 3145920,
"_updatedAt": "2024-05-29T08:42:59.297Z"
}
],
"programId": "FLUXubRmkEi2q6K3Y9kBPg9248ggaZVsoSFhtJHSrm1X"
},
"meteoraAmm": {
"pools": [
{
"lpMint": "9ZgdREVJDG5apT7gPt6CAPBYvfhUcDecFUvbXaxoKunj",
"tokenAMint": "7Z3thA2ZmMuapEmEGiB6rxoYmDDnnEv717NydgeoXhex",
"tokenBMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"aVault": "6Fzmt8UixGEK6sJkjc6ET2VUqK3wkvBoJGHB85J2ek7M",
"bVault": "3ESUFCnRNgZ7Mn2mPPUMmXYaKU8jpnV9VtA17M7t2mHQ",
"aVaultLp": "8gyv8AwYqCNKC2FkFMzZy4pPeQazM9Svad29XcXDYcrk",
"bVaultLp": "9C7fTkTBczhsdhjNWSJdLX27gSizyoTHdmQAVH1ZNZgg",
"aVaultBump": 255,
"enabled": true,
"adminTokenAFee": "7UsYbee9gpHSv3DSg2LnuHUU7AX1bRPDmGcv3NQaiDYq",
"adminTokenBFee": "BLcDGLJXrc2WyRxa36StWZFPULtxSM9nPE4WCoycrM6h",
"admin": "5unTfT2kssBuNvHPY6LbJfJpLqEcdMxGYLWHwShaeTLi",
"fees": {
"ownerTradeFeeDenominator": "100000",
"ownerTradeFeeNumerator": "0",
"tradeFeeDenominator": "100000",
"tradeFeeNumerator": "4000"
},
"poolType": {
"permissionless": {}
},
"stake": "11111111111111111111111111111111",
"totalLockedLp": 0,
"curveType": {
"constantProduct": {}
},
"pubkey": "FwpaUdQiEpLBVXZw542N9NzkiHmCJY1FJPEChH2K2Gt4",
"_lamports": 7461120,
"_updatedAt": null
}
],
"programId": "Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB"
},
"openbookV2": {
"pools": [
{
"pubkey": "2ZNDYtUpfenGZcjhcrQeNJ8Bs4ecVJKQEE4oNBCkejxj",
"lamports": 6792960,
"bump": 255,
"baseDecimals": 9,
"quoteDecimals": 6,
"padding1": 0,
"marketAuthority": "BY68afooPNzRE6n9iQmpGwioLU7fzAfUsMXmThjmkYa9",
"timeExpiry": 1713753898,
"collectFeeAdmin": "7ihN8QaTfNoDTRTQGULCzbUT3PHwPDTu5Brcu4iT2paP",
"openOrdersAdmin": {
"key": "7ihN8QaTfNoDTRTQGULCzbUT3PHwPDTu5Brcu4iT2paP"
},
"consumeEventsAdmin": {
"key": "11111111111111111111111111111111"
},
"closeMarketAdmin": {
"key": "7ihN8QaTfNoDTRTQGULCzbUT3PHwPDTu5Brcu4iT2paP"
},
"name": 80,
"bids": "66uPx4upzDV8U8625M27FRuaNWywgyEGCb7Wi1XRY32X",
"asks": "AsTo6bRuTWBaFm8t1fAA59zKbS37HzfefpSVeitLsWa9",
"eventHeap": "GuezGsXdm86B615mdGZwmGrb6qemG3bEj4CCnaPkKH87",
"oracleA": {
"key": "11111111111111111111111111111111"
},
"oracleB": {
"key": "11111111111111111111111111111111"
},
"oracleConfig": {
"confFilter": "0.10000000149011612",
"maxStalenessSlots": "100",
"reserved": 0
},
"quoteLotSize": 100,
"baseLotSize": 100000000,
"seqNum": 0,
"registrationTime": 1712803519,
"makerFee": 25,
"takerFee": 75,
"feesAccrued": 0,
"feesToReferrers": 0,
"referrerRebatesAccrued": 0,
"feesAvailable": 0,
"makerVolume": 0,
"takerVolumeWoOo": 0,
"baseMint": "GkKTgckaYe8BZx83XQByVgdZP6WEMBDzWM5zvS5u85ic",
"quoteMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"marketBaseVault": "8bvxAvEFYTiGFxJqFf9YV8Nb4t6HigmeivJsupiJhXfX",
"baseDepositTotal": 0,
"marketQuoteVault": "3Ndm6WVBtiPRJ5Csa4YBnETkgsvvhxPAeVZuDirMt8SE",
"quoteDepositTotal": 0,
"reserved": 0,
"_updatedAt": "2024-04-11T02:45:24.483Z"
}
],
"programId": "opnb2LAfJYbRMAHHvqjCwQxanZn7ReEHp1k81EohpZb"
},
"orca": {
"pools": [
{
"whirlpoolsConfig": "2LecshUwdy9xi7meFgHtFJQNSKk4KdTrcpvaB56dP2NQ",
"whirlpoolBump": [
255
],
"tickSpacing": 64,
"tickSpacingSeed": [
64,
0
],
"feeRate": 3000,
"protocolFeeRate": 1300,
"liquidity": 0,
"sqrtPrice": 178194428756287260,
"tickCurrentIndex": -92800,
"protocolFeeOwedA": 0,
"protocolFeeOwedB": 0,
"tokenMintA": "5PmpMzWjraf3kSsGEKtqdUsCoLhptg4yriZ17LKKdBBy",
"tokenVaultA": "Dy6ktGLX9So2jwUAGzJA811b2XxXVfP4NfRvgvAUXkZ5",
"feeGrowthGlobalA": 102588657235574930000,
"tokenMintB": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"tokenVaultB": "AVxMdgRUUt28vrMjvq1jR2CxdcRtA2sqBdotrjrgNCiy",
"feeGrowthGlobalB": 62866546968137560,
"rewardLastUpdatedTimestamp": 1717481791,
"rewardInfos": [
{
"authority": "DjDsi34mSB66p2nhBL6YvhbcLtZbkGfNybFeLDjJqxJW",
"emissionsPerSecondX64": "0",
"growthGlobalX64": "2396950608335898073171",
"mint": "5PmpMzWjraf3kSsGEKtqdUsCoLhptg4yriZ17LKKdBBy",
"vault": "EMMrXsrt8KabTVgsPZbtGFLXNBgyqr1n52KvfxcvYQqo"
},
{
"authority": "DjDsi34mSB66p2nhBL6YvhbcLtZbkGfNybFeLDjJqxJW",
"emissionsPerSecondX64": "0",
"growthGlobalX64": "377409543105569901",
"mint": "orcaEKTdK7LKz57vaAYr9QeNsVEPfiu6QeMU1kektZE",
"vault": "5S5axVvwG2g3P6sgdwUC2x62KzkXWXgc3xonhbRDPhHD"
},
{
"authority": "3Pi4tc4SxZyKZivKxWnYfGNxeqFJJxPc8xRw1VnvXpbb",
"emissionsPerSecondX64": "0",
"growthGlobalX64": "0",
"mint": "11111111111111111111111111111111",
"vault": "11111111111111111111111111111111"
}
],
"pubkey": "HZUXGiKoFMqEaBRvJZJs4ueFRdK8zrVMb9akHSatNt64",
"lamports": 5435761,
"_updatedAt": "2024-09-04T20:28:28.265093Z"
}
],
"programId": "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc"
},
"raydiumAmm": {
"pools": [
{
"pubkey": "5oAvct85WyF7Sj73VYHbyFJkdRJ28D8m4z4Sxjvzuc6n",
"lamports": 7124800,
"status": 6,
"nonce": 254,
"maxOrder": 7,
"depth": 3,
"baseDecimal": 9,
"quoteDecimal": 6,
"state": 1,
"resetFlag": 0,
"minSize": 1000000000,
"volMaxCutRatio": 500,
"amountWaveRatio": 5000000,
"baseLotSize": 1000000000,
"quoteLotSize": 1000,
"minPriceMultiplier": 1,
"maxPriceMultiplier": 1000000000,
"systemDecimalValue": 1000000000,
"minSeparateNumerator": 5,
"minSeparateDenominator": 10000,
"tradeFeeNumerator": 25,
"tradeFeeDenominator": 10000,
"pnlNumerator": 12,
"pnlDenominator": 100,
"swapFeeNumerator": 25,
"swapFeeDenominator": 10000,
"baseNeedTakePnl": 0,
"quoteNeedTakePnl": 0,
"quoteTotalPnl": 0,
"baseTotalPnl": 0,
"poolOpenTime": 1711805820,
"punishPcAmount": 0,
"punishCoinAmount": 0,
"orderbookToInitTime": 0,
"swapBaseInAmount": 130723408323,
"swapQuoteOutAmount": 19611942921,
"swapBase2QuoteFee": 50141279,
"swapQuoteInAmount": 20051565615,
"swapBaseOutAmount": 150917060047,
"swapQuote2BaseFee": 326818032,
"baseVault": "FzNRkDo1o1oeBud2J