🤩oLIT Rewards

For calculating the range of oLIT emission and eventually the oLIT APR, we need first calculate the price of the BunniToken in USD.

Bunni Token USD Price

We can use pricePerFullShare function in BunniLens contract to get the amount of each reserve token per single BunniToken

BunniLens on Mainnet:

Now we can multiply those values per the USD price of the reserve token and sum them to get the price of the corresponding Bunni Token

const [amount0, amount1] = await getPricePerFullShare(bunniKey);
const bunniTokenPriceUSD = amount0.div(Math.pow(10, bunniToken.pool.token0.decimals)).times(token0PriceUSD)
      .plus(amount1.div(Math.pow(10, bunniToken.pool.token1.decimals)).times(token1PriceUSD));

Annual Gauge Reward in USD

For calculating the lower and upper APRs, we need to get some extra parameters in the corresponding gauge:

// Code snippet
const inflationRateCall = await gaugeContract.inflation_rate();
const relativeWeightCall = await gaugeContract.getCappedRelativeWeight(thisPeriodTimestamp());
const tokenlessProductionCall = await gaugeContract.tokenless_production();
const workingSupplyCall = await gaugeContract.working_supply();

const inflationRate = new BigNumber(inflationRateCall).div(1e18);
const relativeWeight = new BigNumber(relativeWeightCall).div(1e18);
const tokenlessProduction = new BigNumber(tokenlessProductionCall);
const workingSupply = new BigNumber(workingSupplyCall).div(1e18);

With the above parameters we get the annualRewardUSD

NOTE: the oLITPriceUSD is determined by applying the discount factor to the LIT price which now is 50%

const relativeInflation = inflationRate.times(relative_weight);

const oLITPriceUSD = litPriceUSD.times(0.5);

const annualRewardUSD = relativeInflation.times(86400).times(365).times(oLITPriceUSD);

Lower and Upper vAPRs in Bunni gauges

Now we have all what we need to calculate the oLIT APRs, we first get the working supply in USD terms, for the upper APR what would be the annual reward / the working supply (both in USD terms).

While for the lower APR we use the tokenless_production weight, which affects how much staking weight is given to liquidity and how much is given to vote locked tokens.

 const effectiveSupply = workingSupply.gt(0) ? workingSupply : new BigNumber(1e-18); 
 const workingSupplyUSD = effectiveSupply.times(bunniTokenPriceUSD);

 const lowerAPR = annualRewardUSD.times(tokenlessProduction).div(100).div(workingSupplyUSD).times(100);
 const upperAPR = annualRewardUSD.div(workingSupplyUSD).times(100);
 

oLIT vAPR

Lower and Upper APR are the range in which the oLIT rewards can fell, to get the proper percentage we need to also calculate the boost Liquis has.

Bunni's formula for getting the corresponding relative weight in a specific gauge is:

Where

With this formula we can calculate Liquis boost for each gauge:

const tokenless = tokenlessProduction / 100
const tokenRatio = 1 - tokenless

const liquisLiquidity = lpTokenLiquisBalance;
const totalLiquidity = lpTokenGaugeBalance;
const veLitLiquisLiquidity = (totalLiquidity * veLitLiquis) / veLitTotal

const workingBalance = Math.min(tokenless * liquisLiquidity + tokenRatio * veLitLiquisLiquidity, liquisLiquidity)

const multiplier = 1 / tokenless

const boost = (workingBalance / liquisLiquidity) * multiplier

Once we have the boost we can simply multiply the lower APR for the boost to get the actual Liquis boosted oLIT vAPR

NOTE: Liquis currently charges a 25% fee on oLIT rewards which is splitted as following

  • 19.5% to liqLIT stakers

  • 3% to LIQ lockers (vlLIQ)

  • 2% to the Liquis Treasury

  • 0.5% to Keepers triggering the transactions

Last updated