Fixed a bug with the "enforced" state (
old cex.io-only reinvest mode) where the code had some poorly defined behavior which could cause a stuck state with no possible exit condition. Also, spent the last 30-45 minutes auditing code in proximity to the now-fixed bug, and updated the release notes with the specific details in:
https://github.com/kuzetsa/gekko/releases/tag/critical.bugfix, which is now the latest release as of:
2014 June 25th 22:00 (
local NY time)
... And
https://github.com/kuzetsa/gekko/releases/latest now points to the "
critical.bugfix" release.
Thanks for the update.
How come it says cex.io trading fee will be: 0.75%? cex.io fee is 0.2% usually.
It's a safety margin
I was able to get more consistent behavior with a fee setting of 0.75% (
without having to go to a higher fee for an even larger safety margin) only after I changed gekko's default minimum GHS trade to a higher value than the minimum allowed by cex.io policies: Orders are considered valid as small as 6 decimal places (0.000001 GHS)
At the 0.000001 GHS micro-trading level, the actual fee (
due to *granularity) will sometimes be absurdly high... It's really not a bug with the exchange's fee system, or anything "wrong" with their policy to let people do micro-trades where the rounding error / granularity issue is quite bad.
Example data:2014-06-26 @ 06:14:43, Fee: 0.00000004, Bought 0.00199889 GHS at 0.0075191 BTC
2014-06-26 @ 06:14:43, -0.00001508 BTC (actual fee, 0.26525%)
2014-06-26 @ 00:50:43, Fee: 0.00000003, Bought 0.00198139 GHS at 0.00753505 BTC
2014-06-26 @ 00:50:43, -0.00001496 BTC (actual fee, 0.20053%)
2014-06-26 @ 00:24:47, Fee: 0.00000003, Bought 0.00195676 GHS at 0.00752258 BTC
2014-06-26 @ 00:24:47, -0.00001475 BTC (actual fee, 0.2028%)
2014-06-25 @ 23:51:34, Fee: 0.00000003, Bought 0.00191964 GHS at 0.00753259 BTC
2014-06-25 @ 23:51:34, -0.00001449 BTC (actual fee, 0.207039%)
2014-06-25 @ 23:23:20, Fee: 0.00000003, Bought 0.00172432 GHS at 0.00749274 BTC
2014-06-25 @ 23:23:20, -0.00001295 BTC (actual fee, 0.23166%)
--- yesterday's (
unrelated) critical bugfix ---
*** the price on this trade, and others was "not good"
2014-06-25 @ 20:39:11, Fee: 0.00000003, Bought 0.00174368 GHS at 0.00752997 BTC
2014-06-25 @ 20:39:11, -0.00001316 BTC (actual fee, 0.22796%)
...etc. etc. etc.
--- historical data on smaller trades ---
2014-06-23 @ 05:55:23, Fee: 0.00000001, Bought 0.00033359 GHS at 0.00746761 BTC
2014-06-23 @ 05:55:23, -0.00000252 BTC (actual fee, 0.396825%)
2014-06-23 @ 08:54:15, Fee: 0.00000001, Bought 0.00029047 GHS at 0.00744862 BTC
2014-06-23 @ 08:54:15, -0.00000219 BTC (actual fee, 0.456621%)
2014-06-23 @ 10:40:36, Fee: 0.00000001, Bought 0.00017371 GHS at 0.00748319 BTC
2014-06-23 @ 10:40:36, -0.00000131 BTC (actual fee, 0.7633%)
2014-06-23 @ 13:29:47, Fee: 0.00000001, Bought 0.00010602 GHS at 0.00745005 BTC
2014-06-23 @ 13:29:47, -0.00000080 BTC (actual fee, 1.25%)
2014-06-23 @ 17:27:56, Fee: 0.00000001, Bought 0.00026981 GHS at 0.00748623 BTC
2014-06-23 @ 17:27:56, -0.00000203 BTC (actual fee, 0.49261%)
2014-06-23 @ 21:19:55, Fee: 0.00000001, Bought 0.00012709 GHS at 0.00747413 BTC
2014-06-23 @ 21:19:55, -0.00000096 BTC (actual fee, 1.04167%)
2014-06-23 @ 21:40:49, Fee: 0.00000001, Bought 0.00030082 GHS at 0.007479 BTC
2014-06-23 @ 21:40:49, -0.00000226 BTC (actual fee, 0.442478%)
2014-06-23 @ 22:27:46, Fee: 0.00000001, Bought 0.00010293 GHS at 0.00748 BTC
2014-06-23 @ 22:27:46, -0.00000078 BTC (actual fee, 1.282051%)
2014-06-23 @ 23:11:45, Fee: 0.00000001, Bought 0.00024405 GHS at 0.007498 BTC
2014-06-23 @ 23:11:45, -0.00000184 BTC (actual fee, 0.543478%)
2014-06-24 @ 01:53:20, Fee: 0.00000001, Bought 0.00028878 GHS at 0.007514 BTC
2014-06-24 @ 01:53:20, -0.00000218 BTC (actual fee, 0.4587%)
2014-06-24 @ 02:32:54, Fee: 0.00000001, Bought 0.00029409 GHS at 0.00751441 BTC
2014-06-24 @ 02:32:54, -0.00000222 BTC (actual fee, 0.450450450450%)
^ note that none of those trades are even anywhere close to the minimum 0.000001 GHS order allowed by cex.io
* Granularity, and the resulting "rounding errors" are sometimes frustrating, but since the fees are paid in whole satoshi amounts there's not much I can do. I set it at 0.75% because I didn't want there to be (
as many) errors related to "insufficient funds" during small trades (
and later, made some tweaks to gekko's fee calculation and rounding code because it's common for granularity / rounding errors to be done in the favor of the exchange or merchant)
Granularity is the sort of thing some users might not think about or care about, and someone will probably go in and set their minimum trade to the actual, exchange-enforced minimum 0.000001 GHS value, because the user(s) might feel a compelling urge to reinvest so aggressively that the safety margins still might not be enough.
(
I was personally trying to use gekko to reinvest using micro-trades much closer to the exchange-enforced minimum 0.000001 GHS, and the granularity was causing my fees to sometimes be much much higher, sometimes 5%, 10%)
TL;DR* Granularity causes rounding errors on the fees when you're reinvesting tiny amounts with micro trades...
Specifically: The "1 satoshi" granularity causes issues. (
The exchange rounds up to the next whole satoshi, and it's a common practice never waive the fee under any circumstances.)