Salehherewallet_swap_date_asset
Updated 2024-08-24
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 lst_price as (
select
date_trunc(hour,HOUR) as price_date
-- ,token_contract
,avg(CLOSE) as avg_price
from near.price.fact_prices_ohlc_hourly
-- where token_contract='wrap.near'
where ASSET_ID='wrapped-near'
and price_date is not null
group by 1
)
,lst_check as (
------------------check herewallet swap--------------------------------
select
tx_hash
,split( array_to_string(LOGS,' '),'Referral')
from near.core.fact_receipts
-- where tx_hash='4FmN3sCGKbSGD1F28qwx37coys49vFG1i9fhETEeci68'
where BLOCK_TIMESTAMP::date >= '2023-11-07'
and array_to_string(logs,' ') ilike '%owner.herewallet.near%'
and RECEIVER_ID='v2.ref-finance.near'
)
----------------this section from saeed--------------------------------
,min_max_swap_indexes as (
select
tx_hash
,min (swap_index) min_index
,max(swap_index) max_index
from near.defi.ez_dex_swaps
where BLOCK_TIMESTAMP::date >= '2023-11-07'
group by 1
),
swapped_in as (
select
block_timestamp::date date
,tx_hash
QueryRunArchived: QueryRun has been archived