## Note on Filecoin circulating supply and generating functions The main mechanism of Filecoin circulating supply can be reduced to \begin{align*} s(t)=\varphi(t)-\underset{\text{consensus pledge collateral}}{\underbrace{\gamma\int_{\rho}^{t}s(t-\tau)\partial_{t}\text{ln}p(t-\tau)dG(\tau)}}\,. \end{align*} Here s(t) is circulating supply, which has minting $(m)$, vesting $(v)$, burning $(b)$ and locking $(l)$ components, and is considered as fraction of emitted supply: $s =\frac{m+v-b-l}{m+v}$. The next term is non-locked supply: $\varphi =\frac{m+v-b}{m+v}$. $\gamma$ is the consensus target lock multiplier, $p(t)$ is power added, and $G$ is a measure for power lifetimes. This expression makes it clear there's a recursive structure in Filecoin supply. Recursive structures in general can be tackled using the discrete mathematics of generating functions. This will be approach used here and will hopefully provide some insight and simple way to project forward Filecoin circulating supply. The strategy to do this will be as follows: 1. Write the an approximate discrete form of the above expression 2. Generalise the equation to power series 3. Use the properties of generating functions to find an analytic expression for future supply **Step 1** An *approximate* discrete form of the above is the linear recursion \begin{align*} s_{t}=\varphi-\gamma\left(\tilde{p}_{1}s_{t-1}+\tilde{p}_{2}s_{t-2}\right)\,. \end{align*} The approximations here are 1. $\varphi$ is constant. Roughly this is okay. 2. Supply today only depends on two earlier steps. This is significant approximation and should be viewed as easiest step that captures the history dependence. We will look at generalising it later. 3. $\tilde{p_{1}}$ is the power growth rate times power surivival time. It is assumed to be constant constant. **Step 2** Convert the above expression to a power series: \begin{align*} \sum_{t\ge2}s_{t}x^{t}=\sum_{t\ge2}\varphi x^{t}-\sum_{t\ge2}\gamma\tilde{p}_{1}s_{t-1}x^{t}+\sum_{t\ge2}\gamma\tilde{p}_{2}s_{t-2}x^{t} \end{align*} Note, here $x$ has no intrinsic meaning. It is just a clothesline on which to hang information, and mathematical device to be able to manipulate that information. Next we add in two extra terms $s_{0}+s_{1}x^{1}$ to each side \begin{align*} \underset{S(x)}{\underbrace{s_{0}+s_{1}x^{1}+\sum_{t\ge2}s_{t}x^{t}}}=s_{0}+s_{1}x^{1}+\sum_{t\ge2}\varphi x^{t}-\sum_{t\ge2}\gamma\tilde{p}_{1}s_{t-1}x^{t}+\sum_{t\ge2}\gamma\tilde{p}_{2}s_{t-2}x^{t} \end{align*} to allow the introduction of the generating function of $s_{t}$ which is by definition $S(x)=\sum_{t\ge0}s_{t}x^{t}$. Furthermore, for future use define the power series $\Phi(x)=\sum_{t\ge2}\varphi x^{t}$. Now manipulate the above equation to express in terms of S(x) on both sides: \begin{align*} S(x) & = s_{0}+s_{1}x^{1}+\sum_{t\ge2}\varphi x^{t}-\sum_{t\ge2}\gamma\tilde{p}_{1}s_{t-1}x^{t}-\sum_{t\ge2}\gamma\tilde{p}_{2}s_{t-2}x^{t}\\ & =s_{0}+s_{1}x^{1}+\Phi(x)-x^{1}\gamma\tilde{p}_{1}\sum_{t\ge2}s_{t-1}x^{t-1}-x^{2}\gamma\tilde{p}_{2}\sum_{t\ge2}s_{t-2}x^{t-2}\\ & =s_{0}+s_{1}x^{1}+\Phi(x)-x^{1}\gamma\tilde{p}_{1}\left(\sum_{t\ge0}s_{t}x^{t}-s_{0}x^{0}\right)-x^{2}\gamma\tilde{p}_{2}\sum_{t\ge0}s_{t}x^{t}\\ & =s_{0}+s_{1}x^{1}+\Phi(x)+x^{1}\gamma\tilde{p}_{1}s_{0}-x^1\gamma\tilde{p}_{1}S(x)-x^{2}\gamma\tilde{p}_{2}S(x)\\ & =s_{0}+\left(s_{1}+\gamma\tilde{p}_{1}s_{0}\right)x^{1}+\Phi(x)-x^1\gamma\tilde{p}_{1}S(x)-x^{2}\gamma\tilde{p}_{2}S(x) \end{align*} Therefore \begin{align*} S(x)+\gamma\tilde{p}_{1}x^1S(x)+\gamma\tilde{p}_{2}x^{2}S(x)=s_{0}+\left(s_{1}+\gamma\tilde{p}_{1}s_{0}\right)x^{1}+\Phi(x) \end{align*} and so the generating function is \begin{align*} S(x)=\frac{s_{0}+\left(s_{1}+\gamma\tilde{p}_{1}s_{0}\right)x^{1}+\Phi(x)}{1+\gamma\tilde{p}_{1}x^1+\gamma\tilde{p}_{2}x^{2}} \end{align*} **Step 3** By the definition of the generating function, $S(x)=\sum_{t\ge0}s_{t}x^{t}$, the $t^{\text{th}}$ derivative of $S(x)$ at $x=0$ gives the supply at time step t: \begin{align*} s_{t}=\partial_{x}^{t}S(x)_{|x=0}/t! \end{align*} Since $\partial_{x}^{t}S(x)_{|x=0}/t!$ **does have an analytic expression**, albeit too long to write here, we can simply evaluate it. **Next steps** The next steps are to one-by-one improve the approximations introduced above to get a tractable analytic expression. The first step is the unlock power not at $t-2$ but at $t-k$ where $k$ is a more realistic power unlocking duration.