I went looking for sandwiches and found a DEX pool trading with itself
A DEX trader sees a quote and a fill and cannot tell what stood between them. I set out to measure the obvious suspect, the sandwich: a bot that buys just before you and sells straight after, in the same block. I found almost none. What I found instead was a pool where two thirds of the volume was three wallets trading with themselves. The pool was ranked #1 on the same activity those trades were…
A DEX trader encountered a puzzling situation while searching for sandwich transactions. The trader aimed to identify bots that buy just before a user and sell immediately after, all within the same block. However, the trader discovered something else: a pool where approximately two-thirds of the volume involved three wallets trading with themselves. This pool ranked first in terms of activity during the observed trades.
The underlying code, known as middleman.edycu.dev, was developed by Edycutjong. The code is written in Python, MIT licensed, and does not require any secret keys. The key components required for a sandwich detector include the maker's wallet (ma), the block number (h), the log index inside the block (lgid), the side of the trade (tp), and the amounts of tokens traded (a0 and a1).
Using this code, the trader identified a row that demonstrated a sandwich transaction. The information in the row included the block number (26006339), the log index (209), the side of the trade (sell), the maker wallet (0xc9160fdab187f2e55567b760d88a87ae7fe56d95), and the amounts traded (842991.8537715519 and 1.0430246602456774). The maker address helped the trader determine if the same wallet participated in both sides of the trade.
The trader also noted that the block number and log index were initially quoted as strings, which caused issues in the detector algorithm. To rectify this, the trader implemented a function to convert them into integers. Rows that couldn't be placed were discarded and counted.
The trader then joined the printouts to determine the correct order of trades within each block. By doing so, they identified a pattern of round-trip transactions within a single block, indicating a sandwich approach. For instance, a specific transaction involved three wallets trading with themselves, accounting for 66.2% of the pool's volume. The sandwich rate for this particular pair was found to be extremely low at 0.025%.
In conclusion, the trader's findings revealed that while there were no same-block sandwiches, there were instances of round-trip trades within a single transaction. This information is crucial for traders to understand the dynamics of the market and make informed decisions.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.