akbaridriapegaxy 1
Updated 2022-07-08
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 data_tx as (
select
substring(data, 91, 40) as contracts,
tx_hash
from polygon.core.fact_event_logs
where
(
origin_function_signature = '0xd6febde8' -- fixed price
and
contract_address = '0x25a751bfb51560c2aadf4250de0730eb4eea50c4'
and
block_timestamp::date >= CURRENT_DATE - 30
)
or
(
origin_function_signature = '0x0bb5eaf3' -- fixed price
and
contract_address = '0x66e4e493bab59250d46bfcf8ea73c02952655206'
and
block_timestamp::date >= CURRENT_DATE - 30
)
or
(
origin_function_signature = '0xb9a2de3a' -- autctions
and
contract_address = '0x66e4e493bab59250d46bfcf8ea73c02952655206'
and
block_timestamp::date >= CURRENT_DATE - 30
)
group by 1, 2
)
, pgx_price as (
select
block_timestamp::date as date,
avg((try_to_number(event_inputs:amount1Out::string)/pow(10, 6))/(try_to_number(event_inputs:amount0In::string)/pow(10, 18))) as price_pgx
from
Run a query to Download Data