- self.initial_stake = self.stake # for debugging purpose
- self.finalized_stake = (Num(airdrop) if hp else airdrop) if initial_stake==None else (Num(initial_stake) if hp else initial_stake) # after fork finalization
+ self.initial_stake = [self.stake] # for debugging purpose
+ self.finalized_stake = (Num(airdrop) if hp else airdrop)
self.Sigma = None
self.feedback = None
self.f = None
self.won=False
- self.commit = commit # commit to staked tokens
self.epoch_len=epoch_len # epoch length during which the stake is static
+ self.strategy = strategy if strategy is not None else Strategy(self.epoch_len)
+ self.apy_window = apy_window
self.staked_tokens_ratio = 1 # ratio of staked tokens, if commit is true then it's 100%
self.slot = 0
@@ -21,9 +23,14 @@ class Darkie(Thread):
return Darkie(self.finalized_stake)
def apy(self):
+ if self.apy_window == 0:
+ window=len(self.initial_stake)
# approximation to APY assuming linear relation
# note! relation is logarithmic depending on PID output.