You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.
Take EOS/BTC. EOS is an integer coin. increment is thus specified as "1.00000000" as pulled from stepSize from the Binance output.
However, we have engine calculations like: n(quote.bid).subtract(n(quote.bid).multiply(s.options.markdown_buy_pct / 100)).format(s.product.increment, Math.floor)
Now this is taking the EOS stepSize, and passing it to a format of BTC. Luckily, for numbro, a format of "1.00000000" is functionally equivalent to "0.00001000". It only cares about how many digits are represented. This means that the current implementation of increment` is entirely meaningless.
Later on, when you have size calculations, you see things like this: size = n(s.balance.currency).multiply(buy_pct).divide(100).subtract(size).divide(price).format('0.00000000')
This gives you values like 9.14567431 when it should be 9 since EOS is an integer coin. Luckily Binance corrects this and spits back 9 after you place an order, but it still screws up calculations within Zenbot and leads to other errors, like trying to buy more than you can afford if what Zenbot wants to buy is very close but not quite an integer.
It's simple to convert stepSize to how numbro needs it to be like this:
for (i = stepSize.length - 1; i > 0; i--) {
if (stepSize[i] === '0') stepSize = stepSize.slice(0, i)
}
However, this breaks lots more things because like I mentioned increment is passed as the format to BTC, instead of EOS, so the wrong thing gets formatted. I could just reverse this, but I don't understand the original intent so I'd risk breaking more than I fix.
Anyone have any insights on this?
The text was updated successfully, but these errors were encountered:
Take EOS/BTC. EOS is an integer coin.
increment
is thus specified as"1.00000000"
as pulled fromstepSize
from the Binance output.However, we have engine calculations like:
n(quote.bid).subtract(n(quote.bid).multiply(s.options.markdown_buy_pct / 100)).format(s.product.increment, Math.floor)
Now this is taking the EOS stepSize, and passing it to a format of BTC. Luckily, for
numbro
, a format of"1.00000000"
is functionally equivalent to"0.00001000". It only cares about how many digits are represented. This means that the current implementation of
increment` is entirely meaningless.Later on, when you have size calculations, you see things like this:
size = n(s.balance.currency).multiply(buy_pct).divide(100).subtract(size).divide(price).format('0.00000000')
This gives you values like
9.14567431
when it should be9
since EOS is an integer coin. Luckily Binance corrects this and spits back9
after you place an order, but it still screws up calculations within Zenbot and leads to other errors, like trying to buy more than you can afford if what Zenbot wants to buy is very close but not quite an integer.It's simple to convert
stepSize
to hownumbro
needs it to be like this:However, this breaks lots more things because like I mentioned
increment
is passed as the format to BTC, instead of EOS, so the wrong thing gets formatted. I could just reverse this, but I don't understand the original intent so I'd risk breaking more than I fix.Anyone have any insights on this?
The text was updated successfully, but these errors were encountered: