Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Utonic scoring #288

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions seasons/sql/s7_defi_tvl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -473,29 +473,6 @@ tonco_collections as (
cross join crouton_total_supply
cross join crouton_total_tvl
group by 1
), utonic_flow as (
-- get all mints and burns during the period
select "owner" as address, amount,
utime as event_time from parsed.jetton_mint jm
where jetton_master_address = upper('0:1f1798f724c2296652e6002bfb51bed11fb5a689532e5788af7203581ef367a8')
and utime >= 1732705200 and utime < 1734433200 and successful

union all

-- burns come with negative amount
select "owner" as address, -1 * amount as amount,
tx_now as event_time from public.jetton_burns
where jetton_master_address = upper('0:1f1798f724c2296652e6002bfb51bed11fb5a689532e5788af7203581ef367a8')
and tx_now >= 1732705200 and tx_now < 1734433200 and not tx_aborted
), uton_price as (
-- uTON is traded on DEXs so will get price from the agg_prices just before the period end
select coalesce((select price_usd from prices.agg_prices ap where ap.base = upper('0:1f1798f724c2296652e6002bfb51bed11fb5a689532e5788af7203581ef367a8')
and price_time < 1734433200 order by price_time desc limit 1), 0) as price
), utonic_impact as (
-- final user impact - sum of all mints and burns (with negative value of the amount) converted to USD using DEX price
select address, sum(amount) * (select price from uton_price) / 1e6 as tvl_impact, count(1), min(event_time) as min_utime, max(event_time) as max_utime
from utonic_flow
group by 1
), delea_flow as (
-- get all mints during the period
select "owner" as address, amount,
Expand Down Expand Up @@ -553,8 +530,6 @@ tonco_collections as (
union all
select 'Crouton' as project, *, floor(tvl_impact / 20.) * 10 as points from crouton_impact
union all
select 'UTONIC' as project, *, floor(tvl_impact / 20.) * 10 as points from utonic_impact
union all
select 'Delea' as project, *, floor(tvl_impact / 20.) * 10 as points from delea_impact
)
select extract(epoch from now())::integer as score_time, p.address, project, points, tvl_impact as "value", "count", min_utime, max_utime
Expand Down