Specifics of the farming algorithm are being implemented in the vault repo (safe-farming is a fairly general repo, whereas vault implements the specific events and amounts for rewards and costs).
This is just my reading of it, I kept my notes and uncertainties so any clarifications or details are more than welcome.
Some useful comments starting here: Nodes participating in the system are rewarded for their work. Elders are responsible for the duties of keeping track of rewards, and issuing payouts form the section account. The points can be anything, but in our StorageReward system, it is the number of bytes of a write operation.
(minor typo ‘form’ > ‘from’ in the comment)
Reward amount varies depending on the amount of data being PUT, small chunks reward less than big chunks.
See commit feat(farming): accumulate reward on data write.
Farming parameters in feat(farming): update metrics on elder churn.
Velocity is hardcoded as 2 as per rfc0057 source.
cost_base starts as zero source.
cost_base changes depending on the estimated total nodes in the network source.
minting_velocity is calculated as
store_cost starts as 0 source.
store_cost changes as
load on the node multiplied by
base_cost source. (I assume load is the node level not the section level? Worth double checking this.)
load is the change in the counter, ie
current_counter / previous_counter source.
The counter is updated … not sure when? It looks like it can be deduced from elder_duties/key_section/payment/mod.rs? It’s incremented when
process(PaymentDuty) is called.
cost_base is different to
store_cost, think of cost_base as part of the calculation for store_cost.