constants.py 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. from decimal import Decimal as Num
  2. # number approximation terms
  3. N_TERM = 5
  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 = 10000
  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 = 10
  28. # one month in slots
  29. ONE_MONTH = 60*60*24*30/SLOT
  30. # one year in slots
  31. ONE_YEAR = 365.25*24*60*60/SLOT
  32. # vesting issuance period
  33. VESTING_PERIOD = ONE_MONTH
  34. # stakeholder assumes APR target
  35. TARGET_APR = 0.15
  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. # maximum transaction size
  41. MAX_BLOCK_SIZE = 100
  42. # maximum transaction computational cost
  43. MAX_BLOCK_CC = 10
  44. # fee controller computational capacity target
  45. FEE_TARGET = MAX_BLOCK_CC
  46. # max fee base value
  47. FEE_MAX = 1
  48. # min fee base value
  49. FEE_MIN = 0.00001
  50. # negligible value added to denominator to avoid invalid division by zero
  51. EPSILON = 1
  52. # window of accuracy calculation
  53. ACC_WINDOW = int(EPOCH_LENGTH)*10
  54. # headstart airdrop period
  55. HEADSTART_AIRDROP = 0
  56. # threshold of randomly slashing stakeholder
  57. SLASHING_RATIO = 0.000005
  58. # number of nodes
  59. NODES = 1000
  60. # headstart value
  61. BASE_L = NODES**-1*L
  62. # decimal high precision.
  63. L_HP = Num(L)
  64. F_MIN_HP = Num(F_MIN)
  65. F_MAX_HP = Num(F_MAX)
  66. EPSILON_HP = Num(EPSILON)
  67. REWARD_MIN_HP = Num(REWARD_MIN)
  68. REWARD_MAX_HP = Num(REWARD_MAX)
  69. BASE_L_HP = Num(BASE_L)
  70. CC_DIFF_EPSILON=0.0001
  71. MIL_SLOT = 1000