Hello!
I am using the dexTrades API to get the latest trades but I noticed that there is an issue when there are 3 tokens in the path.
For example the tx on bsc : 0xe3fcd41f849bb53a47757e95bea67d7e13ee3838ead34fd73ac2ea506656012e. The Belt token was sold in WBNB then it was converted to BUSD, however the api returned that the buyCurrency was WBNB and the sellCurrency was BUSD.
Here is the answer I got:
{
"transaction": {
"hash": "0xe3fcd41f849bb53a47757e95bea67d7e13ee3838ead34fd73ac2ea506656012e",
"txFrom": {
"address": "0x52ad3d04585f2766346db9870ab037547cfa9b38"
}
},
"tradeIndex": "8",
"date": {
"date": "2021-08-22"
},
"buyAmount": 444.46066048002575,
"buyAmountInUsd": 200250.33451198574,
"buyCurrency": {
"symbol": "WBNB"
},
"sellAmount": 199830.04943165768,
"sellCurrency": {
"symbol": "BUSD",
"address": "0xe9e7cea3dedca5984780bafc599bd69add087d56"
},
"sellAmountInUsd": 200173.96184521247,
"tradeAmount": 200173.96184521247,
"taker": {
"smartContract": {
"contractType": null
}
}
},
and this is the query I used:
{
ethereum(network: bsc) {
dexTrades(
options: { limit: 2000, desc: "tradeAmount" }
date: { after: "2021-08-15" }
takerSmartContractType: { is: None }
tradeAmountUsd: {gt: 200000}
) {
transaction {
hash
txFrom{
address
}
}
tradeIndex
date {
date
}
buyAmount
buyAmountInUsd: buyAmount(in: USD)
buyCurrency {
symbol
}
sellAmount
sellCurrency {
symbol
address
}
sellAmountInUsd: sellAmount(in: USD)
tradeAmount(in: USD)
taker {
smartContract {
contractType
}
}
}
}
}