---
# System prepended metadata

title: infinite recursive claim for on-chain-reward
tags: [BadgerDAO, DeFi]

---

# infinite recursive claim for on-chain-reward

###### tags: `DeFi` `BadgerDAO`

**Definition**
$$
Z_{0} = Reward_{Y} * \frac{Circulating_{X} * \frac{r}{MaxBPS}}{TotalSupply_{X}},TotalSupply = Reward + Circulating
$$
For `odd` index of i in the series:
$$
Z_{i} = Reward_{X} * \frac{Z_{i - 1}}{TotalSupply_{Y}}
$$
For `even` index of i in the series:
$$
Z_{i} = Reward_{Y} * \frac{Z_{i - 1}}{TotalSupply_{X}}
$$

------------------------------------------------------
**Summation**
Let 
$$
A = \frac{Reward_{X}}{TotalSupply_{Y}}, B = \frac{Reward_{Y}}{TotalSupply_{X}}, A*B = (\frac{Reward_{X}}{TotalSupply_{X}} * \frac{Reward_{Y}}{TotalSupply_{Y}}) \leqslant 1 
$$

Having
$$
\sum_{i=0}^{\infty}{Z_{i}} = Z_{0} + (Z_{1} + Z_{3} + Z_{5} + ...) + (Z_{2} + Z_{4} + Z_{6} + ...) 
$$
$$
(Z_{1} + Z_{3} + Z_{5} + ...) = Z_{0} * A + Z_{0} * A * (B * A) + Z_{0} * A * (B * A)^2 + ...
$$
$$
(Z_{2} + Z_{4} + Z_{6} + ...) = Z_{0} * (A * B) + Z_{0} * (A * B) * (A * B) + Z_{0} * (A * B) * (A * B)^2 + ...
$$

Then
$$
\sum_{i=0}^{\infty}{Z_{i}} = Z_{0} + Z_{0} * (\sum_{p=1}^{\infty}A * (B * A)^{p - 1}) + Z_{0} * (\sum_{q=1}^{\infty}A * B * (A*B)^{q - 1})
$$
Reduced to by https://en.wikipedia.org/wiki/Geometric_series#Closed-form_formula
$$
RewardsSum_{Y} = Z_{0} + \frac{Z_{0} * A * B}{1 - A * B}
$$
$$
RewardsSum_{X} = \frac{Z_{0} * A}{1 - B * A}
$$