Link Search Menu Expand Document

Supply formula


What we want is a formula that gives us the supply of NIM at any given time t. To do this first, we need the formula for the velocity. We know that it begins at and then decreases at a fixed percentage per year. This means it can only be a negative exponential:



We know that the supply begins at and then increases by at each instant t. We only need to calculate the integral over , and we get the formula:




We still need to decide what units of time we want for t and calculate the corresponding constants and . We want t to be in milliseconds for the code since the timestamps are in milliseconds, and we want the maximum precision possible. We also want the supply to be given in Lunas (1 NIM = 100,000 Lunas).

The initial velocity is simple to calculate. 525 NIM/minute corresponds to 875 Lunas/millisecond. For the decay, we know that the velocity should be 1.47% smaller after one year. First, we calculate the number of milliseconds in a year. By definition, there are 24∗60∗60∗1000 = 86400000 milliseconds in a day. We also know that, on average, a year has 365.2425 days. That gives us a total of 31556952000 milliseconds in a year. To get the decay then we solve the following equation:




From these constants and the general formula for the supply, we get the reference formula for the supply of Nimiq 2.0. This is the formula that will be in the code, and it is, by definition, ”the correct one.” (Note that we still need to know the initial supply!)



However, it might be more useful for other applications to have a supply formula that uses days instead of seconds and returns NIM instead of Lunas, so that we don’t have to handle very large numbers. In this case, we can recalculate the constants to yield:




Back to top