scottincryptostMATIC Dex Prices
Updated 2022-12-04
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 chainlink_stmatic as (
select
block_timestamp
, 'Chainlink' as feed
, event_inputs:current::int / 1e8 as price
from polygon.core.fact_event_logs
where 1=1
and contract_address = lower('0x0faf504bee22AF6E92D6697Af2EAfB9941a1712D')
and block_timestamp >= current_date - interval'30 days'
and event_name = 'AnswerUpdated'
order by block_timestamp desc
)
-- , chainlink_wbtc as (
-- select
-- block_timestamp
-- , time_slice(block_timestamp, 15, 'minute') as block_time
-- , 'Chainlink' as feed
-- , event_inputs:current::int / 1e8 as price
-- from ethereum.core.fact_event_logs
-- where 1=1
-- and contract_address = '0xae74faa92cb67a95ebcab07358bc222e33a34da7'
-- and block_timestamp >= current_date - interval'30 days'
-- and event_name = 'AnswerUpdated'
-- order by block_timestamp desc
-- )
, dex_prices as (
select
time_slice(block_timestamp, 15, 'minute') as block_time
, platform || ' ' || pool_name as feed
, case
when symbol_in = 'USDC' then amount_in
else amount_out
end as usdc_amount
Run a query to Download Data