It is not that the potential supply is used in the code. In fact, it is not. The existence of the potential supply is a logical conclusion or effect of the limit on the debt ratio.
The potential supply is the maximum that the HIVE supply can grow in the event that all of the circulating HBD is converted at the same time.
Even though it is not tracked or mentioned explicitly, it nonetheless exists.
Before the last hard fork, the virtual supply represented the total supply of HIVE that could come into existence if all of the HBD was converted at the same time and it could not grow beyond the limit set by the debt ceiling. However, after the last change in the code, the amounts in the DHF do not count toward the debt limit but they are included in the virtual supply.
For that last reason, the virtual supply no longer represents the maximum that the HIVE supply can grow if all of the HBD are converted. Instead, it only serves as the base used to calculate how much HIVE and/or HBD is emitted on any given day. And. the virtual supply can actually be higher than the potential supply.
If the virtual supply includes the balance in the DHF then it is not a good measure of the true debt ratio. This could be fixed if we do not include the HBD balance in the DHF in the virtual supply but that requires a code change.
RE: Introducing HBDSTATS.COM | A Simple And Easy Way To Track The Health Of HBD | Hive Debt, HBD Support Price, HBD Supply And More