Fug603helius livequery demo copy
Updated 2023-06-06
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
›
⌄
-- forked from theericstone-pine / helius livequery demo @ https://flipsidecrypto.xyz/theericstone-pine/q/2023-06-06-04-58-pm-Tl6lHT
with raw as (
SELECT livequery.live.udf_api(
'https://api.helius.xyz/v0/addresses/{{soladdress}}/balances?api-key={{helius-key}}'
) as response
),
tokens as (
select
value:mint::string as token,
value:amount / pow(10,value:decimals) as amount
from raw,
lateral flatten (input => response:data:tokens)
),
nativesol as (
select 'sol' as token,
response:data:nativeBalance / pow(10,9) as amount
from raw
)
select * from tokens
UNION
select * from nativesol;
Run a query to Download Data