Skip to content
Dune Analytics

@Brecht / Loopring Exchange Token Balances

SQL query

1WITH token_table AS (
2    SELECT 0 AS "tokenId", '\x0000000000000000000000000000000000000000'::bytea AS token, 'WETH' AS "symbol", 
3          18 AS decimals, (SELECT price FROM prices.usd WHERE symbol = 'WETH' ORDER BY minute desc LIMIT 1)  as price
4    UNION
5    SELECT 15 AS "tokenId", '\x85eee30c52b0b379b046fb0f85f4f3dc3009afec'::bytea AS token, 'KEEP' AS "symbol", 
6          18 AS decimals, 0.5 as price
7    UNION
8    SELECT 16 AS "tokenId", '\xa1d65E8fB6e87b60FECCBc582F7f97804B725521'::bytea AS token, 'DXD' AS "symbol", 
9           18 AS decimals, 80 as price
10    UNION
11    SELECT 17 AS "tokenId", '\x0Ba45A8b5d5575935B8158a88C631E9F9C95a2e5'::bytea AS token, 'TRB' AS "symbol", 
12           18 AS decimals, 5 as price
13    UNION
14    SELECT 20 AS "tokenId", '\xeb4c2781e4eba804ce9a9803c67d0893436bb27d'::bytea AS token, 'renBTC' AS "symbol", 
15           8 AS decimals, 9000 as price
16    UNION
17    SELECT 32 AS "tokenId", '\x89ab32156e46f46d02ade3fecbe5fc4243b9aaed'::bytea AS token, 'PNT' AS "symbol", 
18           18 AS decimals, 0.7 as price
19    UNION
20    SELECT 37 AS "tokenId", '\x56d811088235F11C8920698a204A5010a788f4b3'::bytea AS token, 'BZRX' AS "symbol", 
21           18 AS decimals, 0.36 as price
22    UNION
23    SELECT 60 AS "tokenId", '\x6a6c2ada3ce053561c2fbc3ee211f23d9b8c520a'::bytea AS token, 'TON' AS "symbol", 
24           18 AS decimals, 0.012 as price
25    UNION...

SQL query results

Loading