Trades on decentralized exchanges

Schema

Column NameData Type
chain_idlong
txn_hashstring
block_numberlong
block_timestamplong
global_counterbigDecimal
dexstring
from_tokenstring
from_token_amtbigDecimal
from_token_namestring
from_token_symbolstring
from_token_decbigDecimal
from_token_usdbigDecimal
from_token_usd_decbigDecimal
to_tokenstring
to_token_amtbigDecimal
to_token_namestring
to_token_symbolstring
to_token_decbigDecimal
to_token_usdbigDecimal
to_token_usd_decbigDecimal
recipientstring
liquidity_poolstring

Coverage

Ethereum

  1. Uniswap V2
  2. Uniswap V3
  3. Balancer V2
  4. PancakeSwap V3
  5. Curve.fi

Base

  1. Uniswap V2
  2. Uniswap V3
  3. Balancer V2
  4. Aerodrome
  5. Infusion
  6. Maverick V1
  7. BaseX
  8. PancakeSwap V3

If there's another DEX on a sim-supported chain that you'd like to see covered, please reach out on Telegram.

Source

This table was built in sim's DEX Trades canvas.

Usage Notes

  • USD prices are fetched from Chainlink's on-chain Price Feeds. In case one side of the trade doesn't have a price feed available, the x_token_usd and x_token_usd_dec will both be 0.

Sample Queries

1. Get the N largest trades across all DEXs

select
    txn_hash,
    dex,
    from_token,
    from_token_name,
    (1.0 * from_token_amt / POWER(10, from_token_dec)) from_normalized_amt,
    to_token,
    to_token_name,
    to_token_amt,
    (1.0 * to_token_amt / POWER(10, to_token_dec)) to_normalized_amt,
    CASE
        WHEN 1.0 * from_token_usd > 0 THEN (1.0 * from_token_amt / POWER(10, from_token_dec)) * (1.0 * from_token_usd / POWER(10, from_token_usd_dec))
        WHEN 1.0 * to_token_usd > 0 THEN (1.0 * to_token_amt / POWER(10, to_token_dec)) * (1.0 * to_token_usd / POWER(10, to_token_usd_dec))
        ELSE 0
    END AS trade_volume
from @sim.dex_trades
order by trade_volume desc
limit 100;