/ Uniswap pair symbols @jebonn
About queries and results
Dune Analytics lets you explore, create, and share Ethereum analytics. You can find an endless amount of great queries and dashboards on Dune.
We have decoded Ethereum smart contract data so you can do powerful analysis with simple SQL queries and visualise the query results into beautiful graphs.
Dune Analytics is free for everyone forever. If you want extra features like private queries, export your results and more check out our Pro plan.
SQL query results
SQL query
1WITH pair AS -- Get UNISWAP pair information
2 (SELECT pair,
3 token0,
4 token1
5 FROM uniswap_v2."Factory_evt_PairCreated"
6 WHERE pair=(select ('\x' || right(trim(from '{{pair_contract}}'),40))::bytea))
7
8, token0 AS -- Now we can get token info in correct order
9 (SELECT symbol
10 FROM erc20."tokens"
11 WHERE contract_address=(SELECT token0 FROM pair))
12
13, token1 AS
14 (SELECT symbol
15 FROM erc20."tokens"
16 WHERE contract_address=(SELECT token1 FROM pair))
17
18SELECT
19 (coalesce((SELECT symbol FROM token0),'NOT FOUND')) AS token0_symbol
20,
21 (coalesce((SELECT symbol FROM token1),'NOT FOUND')) AS token1_symbol