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 PumpSwap 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.
Trade Side Account
field will not be available for aggregate queries in Archive and Combined Datasets
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 PumpSwap - API
To check if a Pump Fun Token has migrated to PumpSwap, we can use the below query. In this query we are checking if this token 7JsSjVLACA1V7SzTHHeE9XKCP3KJGUwUmqgDm5Hupump
has migrated to PumpSwap. You can run the query here.
{
Solana {
Instructions(
where: {
Instruction: {
CallerIndex: { eq: 2 }
Depth: { eq: 1 }
CallPath: { includes: { eq: 2 } }
Program: {
Method: { is: "create_pool" }
Address: { is: "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA" }
}
Accounts: {
includes: {
Address: { is: "7JsSjVLACA1V7SzTHHeE9XKCP3KJGUwUmqgDm5Hupump" }
}
}
}
}
) {
Instruction {
Program {
Address
Name
Method
Arguments {
Name
Type
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
}
}
}
AccountNames
Json
}
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
Logs
BalanceUpdatesCount
AncestorIndexes
CallPath
CallerIndex
Data
Depth
ExternalSeqNumber
Index
InternalSeqNumber
TokenBalanceUpdatesCount
}
Transaction {
Fee
FeeInUSD
Signature
Signer
FeePayer
Result {
Success
ErrorMessage
}
}
Block {
Time
Height
}
}
}
}
Track Pump Fun Token Migrations to PumpSwap
Use the below query to track Pump Fun token migrations to PumpSwap in realtime. You will get the following account addresses information through the query's Instruction Accounts[]
field and the amount of liquidity added through arguments' Value
field.
You can test the query here.
subscription {
Solana {
Instructions(
where: {
Instruction: {
CallerIndex: { eq: 2 }
Depth: { eq: 1 }
CallPath: { includes: { eq: 2 } }
Program: {
Method: { is: "create_pool" }
Address: { is: "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA" }
}
}
}
) {
Instruction {
Program {
Address
Name
Method
Arguments {
Name
Type
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
}
}
}
AccountNames
Json
}
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
Logs
BalanceUpdatesCount
AncestorIndexes
CallPath
CallerIndex
Data
Depth
ExternalSeqNumber
Index
InternalSeqNumber
TokenBalanceUpdatesCount
}
Transaction {
Fee
FeeInUSD
Signature
Signer
FeePayer
Result {
Success
ErrorMessage
}
}
Block {
Time
Height
}
}
}
}
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
}
}
}
}
}