Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added "ema" algos (exp moving avg) #26

Merged
merged 2 commits into from Nov 7, 2017

Conversation

jacob-eliosoff
Copy link
Contributor

No description provided.

@dgenr8
Copy link
Contributor

dgenr8 commented Nov 6, 2017

Thanks @jacob-eliosoff! In my rough tests so far, ema-1d performs very strongly.

It usually has a better blocktime median (closer to 415s) than the other algorithms, and lower stddev and max. The mean seems consistently slightly low (around 585s). For some reason, the other algorithms have always done best on this measure.

Of the three versions, ema-1d looks best to me. ema-3h has high-frequency oscillations even in the default scenario (for example /mining.py -s default -a ema-3h -r 660). More concerning, in the corresponding -s fxramp scenario , the amplitude of the difficulty noise is significant. Do you see the same when you chart it?

@jacob-eliosoff
Copy link
Contributor Author

jacob-eliosoff commented Nov 6, 2017 via email

@kyuupichan kyuupichan merged commit b977144 into kyuupichan:master Nov 7, 2017
@jacob-eliosoff
Copy link
Contributor Author

I had a quick look at the numbers for ema-3h under the default and fxramp scenarios, but nothing jumps out at me - what ideally would you want to look different? You can make difficulty bounce around less by choosing a longer EMA window (like 1d or heck, 1w); the tradeoff is it will adapt more slowly - eg, if a bunch of miners leave, blocks could take a long time (à la BTC) to drop back to 10 minutes. This seems like a fundamental, inevitable tradeoff.

Also I'm seeing a 590-610 mean for all my tests regardless of EMA window, so hopefully the low ones you saw were a blip...

@zawy12
Copy link

zawy12 commented Nov 10, 2017

I'm also seeing less than +/- 1% error for all windows when hashrate is constant. If the initial difficulty is off from the correct difficulty, then the mean will be wrong unless you calculate it after D has stabilized.

My "correction" to Degnr8's wt to a true weighted harmonic mean appears just as good.

Yes, smaller windows recover from attacks faster at the expense of being more unstable. An unstable difficulty is not a drawback for constant miners and if the D is not off by more than 30%, then accidental delays (30% longer) should not be a problem. The 3-hr window gives the kind of response verses tradeoff that I think is good.

The only problem with N=144 for these algos is if the price drops 30% in a day: maybe 80% of the miners will leave, causing 72 blocks to average 3.75 times longer to solve. I have argued against N=144 based on alts have to fork when N=300, but I don't know the details of that N=300 code. Logically I see no problem with it except that difficulty will be half a day behind market price.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants