boomer77TerraSwap Pool Fee Performance
Updated 2021-09-08
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
›
⌄
with tvl as (select date, address_name, sum(balance_usd), address
from terra.daily_balances
where address_name like '%Terraswap %' and balance_usd > 0
order by 1 desc),
comm as (select date_trunc('day',block_timestamp) as block_day, event_attributes:contract_address::string as contract_address, sum(event_attributes:commission_amount/1e6) as commission
from terra.msg_events
where event_type = 'from_contract' and event_attributes:commission_amount > 0 and contract_address is not null
group by 1,2)
select a.date, a.address_name ,a.balance, b.commission, (b.commission/a.balance)*100 as apr
from tvl a
join comm b on a.date = b.block_day and a.address = b.contract_address
order by 1 desc
Run a query to Download Data