Skip to content

Commit

Permalink
use raw value (not divided by wad)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaladinlight committed Jul 16, 2024
1 parent ae883c8 commit 1e1b75e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions scripts/hotWalletCli/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
}
Expand Down Expand Up @@ -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)))) {
Expand Down
2 changes: 0 additions & 2 deletions scripts/hotWalletCli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.`)
Expand Down

0 comments on commit 1e1b75e

Please sign in to comment.