constants.py 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. from decimal import Decimal as Num
  2. # number approximation terms
  3. N_TERM = 2
  4. # analogue controller enum
  5. CONTROLLER_TYPE_ANALOGUE=-1
  6. # discrete controller enum
  7. CONTROLLER_TYPE_DISCRETE=0
  8. # takahashi controller enum
  9. CONTROLLER_TYPE_TAKAHASHI=1
  10. # initial distribution of tokens (random value for sake of experimentation)
  11. ERC20DRK = 2.1*10**7
  12. # initial distribution
  13. PREMINT = ERC20DRK
  14. # group base/order
  15. L = 28948022309329048855892746252171976963363056481941560715954676764349967630337.0
  16. # secondary finalization controller minimal clipped value
  17. F_MIN = 0.0001
  18. # secondary finalization controller maximal clipped value
  19. F_MAX = 0.9999
  20. # primary reward controller minimal clipped value
  21. REWARD_MIN = 1
  22. # primary reward controller maximal clipped value
  23. REWARD_MAX = 1000
  24. # slot length in seconds
  25. SLOT = 90
  26. # epoch length in slots
  27. EPOCH_LENGTH = Num(10)
  28. # one month in slots
  29. ONE_MONTH = Num(60*60*24*30/SLOT)
  30. # one year in slots
  31. ONE_YEAR = Num(365.25*24*60*60/SLOT)
  32. # vesting issuance period
  33. VESTING_PERIOD = ONE_MONTH
  34. # stakeholder assumes APR target
  35. TARGET_APR = Num(0.12)
  36. # primary controller assumes accuracy target
  37. PRIMARY_REWARD_TARGET = 0.35 # staked ratio
  38. # secondary controller assumes certain frequency of leaders per slot
  39. SECONDARY_LEAD_TARGET = 1 #number of lead per slot
  40. # negligible value added to denominator to avoid invalid division by zero
  41. EPSILON = 1
  42. # window of accuracy calculation
  43. ACC_WINDOW = int(EPOCH_LENGTH)
  44. # headstart airdrop period
  45. HEADSTART_AIRDROP = 0
  46. # threshold of randomly slashing stakeholder
  47. SLASHING_RATIO = 0.0001
  48. # number of nodes
  49. NODES=1000
  50. # headstart value
  51. BASE_L = NODES**-1*L*0.01
  52. # decimal high precision.
  53. L_HP = Num(L)
  54. F_MIN_HP = Num(F_MIN)
  55. F_MAX_HP = Num(F_MAX)
  56. EPSILON_HP = Num(EPSILON)
  57. REWARD_MIN_HP = Num(REWARD_MIN)
  58. REWARD_MAX_HP = Num(REWARD_MAX)
  59. BASE_L_HP = Num(BASE_L)