maybeyonaspolygon_apr
Updated 2022-03-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
kashi_pairs as (
select
tx_id,
event_inputs,
event_inputs:cloneAddress::string as pair_address,
'0x'||substring(event_inputs:data::string, 155, 40) as collateral,
'0x'||substring(event_inputs:data::string, 219, 40) as asset
from polygon.events_emitted
where contract_address = '0xf5bce5077908a1b7370b9ae04adc565ebd643966'
and tx_succeeded = 'TRUE'
and event_name = 'LogDeploy'
and collateral is not null
and asset is not null
)
-- kashi_fees as (
-- select
-- block_timestamp,
-- contract_address,
-- event_inputs:accruedAmount as fees_accrued,
-- fees_accrued*0.1 as to_sushibar
-- from ethereum.events_emitted
-- where event_name = 'LogAccrue'
-- and tx_succeeded = 'TRUE'
-- and event_inputs:feeFraction is not null
-- and contract_address in (select pair_address from kashi_pairs)
-- ),
-- prices as (
-- select
-- date(hour) as date,
-- token_address,
-- symbol,
-- decimals,
-- avg(price) as price
-- from ethereum.token_prices_hourly
-- where token_address in (select collateral from kashi_pairs)
Run a query to Download Data