Trade_Virtu
This is token trade query for PnL and ROI Input: - wallet: required - token: optional
What it returns
- block time
- sender fee
- buy amount
- buy currency symbol
- buy smart contract
- buy price
- sell amount
- sell currency symbol
- sell smart contract
- sell price
- protocol name
- transaction hash
Filters
- transaction from is 0x3eb8…c77c
- sell currency smart contract is 0xc02a…6cc2
- buy currency smart contract is 0x102d…4e60
- buy currency smart contract is 0xc02a…6cc2
- sell currency smart contract is 0x102d…4e60
- block time since 2024-02-18
- block time till 2024-03-19
The query
query MyQuery($account: String!, $token: String!, $network: evm_network!, $since: DateTime!, $till: DateTime!) {
EVM(dataset: combined, network: $network) {
sellside: DEXTrades(
where: {Transaction: {From: {is: $account}}, Trade: {Sell: {Currency: {SmartContract: {is: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}}}, Success: true, Buy: {Currency: {SmartContract: {is: $token}}}}, Block: {Time: {since: $since, till: $till}}}
orderBy: {descending: Block_Time}
) {
Block {
Time
}
Fee {
SenderFee
}
Trade {
Buy {
Amount
Currency {
Symbol
SmartContract
}
Price
}
Sell {
Amount
Currency {
Symbol
SmartContract
}
Price
}
Dex {
ProtocolName
}
}
Transaction {
Hash
}
}
buyside: DEXTrades(
where: {Transaction: {From: {is: $account}}, Trade: {Buy: {Currency: {SmartContract: {is: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}}}, Success: true, Sell: {Currency: {SmartContract: {is: $token}}}}, Block: {Time: {since: $since, till: $till}}}
orderBy: {descending: Block_Time}
) {
Block {
Time
}
Fee {
SenderFee
}
Trade {
Buy {
Amount
Currency {
Symbol
SmartContract
}
Price
}
Sell {
Amount
Currency {
Symbol
SmartContract
}
Price
}
Dex {
ProtocolName
}
}
Transaction {
Hash
}
}
}
}
Variables
{
"token": "0x102dc1840f0c3c179670f21fa63597e82df34e60",
"account": "0x3eb81b24f5c89fe0119998bb8772413d32fec77c",
"network": "eth",
"since": "2024-02-18T11:13:19Z",
"till": "2024-03-19T21:43:19Z"
}
Similar queries
- Latest Curve DEX swaps on Ethereum · Ethereum · DEXTrades
- Top Curve liquidity pools by 24h volume on Ethereum · Ethereum · DEXTrades
- STRN_TOKEN_MULTIPLE_DECIMALS_DEX_TRADES · Ethereum · DEXTrades
- USDT DECIMAL SHOWING 0 · Ethereum · DEXTrades
- Trades - 0xEE61159E8A72A08371c52D62c19Efd0C7914f917 · Ethereum · DEXTrades