Skip to content

Geyser APY

Nithin Krishna edited this page Dec 29, 2020 · 9 revisions

Pool Apy

The APY for a new user entering the pool at the current point in time.

periodSec = pool's bonus period in seconds
          = 2592000 # 30 day bonus

N = number of periods 
  = (365*24*3600)/periodSec

inflowVal = total deposits in USD
outflowVal = total AMPL unlocked in the next periodSec * AMPL price

i = yearly interest rate 
  = outflowVal/inflowVal * N 

APY = (1 + i / N ) ** N – 1
APY = (1 + outflowVal/inflowVal) ** N - 1

User Apy

The current APY for a user with a deposit.

periodSec = minimum of pool's bonus period and the time remaining in the program
          = min(2592000, 604800) # 30 day bonus, 1 week remaining

inflowVal = user deposits in USD

userStakingShares = totalStakedFor(user) * totalStakingShares / totalStaked
additionalStakingShares = additionalUserDeposits * totalStakingShares / totalStaked;
userTokenSecondsAfterT = userStakingShareSeconds + (userStakingShares + additionalStakingShares) * periodSec
totalTokenSecondsAfterT = totalStakingShareSeconds + (totalStakingShares + additionalStakingShares) * periodSec
userShareAfterT = userTokenSecondsAfterT / totalTokenSecondsAfterT
userDripAfterT = user's share of rewards in the next periodSec
               = (total AMPL unlocked in the next periodSec) * userShareAfterT

outflowVal = userDripAfterT * AMPL price

N = (365*24*3600)/periodSec
APY = (1 + outflowVal/inflowVal) ** N - 1
Clone this wiki locally