AI WaifuHolders Activity after LBP
Updated 2024-03-20
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 waifu_txns as (
select
block_timestamp,
tx_hash,
-- origin_from_address,
-- origin_to_address,
contract_address,
concat ('0x', substr(topics[1], 27, 40)) :: string as from_address,
concat ('0x', substr(topics[2], 27, 40)) :: string as to_address,
livequery.utils.udf_hex_to_int(SUBSTR(data, 3, 64)) as amt
from blast.core.fact_event_logs
where topics[0]::string = '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' -- signifies token transfers
and contract_address = '0x129ed667bf8c065fe5f66c9b44b7cb0126d85cc3'
and data != '0x'
),
waifu_bal as (
select address, sum (flow) as balance
from (
select from_address as address, sum(-amt) / power (10, 18) as flow
from waifu_txns
group by from_address
union all
select to_address as address, sum(amt) / power (10, 18) as flow
from waifu_txns
group by to_address
)
group by 1
),
latest_buy as (
select to_address as address, max(date_trunc('day', block_timestamp)) as latest_buy_date
from waifu_txns
QueryRunArchived: QueryRun has been archived