Hi there,
I’m working on how to get realtime price of SOL based on USDC. But I got some weird transactions to be seen:
Use the following GraphQL query:
{
Solana {
DEXTrades(
orderBy: {ascending: Block_Time}
where: {Transaction: {Signature: {is: "66WAWZxR8XXgo6DNRK6KrUrSUmwBAbUGfkXLFNkokeX82r5jiqGSoHRympAGDDQ74TygVoCGhjHS24q8ramBXa4g"}}}
) {
Trade {
Buy {
Amount
Account {
Address
Token {
Owner
}
}
Currency {
MintAddress
}
Price
}
Sell {
Amount
Account {
Address
Token {
Owner
}
}
Currency {
MintAddress
}
Price
}
}
Transaction {
Signature
}
Block {
Time
}
}
}
}
I got the result as below:
{
"Solana": {
"DEXTrades": [
{
"Block": {
"Time": "2024-06-24T08:10:54Z"
},
"Trade": {
"Buy": {
"Account": {
"Address": "BkJFS1HF6JgrsB1VXdTVMsZ7R6WCKqokCqhUZqarPPVZ",
"Token": {
"Owner": "9vu7XMz8Brmfm4mT1T2E1YzemsUCwQEzeM3DrocPBxWc"
}
},
"Amount": "25.658926",
"Currency": {
"MintAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
},
"Price": 15.597227577490967
},
"Sell": {
"Account": {
"Address": "7exzsvjn46jweUp1uerS3SYMmHUdQcBgrQi2MHMv5fJV",
"Token": {
"Owner": "9vu7XMz8Brmfm4mT1T2E1YzemsUCwQEzeM3DrocPBxWc"
}
},
"Amount": "400.208108216",
"Currency": {
"MintAddress": "So11111111111111111111111111111111111111112"
},
"Price": 0.06411395839624365
}
},
"Transaction": {
"Signature": "66WAWZxR8XXgo6DNRK6KrUrSUmwBAbUGfkXLFNkokeX82r5jiqGSoHRympAGDDQ74TygVoCGhjHS24q8ramBXa4g"
}
}
]
}
}
It can be seen that in this transaction someone swaped 400.2081 SOL for
25.658926 USDC, which is nearly impossible.
Use solscan (here) to inspect this transaction, it’s clear that the fact is he swaped 0.2055157 SOL for
25.658926 USDC and it is reasonable. It seems that the amount of buy side is somehow got wrong.
Please check this issue and it’s easy to find tons of such records. The same problem can be found on USDT (Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB). For typical tokens (i.e. not stablecoin), for now I did not found such transactions.
Thank you!