Amount of some transactions seems wrong

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!

Please create a ticket at support.bitquery.io
We will check and fix it.
Solana currently is a part of our EAP which allows you to test the data and integrate with your applications for testing purposes, we encourage you to submit any issues you find

Yes, that is right. I was testing this case and found the price and amount were inconsistent. Hope that they fill fix it soon.

Thanks for everyone’s attention.

Seems like this issue has been somehow mitigated. Set a limit to only query transactions on ORCA with amounts greater than 20 USDC, I did not found any records has a price less than 110 USDC for SOL since 2024-06-24T16:00:00Z.

By using a simple query like (be aware to set Buy.Price.lt to a suitable value based on market condition):

{
  Solana {
    DEXTrades(
      orderBy: {descending: Block_Time}
      where: {Trade: {Buy: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}, Amount: {gt: "0.1"}, Price: {gt: 0.1, lt: 110}}, Sell: {Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}}, Dex: {ProgramAddress: {}}}, Transaction: {Result: {Success: true}}}
      limit: {count: 10}
    ) {
      Trade {
        Buy {
          Amount
          Account {
            Address
            Token {
              Owner
            }
          }
          Currency {
            MintAddress
          }
          Price
        }
        Sell {
          Amount
          Account {
            Address
            Token {
              Owner
            }
          }
          Currency {
            MintAddress
          }
          Price
        }
        Dex {
          ProgramAddress
        }
      }
      Transaction {
        Signature
      }
      Block {
        Time
      }
    }
  }
}

It seems that weird records still exists on Raydium and Phoenix, but they have been greatly reduced.