From a58250e5e24f8244480208c13645e89c9933af0e Mon Sep 17 00:00:00 2001 From: Aleksandr Kaekhtin Date: Thu, 12 Dec 2024 18:34:46 +0300 Subject: [PATCH] =?UTF-8?q?=D1=81orrect=20the=20rounding=20of=20values?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seasons/sql/s7_defi_tvl.sql | 32 ++++++++++++++++---------------- seasons/sql/s7_defi_volume.sql | 12 ++++++------ 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/seasons/sql/s7_defi_tvl.sql b/seasons/sql/s7_defi_tvl.sql index 841068f..71c79c8 100644 --- a/seasons/sql/s7_defi_tvl.sql +++ b/seasons/sql/s7_defi_tvl.sql @@ -783,37 +783,37 @@ select "owner" as address, amount, join catton_total_tvl using(pool) group by 1 ), all_projects_impact as ( - select 'jVault' as project, *, floor(tvl_impact / 20.) * 5 as points from jvault_impact + select 'jVault' as project, *, trunc(tvl_impact / 20.) * 5 as points from jvault_impact union all - select 'SettleTon' as project, *, floor(tvl_impact / 20.) * 10 as points from settleton_impact + select 'SettleTon' as project, *, trunc(tvl_impact / 20.) * 10 as points from settleton_impact union all - select 'DAOLama' as project, *, floor(tvl_impact / 20.) * 10 as points from daolama_impact + select 'DAOLama' as project, *, trunc(tvl_impact / 20.) * 10 as points from daolama_impact union all - select 'TONHedge' as project, *, floor(tvl_impact / 20.) * 10 as points from tonhedge_impact + select 'TONHedge' as project, *, trunc(tvl_impact / 20.) * 10 as points from tonhedge_impact union all - select 'TONPools' as project, *, floor(tvl_impact / 20.) * 5 as points from tonpools_impact + select 'TONPools' as project, *, trunc(tvl_impact / 20.) * 5 as points from tonpools_impact union all - select 'Parraton' as project, *, floor(tvl_impact / 20.) * 10 as points from parraton_impact + select 'Parraton' as project, *, trunc(tvl_impact / 20.) * 10 as points from parraton_impact union all - select 'TONStable' as project, *, floor(tvl_impact / 20.) * 10 as points from tonstable_impact + select 'TONStable' as project, *, trunc(tvl_impact / 20.) * 10 as points from tonstable_impact union all - select 'Aqua' as project, *, floor(tvl_impact / 20.) * 10 as points from aqua_impact + select 'Aqua' as project, *, trunc(tvl_impact / 20.) * 10 as points from aqua_impact union all - select 'swap.coffee staking' as project, *, floor(tvl_impact / 20.) * 5 as points from swapcoffee_impact + select 'swap.coffee staking' as project, *, trunc(tvl_impact / 20.) * 5 as points from swapcoffee_impact union all - select 'Coffin' as project, *, floor(tvl_impact / 20.) * 5 as points from coffin_impact + select 'Coffin' as project, *, trunc(tvl_impact / 20.) * 5 as points from coffin_impact union all - select 'TONCO' as project, *, floor(tvl_impact / 20.) * 10 as points from tonco_impact + select 'TONCO' as project, *, trunc(tvl_impact / 20.) * 10 as points from tonco_impact union all - select 'Farmix' as project, *, floor(tvl_impact / 20.) * 10 as points from farmix_impact + select 'Farmix' as project, *, trunc(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 + select 'Crouton' as project, *, trunc(tvl_impact / 20.) * 10 as points from crouton_impact union all - select 'Delea' as project, *, floor(tvl_impact / 20.) * 10 as points from delea_impact + select 'Delea' as project, *, trunc(tvl_impact / 20.) * 10 as points from delea_impact -- union all - -- select 'Beetroot' as project, *, floor(tvl_impact / 20.) * 10 as points from beetroot_impact + -- select 'Beetroot' as project, *, trunc(tvl_impact / 20.) * 10 as points from beetroot_impact union all - select 'Catton' as project, *, floor(tvl_impact / 20.) * 10 as points from catton_impact + select 'Catton' as project, *, trunc(tvl_impact / 20.) * 10 as points from catton_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 diff --git a/seasons/sql/s7_defi_volume.sql b/seasons/sql/s7_defi_volume.sql index 51851ac..20db6ea 100644 --- a/seasons/sql/s7_defi_volume.sql +++ b/seasons/sql/s7_defi_volume.sql @@ -121,17 +121,17 @@ with lowfee_pools as ( ), degens as ( select distinct address from tol.enrollment_degen ed ), volume_points as ( - select *, floor(volume_usd / 20.) * 1 as points from rainbow_volume + select *, trunc(volume_usd / 20.) * 1 as points from rainbow_volume union all - select *, floor(volume_usd / 20.) * 5 as points from gaspump_volume + select *, trunc(volume_usd / 20.) * 5 as points from gaspump_volume union all - select *, floor(volume_usd / 20.) * 1 as points from swapcoffee_volume + select *, trunc(volume_usd / 20.) * 1 as points from swapcoffee_volume union all - select *, floor(volume_usd / 20.) * 5 as points from memepads_volume + select *, trunc(volume_usd / 20.) * 5 as points from memepads_volume union all - select *, floor(volume_usd / 20.) * 1 as points from moki_volume + select *, trunc(volume_usd / 20.) * 1 as points from moki_volume union all - select *, floor(volume_usd / 20.) * 1 as points from titan_volume + select *, trunc(volume_usd / 20.) * 1 as points from titan_volume ) select extract(epoch from now())::integer as score_time, address, project, points, volume_usd as "value", "count", min_utime, max_utime from volume_points