diff --git a/projects/defi/UTONIC.py b/projects/defi/UTONIC.py new file mode 100644 index 0000000..33957ed --- /dev/null +++ b/projects/defi/UTONIC.py @@ -0,0 +1,7 @@ +from models.project import DeFi + +UTONIC = DeFi( + name='utonic', + defillama_slug='utonic', + url='https://utonic.org/home' +) \ No newline at end of file diff --git a/seasons/S7_defi_scores.md b/seasons/S7_defi_scores.md index c55f6ed..2d1e4da 100644 --- a/seasons/S7_defi_scores.md +++ b/seasons/S7_defi_scores.md @@ -156,6 +156,12 @@ Users hold LP tokens [Crouton LP](https://tonviewer.com/EQB7Orui1z_dKONoHuglvi2b - User impact is equal to `Crouton LP balance increase` / `Total supply of Crouton LP` * `Total TVL` +### UTONIC + +[UTONIC](https://utonic.finance/) allows to deposit TON/stTON/tsTON to the pool and receive uTON as a reward. +User impact is calculated as mints minus burns for each user. + + Full list of participants and their impact on TVL could be obtained by [this query](sql/s7_defi_tvl.sql). @@ -184,4 +190,5 @@ Full list of participants and their impact on TVL could be obtained by [this que |Coffin|TVL|5| |TONCO|TVL|10| |Farmix|TVL|10| -|Crouton|TVL|10| \ No newline at end of file +|Crouton|TVL|10| +|UTONIC|TVL|10| diff --git a/seasons/s7.py b/seasons/s7.py index a34b027..a07913a 100644 --- a/seasons/s7.py +++ b/seasons/s7.py @@ -2,6 +2,7 @@ S7 season config """ from models.season_config import SeasonConfig +from projects.defi.UTONIC import UTONIC from projects.defi.Farmix import Farmix from projects.defi.Coffin import Coffin from projects.defi.SwapCoffee import SwapCoffeeVolume, SwapCoffeeTVL @@ -35,7 +36,7 @@ DAOLama, SettleTON, JVault, TONHedge, TonStable, Parraton, TonPools, AquaProtocol, SwapCoffeeTVL, Coffin, TONCO, Farmix, - Crouton + Crouton, UTONIC ], score_model=DeFiTVLContribution(squads=[ (lambda tvl: tvl >= 5e6, "Over 5M$"), diff --git a/seasons/sql/s7_defi_tvl.sql b/seasons/sql/s7_defi_tvl.sql index 5fd9092..13c05f3 100644 --- a/seasons/sql/s7_defi_tvl.sql +++ b/seasons/sql/s7_defi_tvl.sql @@ -473,6 +473,29 @@ 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 ), all_projects_impact as ( select 'jVault' as project, *, floor(tvl_impact / 20.) * 5 as points from jvault_impact union all @@ -499,6 +522,8 @@ tonco_collections as ( select 'Farmix' as project, *, floor(tvl_impact / 20.) * 10 as points from farmix_impact 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 ) select extract(epoch from now())::integer as score_time, p.address, project, points, tvl_impact as "value", "count", min_utime, max_utime from all_projects_impact p