Skip to content

Geyser APY

Nithin Krishna edited this page Jan 3, 2021 · 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

N = (365*24*3600)/periodSec

inflowVal = user deposits in USD

userStakingShares = totalStakedFor(user) * totalStakingShares / totalStaked
userTokenSecondsAfterT = userStakingShareSeconds + userStakingShares * periodSec
totalTokenSecondsAfterT = totalStakingShareSeconds + totalStakingShares * 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

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