Trades on decentralized exchanges

Schema

Column NameData Type
chain_idLONG
txn_hashSTRING
block_numberLONG
block_timestampLONG
global_counterBIG_DECIMAL
dexSTRING
from_tokenSTRING
from_token_amtBIG_DECIMAL
from_token_nameSTRING
from_token_symbolSTRING
from_token_decBIG_DECIMAL
from_token_to_wethBIG_DECIMAL
from_token_to_weth_decBIG_DECIMAL
to_tokenSTRING
to_token_amtBIG_DECIMAL
to_token_nameSTRING
to_token_symbolSTRING
to_token_decBIG_DECIMAL
to_token_to_wethBIG_DECIMAL
to_token_to_weth_decBIG_DECIMAL
weth_to_usdcBIG_DECIMAL
usdc_decBIG_DECIMAL
recipientSTRING
liquidity_poolSTRING
txn_originatorSTRING

Coverage

DEXEthereumBase
1inch LOP
Ambient (CrocSwap)
Balancer V2
Bancor Carbon
CoW Protocol
Curve.fi
DODO V2
KyberSwap LOP
Maker PSM
Maverick V1
Maverick V2
PancakeSwap V2
PancakeSwap V3
ShibaSwap V2
SushiSwap V2
SushiSwap V3
Swaap V2
Uniswap V2
Uniswap V3
UniswapX
Aerodrome
Aerodrome Slipstream
BaseSwap
BaseX
Infusion
RocketSwap
WooFi

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;