PoolsByTokenAddress
*
Last updated
Was this helpful?
*
Last updated
Was this helpful?
Retrieve all pools that contains the token address, baseMint or quoteMint.
It retrieve an array of pools even if only one pool is found
const axios = require('axios');
async function getPoolByTokenAddress(address) {
try {
const response = await axios.get(`https://valguibs.com/api/pool/token/${address}`, {
headers: {
Authorization: 'your_api_key_here'
}
});
console.log(response.data);
} catch (error) {
console.error(error.response.data);
}
}
getPoolByTokenAddress('HfYFjMKNZygfMC8LsQ8LtpPsPxEJoXJx4M6tqi75Hajo');
import requests
def get_pool_by_token_address(address):
try:
response = requests.get(f'https://valguibs.com/api/pool/token/{address}', headers={'Authorization': 'your_api_key_here'})
print(response.json())
except requests.exceptions.RequestException as e:
print(e.response.json())
get_pool_by_token_address('HfYFjMKNZygfMC8LsQ8LtpPsPxEJoXJx4M6tqi75Hajo')
Here's an example of the response you'll receive when retrieving pools with token address:
[
{
"id":"13uCPybNakXHGVd2DDVB7o2uwXuf9GqPFkvJMVgKy6UJ",
"baseMint":"HfYFjMKNZygfMC8LsQ8LtpPsPxEJoXJx4M6tqi75Hajo",
"quoteMint":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"lpMint":"HjR23bxn2gtRDB2P1Tm3DLepAPPZgazsWJpLG9wqjnYR",
"baseDecimals":9,
"quoteDecimals":6,
"lpDecimals":9,
"version":4,
"programId":"675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8",
"authority":"5Q544fKrFoe6tsEbD7S8EmxGTJYAKtTVhAW5Q5pge4j1",
"openOrders":"E6wZo9uiPf156g9jG5ZWX3s23hM3jcicHiNjMg9NTvo3",
"targetOrders":"HnX2KEKgXfPbHoFCSfZydDDYm51DwdkXcibWP9o6sP9Z",
"baseVault":"2rgPoyabSPeYoMiACSp9UcqG9WEBhDdXDmGQ4XRoBeo7",
"quoteVault":"CzynpjFdoLekUGMPRNT6un5ieg6YQyT4WmJFKngoZHJY",
"withdrawQueue":"11111111111111111111111111111111",
"lpVault":"11111111111111111111111111111111",
"marketVersion":3,
"marketProgramId":"9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin",
"marketId":"CDYafmdHXtfZadhuXYiR7QaqmK9Ffgk2TA8otUWj9SWz",
"marketAuthority":"GiVPfzeddXAbneSZWZ1XrNAZvB7XhNFbJtck7skN6xBE",
"marketBaseVault":"2CAabztdescZCLyTmUAvRUxi3CZDgtFPx4WFrUmXEz8H",
"marketQuoteVault":"nkMvRrq8ove9AMBJ65jPSsnd3RS7kvTTh5L3jN93uNu",
"marketBids":"A3LCjzPEE9reQhKRED1TBGBG9ksL45rhLxh4fRzThWXJ",
"marketAsks":"53krdJQgxmTaJgBPQ1Kc7SKLEEosvYs2uDYodQd9Lcqf",
"marketEventQueue":"224GEWPVsY5fjn3JqqkxC7jW2oasosipvWSZCFrpbiDm",
"lookupTableAccount":"5ppgm3ckDscUGnTMFDt1phYQuFyu3WhyNHAAdSbKMJP1"
},
{
"id":"13uCPybNakXHGVd2DDVB7o2uwXuf9GqPFkvJMVgKy6UJ",
"baseMint":"HfYFjMKNZygfMC8LsQ8LtpPsPxEJoXJx4M6tqi75Hajo",
"quoteMint":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"lpMint":"HjR23bxn2gtRDB2P1Tm3DLepAPPZgazsWJpLG9wqjnYR",
"baseDecimals":9,
"quoteDecimals":6,
"lpDecimals":9,
"version":4,
"programId":"675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8",
"authority":"5Q544fKrFoe6tsEbD7S8EmxGTJYAKtTVhAW5Q5pge4j1",
"openOrders":"E6wZo9uiPf156g9jG5ZWX3s23hM3jcicHiNjMg9NTvo3",
"targetOrders":"HnX2KEKgXfPbHoFCSfZydDDYm51DwdkXcibWP9o6sP9Z",
"baseVault":"2rgPoyabSPeYoMiACSp9UcqG9WEBhDdXDmGQ4XRoBeo7",
"quoteVault":"CzynpjFdoLekUGMPRNT6un5ieg6YQyT4WmJFKngoZHJY",
"withdrawQueue":"11111111111111111111111111111111",
"lpVault":"11111111111111111111111111111111",
"marketVersion":3,
"marketProgramId":"9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin",
"marketId":"CDYafmdHXtfZadhuXYiR7QaqmK9Ffgk2TA8otUWj9SWz",
"marketAuthority":"GiVPfzeddXAbneSZWZ1XrNAZvB7XhNFbJtck7skN6xBE",
"marketBaseVault":"2CAabztdescZCLyTmUAvRUxi3CZDgtFPx4WFrUmXEz8H",
"marketQuoteVault":"nkMvRrq8ove9AMBJ65jPSsnd3RS7kvTTh5L3jN93uNu",
"marketBids":"A3LCjzPEE9reQhKRED1TBGBG9ksL45rhLxh4fRzThWXJ",
"marketAsks":"53krdJQgxmTaJgBPQ1Kc7SKLEEosvYs2uDYodQd9Lcqf",
"marketEventQueue":"224GEWPVsY5fjn3JqqkxC7jW2oasosipvWSZCFrpbiDm",
"lookupTableAccount":"5ppgm3ckDscUGnTMFDt1phYQuFyu3WhyNHAAdSbKMJP1"
}
]