From 0539fa7d620e2a3b171db1d5ea986589e6577d8c Mon Sep 17 00:00:00 2001 From: Sean McGary Date: Thu, 12 Dec 2024 21:55:36 -0600 Subject: [PATCH] fix: add missing `floor()` sql function --- pkg/rewards/7_goldActiveODRewards.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/rewards/7_goldActiveODRewards.go b/pkg/rewards/7_goldActiveODRewards.go index e47582a8..a52dc019 100644 --- a/pkg/rewards/7_goldActiveODRewards.go +++ b/pkg/rewards/7_goldActiveODRewards.go @@ -157,8 +157,8 @@ active_rewards_final AS ( ar.*, CASE -- If the operator was not registered for any snapshots, just get regular tokens per day to refund the AVS - WHEN ar.num_registered_snapshots = 0 THEN ar.amount_decimal / (duration / 86400) - ELSE ar.amount_decimal / ar.num_registered_snapshots + WHEN ar.num_registered_snapshots = 0 THEN floor(ar.amount_decimal / (duration / 86400)) + ELSE floor(ar.amount_decimal / ar.num_registered_snapshots) END AS tokens_per_registered_snapshot_decimal FROM active_rewards_with_registered_snapshots ar )