Get All Pools for a Creator
Fetch and query a Raydium Launchpad pool info based on creator address.
Fetch all Pools created by an User
async function getPoolDetailsByCreator(creatorAddress) {
const SHYFT_API_KEY = "YOUR_SHYFT_API_KEY";
//query to get pool details by creator address
const operationsDoc = `
query MyQuery {
raydium_launchpad_PoolState(
where: {creator: {_eq: ${JSON.stringify(creatorAddress)}}}
) {
supply
total_base_sell
total_quote_fund_raising
virtual_base
virtual_quote
real_base
real_quote
pubkey
migrate_type
migrate_fee
base_mint
base_vault
base_decimals
quote_vault
quote_mint
quote_decimals
creator
}
}
`; //you can cherrypick the fields as per your requirement
const result = await fetch(
`https://programs.shyft.to/v0/graphql/accounts?api_key=${SHYFT_API_KEY}&network=mainnet-beta`, //SHYFT's GQL endpoint
{
method: "POST",
body: JSON.stringify({
query: operationsDoc,
variables: {},
operationName: "MyQuery",
}),
}
);
const { errors, data } = await result.json();
console.dir(data, { depth: null });
}
getPoolDetailsByCreator("87wMyjR6RfpJLVy4TWEHK9WEe9UfMEMeU63BJnW3xfee");
//creator wallet addressLast updated