Hessishast - users ovr
Updated 2024-12-17
999
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
prices as
(SELECT date_trunc('day',hour) as day, avg(close) as pr, case
when ASSET_ID = 'ethereum' then 'ETH'
when ASSET_ID = 'usd-coin' then 'USDC'
when ASSET_ID = 'solana' then 'SOL'
end as Eclipse_cr
from crosschain.price.fact_prices_ohlc_hourly
where hour::date >= '2024-12-01' and
ASSET_ID in ('ethereum', 'solana', 'usd-coin')
and PROVIDER = 'coingecko'
GROUP by all),
borrows as
(select
amount/pow(10,decimal) as volume,
pr,
volume*pr as usd,
case
when mint = 'BeRUj3h7BqkbdfFU7FBNYbodgf8GCHodzKvF9aVjNNfL' then 'SOL'
when mint = 'AKEWE7Bgh87GPp171b4cJPSSZfmZwQ3KaqYqXoKLNAEE' then 'USDC'
when mint = 'Eth1111111111111111111111111111111111111111' then 'ETH'
when mint = 'So11111111111111111111111111111111111111112' then 'ETH'
else mint
end as token,
case
when TX_FROM = 'DeRTnD4sgiPzNQaiximquqD5yZAhu3Aws2g4n2e8tNuR' then 'ETH market'
when TX_FROM = 'tyvjvUtLxNFQXWxQSerSzZdhTe1YCzq1odtmouLbtXx' then 'SOL market'
when TX_FROM = 'JBUYTVaQAvp61GKnbgooEEzyTsevG1x5fYDnGoDD2soT' then 'USDC market' end as market,
a.TX_to as usr,
a.TX_ID,
a.BLOCK_TIMESTAMP
from eclipse.core.fact_transfers a
join eclipse.core.fact_transactions b
QueryRunArchived: QueryRun has been archived