Skip to main content

Table Description

The dex.sandwiched table captures detailed data on the victim trades of sandwich attacks executed via decentralized exchanges (DEXs). This table records the transactions that have been sandwiched between front-running and back-running trades. It provides a comprehensive view of sandwich attack victims across various EVM networks.

Functional Overview

The dex.sandwiched table provides an in-depth view of the victim trades in sandwich attacks on decentralized exchanges. A sandwich attack occurs when a trader (usually a bot) spots a pending transaction in the mempool, quickly executes a trade before it (front-running), and then immediately after it (back-running) to profit from the price movement caused by the victim’s trade. This table includes entries for:
  1. The victim trade that has been sandwiched
Note that the front-running and back-running trades that sandwich these victim trades are captured in a separate table, dex.sandwiches. This detailed approach allows for granular analysis of sandwich attack patterns, enabling users to:
  • Identify Sandwich Attack Victims: Easily spot instances of trades that have been sandwiched across different DEXs and networks.
  • Analyze Attack Impacts: Understand the frequency, size, and potential losses of sandwiched trades.
  • Monitor Market Vulnerability: Gain insights into which trades are most susceptible to sandwich attacks across different DEXs and EVM networks.
By providing comprehensive details of the victim trades in sandwich attacks, the dex.sandwiched table supports advanced analytics and research into DEX trading behavior, market manipulation, and potential areas for improved trade execution or protocol design to protect users from sandwich attacks.

Table Schema

ColumnTypeDescription
blockchainVARCHARBlockchain on which this trade occurred
projectVARCHARName of the DEX on which the trade occurred
versionVARCHARVersion of the DEX protocol/contract
block_timeTIMESTAMPUTC event block time
block_monthDATEUTC event block month (partition key)
block_numberBIGINTBlock number in which the trade occurred
token_sold_addressVARBINARYContract address of the token sold
token_bought_addressVARBINARYContract address of the token bought
token_sold_symbolVARCHARSymbol of the token sold
token_bought_symbolVARCHARSymbol of the token bought
makerVARBINARYAddress that sold tokens (can be contract or EOA)
takerVARBINARYAddress that purchased tokens (can be contract or EOA)
tx_hashVARBINARYTransaction hash
tx_fromVARBINARYEOA address that sent the transaction
tx_toVARBINARYAddress called in the first call of this transaction
project_contract_addressVARBINARYSmart contract address which emitted the trade event
token_pairVARCHARSymbol pair for the tokens involved, always alphabetical order
tx_indexBIGINTIndex of the transaction in the block
token_sold_amount_rawUINT256Raw amount of the token sold
token_bought_amount_rawUINT256Raw amount of the token bought
token_sold_amountDOUBLEAmount of the token sold in display units
token_bought_amountDOUBLEAmount of the token bought in display units
amount_usdDOUBLEUSD value of the trade at time of execution
evt_indexBIGINTIndex of the event in the transaction

Table Sample

  • dex.sandwiches: This complementary table captures the front-running and back-running trades that sandwich the victim trades recorded in dex.sandwiched.
  • dex.trades: This table captures all trades and is the basis for the dex.sandwiched table.