Hello,
I am trying to find a list of trades by a wallets address but getting incomplete transaction info in dextrades.
I run the following query:
{
ethereum(network: ethereum) {
dexTrades(
makerOrTaker: {is: "0x1027b7aa689ea0c4b48b17d85b2a5093ee8f051e"}
date: {after: "2022-06-01", before: "2022-06-03"}
exchangeName: {}
txHash: {}
) {
transaction {
hash
}
smartContract {
address {
address
}
contractType
currency {
name
}
}
tradeIndex
date {
date
}
block {
height
}
buyAmount
buyAmountInUsd: buyAmount(in: USD)
buyCurrency {
symbol
address
}
sellAmount
sellAmountInUsd: sellAmount(in: USD)
sellCurrency {
symbol
address
}
sellAmountInUsd: sellAmount(in: USD)
tradeAmount(in: USD)
transaction {
gasValue
gasPrice
gas
}
}
}
}
And this is the result:
{
"ethereum": {
"dexTrades": [
{
"transaction": {
"hash": "0x43fce7f74d7b1b959541a09569456fa1d79b0d68681e3761f235880b9872c5b5",
"gasValue": 0.025356828126265343,
"gasPrice": 85.495701504,
"gas": 296586
},
"smartContract": {
"address": {
"address": "0x290a6a7460b308ee3f19023d2d00de604bcf5b42"
},
"contractType": "DEX",
"currency": {
"name": "-"
}
},
"tradeIndex": "6",
"date": {
"date": "2022-06-02"
},
"block": {
"height": 14892573
},
"buyAmount": 25.622545819611368,
"buyAmountInUsd": 46422.116551507184,
"buyCurrency": {
"symbol": "WETH",
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
},
"sellAmount": 75000,
"sellAmountInUsd": 45648.35429191589,
"sellCurrency": {
"symbol": "MATIC",
"address": "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0"
},
"tradeAmount": 45648.35429191589
}
]
}
}
So basically it shows the User going from WETH → MATIC
But if you look up the tx on bitqueries own blockexplorer or etherscan you see that the
actual transaction is USDC → WETH → MATIC
i’ve tested this across a dozen addreses… that when i look up a transaction ID later, it only shows me the last leg of the transfer, but doesn’t show me the other steps.
Is there something I can add to the query to show me all the legs of the transaction?
In the initial query, I have limited the time period to just a day to make the issue clear with just one tx, but if i was to get a full wallets dextrades over a period of months, I would basically not be getting a full picture of that users interaction.
So thats my issue, i want to see what token the user got rid of, not just what token the user ended up getting in the last step.
Any help would be greatly appreciated!