From 1e1b75e01b4e710b88c1977f3117b6b091307e8d Mon Sep 17 00:00:00 2001 From: kaladinlight <35275952+kaladinlight@users.noreply.github.com> Date: Tue, 16 Jul 2024 10:17:15 -0600 Subject: [PATCH] use raw value (not divided by wad) --- scripts/hotWalletCli/client.ts | 4 ++-- scripts/hotWalletCli/index.ts | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/hotWalletCli/client.ts b/scripts/hotWalletCli/client.ts index edf6b00..a227c06 100644 --- a/scripts/hotWalletCli/client.ts +++ b/scripts/hotWalletCli/client.ts @@ -158,7 +158,7 @@ export class Client { }) const totalRewardUnits = await contract.read.earned([address], { blockNumber: endBlock }) - const rewardUnits = (totalRewardUnits - totalRewardUnitsPrevEpoch) / RFOX_WAD + const rewardUnits = totalRewardUnits - totalRewardUnitsPrevEpoch closingStateByStakingAddress[address] = { rewardUnits, totalRewardUnits, runeAddress } } @@ -235,7 +235,7 @@ export class Client { info(`Total addresses receiving rewards: ${addresses.length}`) - const epochRewardUnits = (RFOX_REWARD_RATE / RFOX_WAD) * secondsInEpoch + const epochRewardUnits = RFOX_REWARD_RATE * secondsInEpoch const epochRewardUnitsMargin = BigNumber(epochRewardUnits.toString()).times(0.01) if (epochRewardUnitsMargin.lte(Math.abs(Number(epochRewardUnits - totalEpochRewardUnits)))) { diff --git a/scripts/hotWalletCli/index.ts b/scripts/hotWalletCli/index.ts index a3ec51d..86e2c63 100644 --- a/scripts/hotWalletCli/index.ts +++ b/scripts/hotWalletCli/index.ts @@ -19,8 +19,6 @@ const processEpoch = async () => { const metadata = await ipfs.getMetadata('process') - metadata.epochEndTimestamp = Date.now() - const month = MONTHS[new Date(metadata.epochStartTimestamp).getUTCMonth()] info(`Processing Epoch #${metadata.epoch} for ${month} distribution.`)