Pump Fun Marketcap & Bonding Curve API
In this document, we will explore examples to get marketcap, bonding curve progress and whether the token migrated to Raydium or not yet. We have the fully exhaustive Pump Fun API documentation here. Additionally, we have the Moonshot API available, and you can access its documentation here.
These APIs can be provided through different streams including Kafka for zero latency requirements. Please contact us on telegram.
Get Latest Marketcap of a PumpFun Token
You can get the marketcap of a pump fun token by this formulae marketcap = 1000000000 * Latest USD Price
because all the pump fun tokens have 1 Billion supply.
You can get the latest USD price of the desired token (here I have used this token 9qzvgUMrrL5Xyadk2gyWxCWgTds8crkwGwgfjeN5JYLS
) from the below query and multiply it with 1 Billion and you will get the latest marketcap of the specified token.
Alternatively, you can use the TokenSupplyUpdates
cube to find marketcap of Pump Fun Tokens, as shown here.
query MyQuery {
Solana {
DEXTradeByTokens(
limit: { count: 1 }
orderBy: { descending: Block_Time }
where: {
Trade: {
Currency: {
MintAddress: { is: "9qzvgUMrrL5Xyadk2gyWxCWgTds8crkwGwgfjeN5JYLS" }
}
Dex: {
ProgramAddress: {
is: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"
}
}
}
Transaction: { Result: { Success: true } }
}
) {
Trade {
Currency {
Name
MintAddress
Symbol
}
Amount
AmountInUSD
Price
PriceInUSD
}
}
}
}
Get Tokens with a specific MarketCap
You can get the marketcap of a pump fun token by this formulae marketcap = 1000000000 * Latest USD Price
because all the pump fun tokens have 1 Billion supply.
So to track the tokens with a specific marketcap, we just need to track their PriceInUSD
. In the below example query we are tracking tokens in realtime using subscription
keyword which are in marketcap range of $10K to $11K.
Try it out using this query link.
subscription MyQuery {
Solana {
DEXTradeByTokens(
where: {
Trade: {
PriceInUSD: { gt: 0.00001, lt: 0.000011 }
Dex: {
ProgramAddress: {
is: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"
}
}
Side: {
Currency: {
MintAddress: { is: "11111111111111111111111111111111" }
}
}
}
Transaction: { Result: { Success: true } }
}
) {
Block {
Time
}
Trade {
Currency {
Name
Symbol
Decimals
MintAddress
}
Price
PriceInUSD
Dex {
ProtocolName
ProtocolFamily
ProgramAddress
}
Side {
Currency {
MintAddress
Name
Symbol
}
}
}
}
}
}
You can also observe the approach of using TokenSupplyUpdate
block to get the similiar data here.
Check if the Pump Fun Token has migrated to Raydium
To check if a Pump Fun Token has migrated to Raydium, we can use Instructions API to check which methods does Pump Fun Migration Account 39azUYFWPz3VHgKCf3VChUwbpURdCHRxjWVowf5jUJjg
calls. We will see in the response of this query mintTo
method which is responsible for the migration.
Below query can be directly used to check if a Pump Fun Token has migrated to Raydium. We are checking if the Pump Fun: Raydium Migration Account 39azUYFWPz3VHgKCf3VChUwbpURdCHRxjWVowf5jUJjg
successfully called the method mintTo
for this token address HFmde4zjyzGN3cBdAmqzjdH7EcdCun432WPbquKmzmJU
. You can run the query here.
query MyQuery {
Solana(network: solana) {
Instructions(
where: {
Transaction: {
Signer: { is: "39azUYFWPz3VHgKCf3VChUwbpURdCHRxjWVowf5jUJjg" }
}
Instruction: {
Program: { Method: { is: "mintTo" } }
Accounts: {
includes: {
Address: { is: "HFmde4zjyzGN3cBdAmqzjdH7EcdCun432WPbquKmzmJU" }
}
}
}
}
) {
Instruction {
Program {
Name
Method
Arguments {
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
Name
}
Address
AccountNames
}
Accounts {
Address
}
}
Transaction {
Signer
}
}
}
}
Track Pump Fun Token Migration to Raydium
Use the below query to track Pump Fun token migrations to Raydium in realtime by tracking the method initialize2
which gives you the following Account addresses.
"tokenProgram",
"splAssociatedTokenAccount",
"systemProgram",
"rent",
"amm",
"ammAuthority",
"ammOpenOrders",
"lpMint",
"coinMint",
"pcMint",
"poolCoinTokenAccount",
"poolPcTokenAccount",
"poolWithdrawQueue",
"ammTargetOrders",
"poolTempLp",
"serumProgram",
"serumMarket",
"userWallet",
"userTokenCoin",
"userTokenPc",
"userLpTokenAccount"
You can test the query here.
query MyQuery {
Solana(network: solana) {
Instructions(
where: {
Transaction: {
Signer: { is: "39azUYFWPz3VHgKCf3VChUwbpURdCHRxjWVowf5jUJjg" }
}
Instruction: { Program: { Method: { is: "initialize2" } } }
}
limit: { count: 100 }
) {
Instruction {
Program {
Name
Method
Arguments {
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
Name
}
Address
AccountNames
}
Accounts {
Address
}
}
Transaction {
Signer
}
}
}
}
Bonding Curve Progress API
Bonding Curve Progress Formula
- Formula: BondingCurveProgress = 100 - ((leftTokens * 100) / initialRealTokenReserves)
Where:
leftTokens = realTokenReserves - reservedTokens
initialRealTokenReserves = totalSupply - reservedTokens
Definitions:
initialRealTokenReserves
=totalSupply
-reservedTokens
totalSupply
: 1,000,000,000 (Pump Fun Token)reservedTokens
: 206,900,000- Therefore,
initialRealTokenReserves
: 793,100,000
leftTokens
=realTokenReserves
-reservedTokens
realTokenReserves
: Token balance at the market address.
Simplified Formula: BondingCurveProgress = 100 - (((balance - 206900000) * 100) / 793100000)
Additional Notes
- Balance Retrieval:
- The
balance
is the token balance at the market address. - Use this query to fetch the balance: Query Link.
- The
query GetLatestLiquidityForPool {
Solana {
DEXPools(
where: {
Pool: {
Market: {
BaseCurrency: {
MintAddress: {
is: "Eh81Ci2S8ty5M4z9Z3pqHmJmkorvf9XJiJLGksF6pump"
}
}
}
Dex: {
ProgramAddress: {
is: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"
}
}
}
}
orderBy: { descending: Block_Slot }
limit: { count: 1 }
) {
Pool {
Market {
MarketAddress
BaseCurrency {
MintAddress
Symbol
Name
}
QuoteCurrency {
MintAddress
Symbol
Name
}
}
Dex {
ProtocolFamily
ProtocolName
}
Quote {
PostAmount
PriceInUSD
PostAmountInUSD
}
Base {
PostAmount
}
}
}
}
}
Track Pump Fun Tokens above 95% Bonding Curve Progress
We can use above Bonding Curve formulae and get the Balance of the Pool needed to get to 95% and 100% Bonding Curve Progress range. And then track liquidity changes which result in Base{PostAmount}
to fall in this range. You can run and test the saved query here.
subscription MyQuery {
Solana {
DEXPools(
where: {
Pool: {
Base: { PostAmount: { gt: "206900000", lt: "246555000" } }
Dex: {
ProgramAddress: {
is: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"
}
}
Market: {
QuoteCurrency: {
MintAddress: { is: "11111111111111111111111111111111" }
}
}
}
Transaction: { Result: { Success: true } }
}
) {
Pool {
Market {
BaseCurrency {
MintAddress
Name
Symbol
}
MarketAddress
QuoteCurrency {
MintAddress
Name
Symbol
}
}
Dex {
ProtocolName
ProtocolFamily
}
Base {
PostAmount
}
Quote {
PostAmount
PriceInUSD
PostAmountInUSD
}
}
}
}
}