profit&loss_v2
Returns the latest DEX trades on Ethereum, where transaction from is 0x0b1d…9bc7, buy currency smart contract is 0xd412…4e39 and sell currency smart contract is 0xc02a…6cc2: block time, sender fee, buy amount, buy currency symbol, buy smart contract, buy price, sell amount and 5 more fields.
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 0x0b1d…9bc7
- buy currency smart contract is 0xd412…4e39
- sell currency smart contract is 0xc02a…6cc2
- sell currency smart contract is 0xd412…4e39
- buy currency smart contract is 0xc02a…6cc2
- block time since 2024-01-01
- block time till 2024-02-23
The query
query MyQuery( $token: String!, $account: String!, $network: evm_network!, $since: DateTime!, $till: DateTime!) {
EVM(dataset: combined, network: $network) {
sellside: DEXTrades(
where: {Transaction: {From: {is: $account}}, Trade: {Buy: {Currency: {SmartContract: {is: $token}}} Sell: {Currency: {SmartContract: {is: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}}}, Success: true}, 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: {Sell: {Currency: {SmartContract: {is: $token}}} Buy: {Currency: {SmartContract: {is: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}}}, Success: true}, 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": "0xd4126f195a8de772eeffa61a4ab6dd43462f4e39",
"account": "0x0b1dd81b07b2b446973a8f6f2294653eb82d9bc7",
"network": "eth",
"since": "2024-01-01T00:00:00Z",
"till": "2024-02-23T00:00:00Z"
}
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