Skip to content

Commit f39b546

Browse files
committed
discounting already unlocked rewards from drip
1 parent 9434e52 commit f39b546

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

frontend/src/utils/stats.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
import { BigNumber, BigNumberish } from 'ethers'
22
import { toChecksumAddress } from 'web3-utils'
33
import { formatUnits, parseUnits } from 'ethers/lib/utils'
4-
import { getGeyserVaultData, getBalanceLocked, getCurrentVaultReward, getFutureUnlockedRewards } from '../sdk/stats'
4+
import {
5+
getGeyserVaultData,
6+
getBalanceLocked,
7+
getCurrentVaultReward,
8+
getCurrentUnlockedRewards,
9+
getFutureUnlockedRewards,
10+
} from '../sdk/stats'
511
import {
612
Geyser,
713
GeyserStats,
@@ -148,7 +154,9 @@ const getPoolDrip = async (geyser: Geyser, end: number, signerOrProvider: Signer
148154
const geyserAddress = toChecksumAddress(geyser.id)
149155
const d = await ls.computeAndCache<GeyserStats>(
150156
async function () {
151-
return (await getFutureUnlockedRewards(geyserAddress, endTimeSec, signerOrProvider)).toString()
157+
const futureRewards = await getFutureUnlockedRewards(geyserAddress, endTimeSec, signerOrProvider)
158+
const currentRewards = await getCurrentUnlockedRewards(geyserAddress, signerOrProvider)
159+
return futureRewards.sub(currentRewards).toString()
152160
},
153161
`${geyser.id}|${endTimeSec}|poolDrip`,
154162
statsCacheTimeMs,

0 commit comments

Comments
 (0)