ATH token (2nd highest buy/ MEV out)
This query will return the top two buy prices. From there, you can select the 2nd highest one programmatically. This approach should help you get a more accurate representation of the ATH that excludes MEV bot manipulation. Reasoning: MEV bots, especially in sandwich attacks, manipulate the price by placing a buy order just before a legitimate user’s trade and a sell order right after, inflating the price temporarily. Here's how the idea works: - Highest Sell Price: This would typically be the point at which the MEV bot sells after sandwiching the victim’s transaction, effectively realizing its profit. - Highest Buy Price: This is likely to include the victim’s trade that was sandwiched, which would reflect an inflated value because the MEV bot's first buy artificially drove up the price. Why the 2nd Highest Buy Price is Better: The 2nd highest buy price could represent the last "natural" trade before the sandwich attack, or at least the closest non-manipulated price. This would give a more reliable indication of the token's highest price without the artificial inflation from the MEV bot’s buy order. By focusing on the 2nd highest buy price: - You’re more likely to avoid the artificially high value caused by the MEV bot. - This price is likely closer to the fair market value, making it a more accurate indicator of the true all-time high (ATH).
What it returns
- transaction hash
- buy price
- buy price in USD
- buy currency name
- buy currency symbol
- buy smart contract
Filters
- DEX smart contract is 0x7EB6…815e
- buy currency smart contract is 0x240C…1B7a
- sell currency smart contract is 0xC02a…6Cc2
The query
{
EVM(dataset: combined, network: eth) {
DEXTrades(
limit: {count: 2}
orderBy: {descending: Trade_Buy_Price}
where: {Trade: {Dex: {SmartContract: {is: "0x7EB6D3466600b4857eb60a19e0d2115e65aa815e"}}, Buy: {Currency: {SmartContract: {is: "0x240Cd7b53d364a208eD41f8cEd4965D11F571B7a"}}}, Sell: {Currency: {SmartContract: {is: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"}}}}}
) {
Transaction {
Hash
}
Trade {
Buy {
Price
PriceInUSD
Currency {
Name
Symbol
SmartContract
}
}
}
}
}
}
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