Balances each cycle
liquid_next = floor(liquid * (1 - r))Apply this rule to each loose balance in atomic units each cycle.
staked_next = stakedA staked balance keeps its number during the cycle.
0 <= r < 1The rate can be zero but must stay below one.
The calculator accepts rates with at most 18 decimal places and whole cycle counts from 0 to 1000.
Residue and supply
The floor removes fractional atomic residue. Removed tokens and residue are destroyed and credited to nobody.
supply = sum(staked + liquid)Supply is the sum of all position balances.
fraction = (staked + liquid) / supplyFor positive supply, a position fraction is its balance divided by the remaining supply.
All position fractions sum to one when supply is positive.
Moving balances
stake: (liquid - amount, staked + amount)Staking moves the same amount from loose to staked in one atomic change.
unstake: (liquid + amount, staked - amount)Unstaking moves the same amount back without changing the token count at that instant.
These moves are value-neutral within the balance rule. They do not create tokens or set a market price.
The unstake fee is separate from this arithmetic. Its amount is not published yet.