mlhUntitled Query
Updated 2022-07-27Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
›
⌄
SELECT
sum(instructions[0]:parsed:info:amount / 1e6) as volume,
COUNT(DISTINCT instructions[0]:parsed:info:owner) as unique_users,
inner_instructions[0]:instructions[0]:parsed:info:destination as pool_address,
CASE
WHEN pool_address = '5uBU2zUG8xTLA6XwwcTFWib1p7EjCBzWbiy44eVASTfV' THEN 'USDC'
WHEN pool_address = 'Hv7yPYnGs6fpN3o1NZvkima9mKDrRDJtNxf23oKLCjau' THEN 'USDT'
WHEN pool_address = '4R6b4aibi46JzAnuA8ZWXrHAsR1oZBTZ8dqkuer3LsbS' THEN 'USDC-eth'
WHEN pool_address = '2DMUL42YEb4g1HAKXhUxL3Yjfgoj4VvRqKwheorfFcPV' THEN 'USDT-eth'
WHEN pool_address = '9KMH3p8cUocvQRbJfKRAStKG52xCCWNmEPsJm5gc8fzw' THEN 'USDT-bsc'
WHEN pool_address = 'DukQAFyxR41nbbq2FBUDMyrtF2CRmWBREjZaTVj4u9As' THEN 'BUSD-bsc'
ELSE NULL
END as pools
FROM solana.core.fact_transactions
WHERE INSTRUCTIONS[1]:programId = 'SWiMDJYFUGj6cPrQ6QYYYWZtvXQdRChSVAygDZDsCHC'
AND pools is not NULL
GROUP BY 3,4
Run a query to Download Data