joystream icon indicating copy to clipboard operation
joystream copied to clipboard

Patronage interest rate calculation

Open ignazio-bovo opened this issue 2 years ago • 3 comments

Current patronage computation

patronage_amount = issuance * patronage_rate * blocks_per_year

Desired patronage calculation

patronage_amount = issuance * ( 1 + patronage_rate)^blocks_per_year - issuance

ignazio-bovo avatar Oct 17 '22 04:10 ignazio-bovo

  1. isnt the patronage rate annual? not per block?
  2. why is issuance being subtracted?

bedeho avatar Oct 17 '22 06:10 bedeho

  1. isnt the patronage rate annual? not per block?

blocks meant number of blocks in a year (I have renamed it now). The user gets to specified the annual rate, but we store it as per block rate to have easier computations (which is similar to what the pallet vesting is doing)

  1. why is issuance being subtracted?

To obtain the net amount that will be granted to the creator account: If I put 10 $ into a risk free bond with 3% interest rate in 10 years the amount will be 10 * (1 + 3%)^10 the net gain 10 * (1 + 3%)^10 - 10

ignazio-bovo avatar Oct 17 '22 08:10 ignazio-bovo

ok, makes sense.

bedeho avatar Oct 17 '22 11:10 bedeho

Remember to update benchmark if extra computation is required

ignazio-bovo avatar Mar 07 '23 15:03 ignazio-bovo