Flipside Data Scienceswap on DragonSwap SeiEVM
Updated 2024-06-07
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 sei_prices as (
Select
TO_TIMESTAMP(value [0] :: string) as hour,
'SEI' as token,
avg(value [1]) as avg_price
from
(
SELECT
livequery.live.udf_api(
'https://api.coingecko.com/api/v3/coins/sei-network/market_chart?vs_currency=usd&days=365'
) as resp
),
LATERAL FLATTEN (input => resp:data:prices)
group by
all
), t0 as (
select
block_timestamp,
tx_hash as tx_id,
1 as action_count,
LOWER(origin_from_address) as address,
1 as quest_step,
'SEI' as currency,
amount as token_amount,
TRUE as valid,
tx.tx_fee as fee_amount
from sei.core_evm.ez_native_transfers tr
left join sei.core_evm.fact_Transactions tx
using(block_timestamp, tx_hash)
WHERE
origin_function_signature in ('0x07a8399c', '0xdf0f02ef', '0x38ed1739')
and origin_to_address = '0xa4cf2f53d1195addde9e4d3aca54f556895712f2'
and origin_from_address = from_Address
-- and block_timestamp > current_date - 1
QueryRunArchived: QueryRun has been archived