Trades on decentralized exchanges
Schema
Column Name | Data Type |
---|---|
chain_id | long |
txn_hash | string |
block_number | long |
block_timestamp | long |
global_counter | bigDecimal |
dex | string |
from_token | string |
from_token_amt | bigDecimal |
from_token_name | string |
from_token_symbol | string |
from_token_dec | bigDecimal |
from_token_usd | bigDecimal |
from_token_usd_dec | bigDecimal |
to_token | string |
to_token_amt | bigDecimal |
to_token_name | string |
to_token_symbol | string |
to_token_dec | bigDecimal |
to_token_usd | bigDecimal |
to_token_usd_dec | bigDecimal |
recipient | string |
liquidity_pool | string |
Coverage
Ethereum
- Uniswap V2
- Uniswap V3
- Balancer V2
- PancakeSwap V3
- Curve.fi
Base
- Uniswap V2
- Uniswap V3
- Balancer V2
- Aerodrome
- Infusion
- Maverick V1
- BaseX
- 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
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;