Query editor
withv1 AS (SELECT exchange, token AS token0, 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 AS token1 FROM uniswap_ethereum.Factory_evt_NewExchange), v2 AS (SELECT pair, token0, token1 FROM uniswap_v2_ethereum.Factory_evt_PairCreated), v3 AS (SELECT pool, token0, token1 FROM uniswap_v3_ethereum.Factory_evt_poolCreatedUNIONSELECT pool, token0, token1 FROM uniswap_v3_arbitrum.Factory_evt_poolCreatedUNIONSELECT pool, token0, token1 FROM uniswap_v3_polygon.Factory_evt_poolCreatedUNIONSELECT pool, token0, token1 FROM uniswap_v3_optimism.Factory_evt_poolCreatedUNIONSELECT pool, token0, token1 FROM uniswap_v3_bnb.Factory_evt_poolCreatedUNIONSELECT pool, token0, token1 FROM uniswap_v3_celo.UniswapV3Factory_evt_poolCreated), combine AS (SELECT * FROM v3UNIONSELECT * FROM v2UNIONSELECT * FROM v1), major (token, symbol) AS (SELECT * FROM (values('0x6b175474e89094c44da98b954eedeac495271d0f', 'DAI'),('0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', 'USDC'),('0xdac17f958d2ee523a2206206994597c13d831ec7', 'USDT'),('0xfe2e637202056d30016725477c5da089ab0a043a', 'SETH2'),('0x2260fac5e5542a773aa44fbcfedf7c193bc2c599', 'WBTC'),('0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', 'WETH'),('0x853d955acef822db058eb8505911ed77f175b99e', 'FRAX')))SELECTpool, token0, token1, CASEWHEN m0.token is NOT NULL AND m1.token is NOT NULL THEN 'major'ELSE 'minor'END AS pool_typeFROM combine AS cLEFT JOIN major AS m0 ON cast(c.token0 AS VARCHAR) = m0.tokenLEFT JOIN major AS m1 ON cast(c.token1 AS VARCHAR) = m1.token