Trades on decentralized exchanges
Schema
Column Name | Data Type |
---|---|
chain_id | LONG |
txn_hash | STRING |
block_number | LONG |
block_timestamp | LONG |
global_counter | BIG_DECIMAL |
dex | STRING |
from_token | STRING |
from_token_amt | BIG_DECIMAL |
from_token_name | STRING |
from_token_symbol | STRING |
from_token_dec | BIG_DECIMAL |
from_token_to_weth | BIG_DECIMAL |
from_token_to_weth_dec | BIG_DECIMAL |
to_token | STRING |
to_token_amt | BIG_DECIMAL |
to_token_name | STRING |
to_token_symbol | STRING |
to_token_dec | BIG_DECIMAL |
to_token_to_weth | BIG_DECIMAL |
to_token_to_weth_dec | BIG_DECIMAL |
weth_to_usdc | BIG_DECIMAL |
usdc_dec | BIG_DECIMAL |
recipient | STRING |
liquidity_pool | STRING |
txn_originator | STRING |
Coverage
DEX | Ethereum | Base |
---|---|---|
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
andx_token_usd_dec
will both be0
.
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;