Moonit API
In this section we will see how to get real-time data on Moonit trades, transactions and wallet updates. Similarly you can get pump.fun data here
Trade Side Account field will not be available as aggregates in Archive and Combined Datasets
Moonit Trades in Real-Time
The below query gets real-time information whenever there's a new trade on the Moonshot including program method called , buy and sell details, details of the currencies involved, and the transaction specifics like signature. You can run the query here
subscription MyQuery {
Solana {
DEXTrades(
where: {
Trade: { Dex: { ProtocolFamily: { is: "Moonshot" } } }
Transaction: { Result: { Success: true } }
}
) {
Instruction {
Program {
Method
}
}
Trade {
Dex {
ProtocolFamily
ProtocolName
}
Buy {
Amount
Account {
Address
}
Currency {
Name
Symbol
MintAddress
Decimals
Fungible
Uri
}
}
Sell {
Amount
Account {
Address
}
Currency {
Name
Symbol
MintAddress
Decimals
Fungible
Uri
}
}
}
Transaction {
Signature
}
}
}
}
Get newly created Moonit tokens and their Metadata
Now you can track the newly created Moonit Tokens along with their metadata and supply. PostBalance will give you the current supply for the token. Check the query here
subscription {
Solana {
TokenSupplyUpdates(
where: {
Instruction: {
Program: {
Address: { is: "MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG" }
Method: { is: "tokenMint" }
}
}
}
) {
TokenSupplyUpdate {
Amount
Currency {
Symbol
ProgramAddress
PrimarySaleHappened
Native
Name
MintAddress
MetadataAddress
Key
IsMutable
Fungible
EditionNonce
Decimals
Wrapped
VerifiedCollection
Uri
UpdateAuthority
TokenStandard
}
PostBalance
}
}
}
}
Track New Token Creation on Moonit
Here is the subscription to get the notification of new token creation event on Moonit. Newly Minted Token Address will be 4th address in the Accounts array. You can also see the Name, Symbol, Supply and URI of the newly minted token in the arguments.
subscription {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Method: { is: "tokenMint" }
Address: { is: "MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG" }
}
}
Transaction: { Result: { Success: true } }
}
) {
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
Logs
Program {
AccountNames
Address
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
}
}
}
Method
Name
}
}
Transaction {
Signature
}
}
}
}
Get all the instructions of Moonit
Below query will get you all the instructions that the Moonit Program has. You can test the API here.
query MyQuery {
Solana {
Instructions(
where: {Transaction: {Result: {Success: true}}, Instruction: {Program: {Address: {is: "MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG"}}}}
) {
Instruction {
Program {
Method
}
}
count
}
}
}