# Compounded Dynamic Staking

Last updated

Last updated

Compound Dynamic Staking

Finceptor employs an auto-compounded vault mechanism for $FINC staking, compounding investor stakes to generate exponential returns and calculate the token sale allocations based on the compounded capital. An auto-compound mechanism is used to reinvest rewards generated from the staking pool into the same staking pool, creating a compound effect.

Reward, APR, & APY Calculations

A time-based mathematical formula is used to track the rewards and staking balances of every staker in the vault and the formula is updated according to the last update time and current time after every staking amount changing transaction.

The parameters are as follows:

(can be any user)**LastUpdateTime**

(total staked amount)**TotalSupply****UserBalance**

(total reward added to the user so far)**Rewards[.]**

(Total rewards paid to all users so far)**PaidReward[.]**

(reward to pay in return for a single token per second)**RewardRate**

Letās imagine * user A staking 100 $FINC* tokens. The

**updateRewards**

function is called before the staking action and the initial parameters are updated as follows.$rewardsPerTokenStored = 0 \text{ (Since totalSupply is zero initially)} \\lastUpdateTime=t_0$

āThen, the reward parameters of user A,

, are updated as follows.**rewards[A] and userRewardPerTokenPaid[A]**

āAfter updating these parameters, the algorithm continues with the accumulation of **totalSupply and balances[A].**

Now that we have initialized the first staking parameters and we have a non-zero

; letās imagine a new **totalSupply****user B staking 200 tokens** assuming `t1`

is the current time.

āāThen, the reward parameters of user B,

are updated as follows. **rewards[B] and userRewardPerTokenPaid[B], **

After updating these parameters, the algorithm continues with the accumulation of **totalSupply and balances[B].**

Now, let's imagine that another user joins the staking pool, say user C, staking 300 $FINC tokens.ā

is updated as follows.**rewardsPerTokenStored and lastUpdateTime**

āThen, the reward parameters of user C,

are updated as follows.**rewards[C] and userRewardPerTokenPaid[C],**

After updating these parameters, the algorithm continues with the accumulation of **totalSupply and balances[C].**

Now the essential part of the algorithm comes to play. What if user **B wants to claim their rewards**? How does the algorithm calculate how much B has earned since they staked after A but before C?

function also triggers the **getReward**

function so the parameters are updated.**updateRewards**

āThen, the reward parameters of user B,

, are updated as follows.**rewards[B]**

āFinally,

is calculated as follows.**userRewardPerTokenPaid[B]**

Now the necessary updates have been completed and user B is ready to claim their rewards which are stored in the

mapping that we just updated. The reward is sent to the user and is reset to 0 until they claim again at a later time. As seen from the calculations, the reward is calculated so that it does not account for the time period where B has not staked (There was only user A) but accounts for the time periods where there is**rewards[B]**

and **<A, B>**

> separately. This algorithm handles every userās rewards in the same way.**<A, B, C**

Auto-Compound Strategy

To understand auto-compound strategy in $FINC staking, the concept of

and **APR (Annual Percentage Rate)**

should be understood. Simply, **APY (Annual Percentage Yield)**

is simple and **APR**

is compound interest, reflecting the interest you make in your interest.**APY**

where

is the total interest paid over the life of the staking, **InterestReturn**

is the total deposit, and **principal**

is the number of days in the total reward period. Hence, there is no rebasing or reinvesting included whereas, in the APY calculation, interest on the earned interest (reinvesting effect) is also considered.**n**

where

is the compounding frequency (e.g., daily, weekly, monthly, quarterly, etc.) With every rebase, the returned interest reward is added to the stakers' balance automatically resulting in a higher compound rate in the next period. **N**

To compare

and **APR**

, let's imagine that $FINC staking offers 100% **APY**

at a certain timeframe, and imagine this **APR**

continues to remain the same for over one year. Then, let **APR**

i.e., if compounding frequency is daily, and let **N = 365, **

then **Principal = $10,000**

and**APY, TotalInterest**

will be**FutureValue**

Hence, there is a

interest rate difference between **71.4567%**

and **APR****APY.**

āDaily compound interest accumulated

of the user to **FutureValue**

which will be **27,145.67**

if compound interest wouldn't be considered, creating a **20,000**

extra interest. To compare the compound effect of the $FINC auto-compound staking pool with the simple staking pools, here is the graph representing the accumulated $FINC amount over time; the difference between auto-compounded capital and simple capital is increasing over time, reaching **7,145.67**`7,145.67 `

at the end of the first year and

at the end of the second year.**43688.76**

Protocol Fees

Note that staking/vault fees are not considered here; however, the calculation of the APR can be computed considering network fees as follows.

āwhere

is the actual **RealizedAPR**

rate after subtracting protocol fees **APR****FP.**

$rewards[A] = 0 \text{ (Since balance of A is 0 initially) } \\ userRewardPerTokenPaid[A] = rewardsPerTokenStored \text{ (0 in this case) }$

$totalSupply=0+100=100 \\
balances[A]=0+100=100$

$rewardsPerTokenStored = 0 + (t_1-t_0) * \dfrac{rewardRate}{100 * totalSupply} \\
lastUpdateTime=t_1 \\$

$rewards[B]= 0 \text{ (Since balance of B is 0 initially)} \\
userRewardPerTokenPaid[B] = rewardsPerTokenStored = \dfrac{(t_1-t_0) * rewardRate}{100 * totalSupply}$

$totalSupply=100+200=300 \\
balances[B]=0+200=200$

$rewardsPerTokenStored= (t_1-t_0) * \dfrac{rewardRate}{100}+ (t_2-t_1) * \dfrac{rewardRate}{300} \\
lastUpdateTime=t_2$

$\\
rewards[C]=0 \text{ (Since balance of B is 0 initially)} \\ userRewardPerTokenPaid[C]=rewardsPerTokenStored =\dfrac{(t_1-t_0) * rewardRate}{100} * \dfrac{(t_2-t_1) * rewardRate}{300}$

$totalSupply=300+300=600 \\
balances[C]=0+300=300$

$rewardsPerTokenStored= (t_1-t_0) * \dfrac{rewardRate}{100} + (t_2-t_1) * \dfrac{rewardRate}{300} + (t_3-t_2) * \dfrac{rewardRate}{600} \\ lastUpdateTime=t3$

$rewards[B]=balances[B]* (rewardsPerTokenStored-userRewardPerTokenPaid[B])+rewards[B] \\ rewards[B]=200* ((t_1-t_0)* \dfrac{rewardRate}{100}+ (t_2-t_1)* \dfrac{rewardRate}{300}+ (t_3-t_2) * \dfrac{rewardRate}{600}- (\dfrac{(t_1 - t_0) *rewardRate}{100 * totalSupply})) \\ rewards[B]=200* ((t_2-t_1) * \dfrac{rewardRate}{300} + (t_3-t_2) * \dfrac{rewardRate}{600}\\$

$userRewardPerTokenPaid[B]= \dfrac{(t_1-t_0) * rewardRate}{100} + \dfrac{(t_2-t_1) * rewardRate}{300} + \dfrac{(t_3-t_2) * rewardRate}{600}$

$APR = (\dfrac{(\dfrac{InterestReturn}{Principal})}{n} * 365) *100$

$APY = (1 + \dfrac{APR}{n})^N - 1$

$APY = (1 + \dfrac{100}{365})^{365} - 1 = 171.4567 \%$

$\\ Future Value = \$27,145.67 \\ Total Interest=FutureValue -Principal = 17.145,67$

$Realized APR= APR * (1 - F_P) \\ RealizedAPY = (1 + \dfrac{APR * (1 - F_P)}{n})^N - 1$