cybergenlabTop Virtual AI Tokens
Updated 2024-12-19
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
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
with token_meta as (
select
value:PLATFORM::string as platform,
value:POOL_ADDRESS::string as pool_address,
value:TOKEN_NAME::string as name,
value:TICKER::string as ticker,
value:TOKEN_ADDRESS::string as token_address,
value:DECIMALS::numeric as decimals,
value:SUPPLY::numeric as supply
from (
select
livequery.live.udf_api('https://flipsidecrypto.xyz/api/v1/queries/7aa557ad-d182-4403-b9ca-8a4b774530a3/data/latest') as response
), lateral FLATTEN (input => response:data)
order by 1 desc
)
, token_price_usdc as (
select
symbol_out,
avg((amount_out_usd/amount_out)) as price,
from base.defi.ez_dex_swaps
where contract_address in (select pool_address from token_meta)
and ticker in ('AIXBT', 'LUNA', )
and symbol_in= 'USDC'
and date_trunc('hour', block_timestamp) >= dateadd(hour, -6 , current_timestamp)
group by 1
)
, marketcap as (
select
name,
ticker,
price,
price * supply as marketcap,
token_address
from token_meta m
QueryRunArchived: QueryRun has been archived