LetsBonk.fun API
In this document, we will explore several examples related to LetsBonk.fun.
LetsBonk.fun tokens are created and traded on Raydium Launchlab.
Need zero-latency LetsBonk.fun data? Read about our Shred Streams and Contact us for a Trial.
To query or stream data via graphQL outside the Bitquery IDE, you need to generate an API access token.
Follow the steps here to create one: How to generate Bitquery API token ➤
If you want fastest data without any latency, we can provide Kafka streams, please fill this form for it. Our Team will reach out.
Track LetsBonk.fun Token Creation
Using this query, we can get the most recently created LetsBonk.fun tokens.
Click to expand GraphQL query
{
Solana {
InstructionBalanceUpdates(
where: {
BalanceUpdate: { Currency: { MintAddress: { endsWith: "bonk" } } }
Instruction: {
Program: {
Address: { is: "LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj" }
Method: { is: "initialize" }
}
}
Transaction: { Result: { Success: true } }
}
orderBy: { descending: Block_Time }
) {
BalanceUpdate {
Currency {
MintAddress
Name
Symbol
Decimals
UpdateAuthority
Uri
VerifiedCollection
Wrapped
ProgramAddress
}
PostBalance
}
Block {
Time
}
Transaction {
Signature
Signer
}
}
}
}
Get all the instructions of Raydium LaunchLab
Below query will get you all the instructions that the Raydium LaunchLab Program has. You can test the API here.
Click to expand GraphQL query
query MyQuery {
Solana {
Instructions(
where: {Instruction: {Program: {Address: {is: "LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj"}}}}
) {
Instruction {
Program {
Method
}
}
count
}
}
}
Track LetsBonk.fun Token Migrations to Raydium DEX and Raydium CPMM in Realtime
Using above get all instructions
api, you will figure out that there are 2 instructions migrate_to_amm
, migrate_to_cpswap
whose invocations migrate the Raydium LaunchLab Token to Raydium V4 AMM and Raydium CPMM Dexs respectively.
Thats why we have filtered for these 2 instructions in the below API, and tracking these.
Test out the API here.
Click to expand GraphQL query
subscription MyQuery {
Solana {
Instructions(
where: {Instruction: {Program: {Address: {is: "LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj"}, Method: {in: ["migrate_to_amm","migrate_to_cpswap"]}}}, Transaction: {Result: {Success: true}}}
) {
Block{
Time
}
Instruction {
Program {
Method
AccountNames
Address
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_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
}
Type
Name
}
Name
}
Accounts {
Address
IsWritable
Token {
ProgramId
Owner
Mint
}
}
}
Transaction {
Signature
Signer
}
}
}
}
Latest Trades of a LetsBonk.fun token on Launchpad
This query fetches the most recent trades of a LetsBonk.fun Token 6dCG3QhvCrJ2rJPY41s8UjTVFTWhyEnFJkDSkmBrbonk
on the Raydium Launchpad.
You can run the query here
Click to expand GraphQL query
query LatestTrades {
Solana {
DEXTradeByTokens(
orderBy: { descending: Block_Time }
limit: { count: 50 }
where: {
Trade: {
Dex: { ProtocolName: { is: "raydium_launchpad" } }
Currency: {
MintAddress: { is: "6dCG3QhvCrJ2rJPY41s8UjTVFTWhyEnFJkDSkmBrbonk" }
}
}
}
) {
Block {
Time
}
Transaction {
Signature
}
Trade {
Market {
MarketAddress
}
Dex {
ProtocolName
ProtocolFamily
}
AmountInUSD
PriceInUSD
Amount
Currency {
Name
}
Side {
Type
Currency {
Symbol
MintAddress
Name
}
AmountInUSD
Amount
}
}
}
}
}
Similarly, you can subscribe to trades on launchpad in real-time using subscription query. The same can be tracked using Bitquery Kafka Streams
Latest Price of a LetsBonk.fun Token on Raydium Lanchlab
This query provides the most recent price data for a specific LetsBonk.fun token 6dCG3QhvCrJ2rJPY41s8UjTVFTWhyEnFJkDSkmBrbonk
launched on Raydium Launchpad. You can filter by the token’s MintAddress
, and the query will return the last recorded trade price.
You can run the query here
Click to expand GraphQL query
{
Solana {
DEXTradeByTokens(
orderBy: { descending: Block_Time }
limit: { count: 1 }
where: {
Trade: {
Dex: { ProtocolName: { is: "raydium_launchpad" } }
Currency: {
MintAddress: { is: "6dCG3QhvCrJ2rJPY41s8UjTVFTWhyEnFJkDSkmBrbonk" }
}
}
}
) {
Block {
Time
}
Transaction {
Signature
}
Trade {
Market {
MarketAddress
}
Dex {
ProtocolName
ProtocolFamily
}
AmountInUSD
PriceInUSD
Amount
Currency {
Name
}
Side {
Type
Currency {
Symbol
MintAddress
Name
}
AmountInUSD
Amount
}
}
}
}
}
Top Buyers of a LetsBonk.fun Token on LaunchPad
This API endpoint returns the top 100 buyers for a token, which is 6dCG3QhvCrJ2rJPY41s8UjTVFTWhyEnFJkDSkmBrbonk
in this case.
Click to expand GraphQL query
query MyQuery {
Solana {
DEXTradeByTokens(
where: {
Trade: {
Dex: { ProtocolName: { is: "raydium_launchpad" } }
Currency: {
MintAddress: { is: "6dCG3QhvCrJ2rJPY41s8UjTVFTWhyEnFJkDSkmBrbonk" }
}
Side: { Type: { is: buy } }
}
}
orderBy: { descendingByField: "buy_volume" }
limit: { count: 100 }
) {
Trade {
Currency {
MintAddress
Name
Symbol
}
}
Transaction {
Signer
}
buy_volume: sum(of: Trade_Side_AmountInUSD)
}
}
}
Top Sellers of a Token on LaunchPad
Using this query top 100 sellers for the token with Mint Address
as 6dCG3QhvCrJ2rJPY41s8UjTVFTWhyEnFJkDSkmBrbonk
could be retrieved.
Click to expand GraphQL query
query MyQuery {
Solana {
DEXTradeByTokens(
where: {
Trade: {
Dex: { ProtocolName: { is: "raydium_launchpad" } }
Currency: {
MintAddress: { is: "6dCG3QhvCrJ2rJPY41s8UjTVFTWhyEnFJkDSkmBrbonk" }
}
Side: { Type: { is: sell } }
}
}
orderBy: { descendingByField: "sell_volume" }
limit: { count: 100 }
) {
Trade {
Currency {
MintAddress
Name
Symbol
}
}
Transaction {
Signer
}
sell_volume: sum(of: Trade_Side_AmountInUSD)
}
}
}
OHLCV for specific LetsBonk.fun Token on Raydium Launchlab
This API end point returns the OHLCV vlaues for a LetsBonk.fun token with the currency mint address
as 72j7mBkX54KNH7djeJ2mUz5L8VoDToPbSQTd24Sdhray
when traded against WSOL.
Click to expand GraphQL query
query MyQuery {
Solana {
DEXTradeByTokens(
where: {
Trade: {
Dex: { ProtocolName: { is: "raydium_launchpad" } }
Currency: {
MintAddress: { is: "6dCG3QhvCrJ2rJPY41s8UjTVFTWhyEnFJkDSkmBrbonk" }
}
Side: {
Currency: {
MintAddress: { is: "So11111111111111111111111111111111111111112" }
}
}
}
Transaction: { Result: { Success: true } }
}
limit: { count: 100 }
orderBy: { descendingByField: "Block_Timefield" }
) {
Block {
Timefield: Time(interval: { count: 1, in: minutes })
}
Trade {
open: Price(minimum: Block_Slot)
high: Price(maximum: Trade_Price)
low: Price(minimum: Trade_Price)
close: Price(maximum: Block_Slot)
}
volumeInUSD: sum(of: Trade_Side_AmountInUSD)
count
}
}
}
Get Pair Address for a LetsBonk.fun Token
This query returns the pair address for the LetsBonk.fun token with mint address
as 6dCG3QhvCrJ2rJPY41s8UjTVFTWhyEnFJkDSkmBrbonk
on the LaunchPad exchange. The liquidity pool address is denoted by MarketAddress
.
Click to expand GraphQL query
query MyQuery {
Solana {
DEXTradeByTokens(
where: {
Trade: {
Dex: { ProtocolName: { is: "raydium_launchpad" } }
Currency: {
MintAddress: { is: "6dCG3QhvCrJ2rJPY41s8UjTVFTWhyEnFJkDSkmBrbonk" }
}
}
}
) {
Trade {
Market {
MarketAddress
}
Currency {
Name
Symbol
MintAddress
}
Side {
Currency {
Name
Symbol
MintAddress
}
}
}
count
}
}
}
Get Liquidity for a LetsBonk.fun Token Pair Address
Using this query we can get the liquidity for a LaunchPad Token Pair, where Base_PostBalance
is the amount of LaunchPad tokens present in the pool and Quote_PostBalance
is the amount of WSOL present in the pool. For the purpose of filtering we are applying the condition that the MarketAddress
is 2NhS34gTq87kjXq1hikmEkwzbBFs5Er3gCAMjVGv1kS4
.
Click to expand GraphQL query
{
Solana {
DEXPools(
where: {
Pool: {
Market: {
MarketAddress: {
is: "2NhS34gTq87kjXq1hikmEkwzbBFs5Er3gCAMjVGv1kS4"
}
}
}
Transaction: { Result: { Success: true } }
}
orderBy: { descending: Block_Time }
limit: { count: 1 }
) {
Pool {
Base {
PostAmount
}
Quote {
PostAmount
}
Market {
BaseCurrency {
MintAddress
Name
Symbol
}
QuoteCurrency {
MintAddress
Name
Symbol
}
}
}
}
}
}