Zenbot: Can't trade gdax.BCH-EUR and gdax.LTC-EUR "price is too accurate. Smallest unit is 0.01000000""

Created on 20 Aug 2019  路  5Comments  路  Source: DeviaVir/zenbot

System information

  • **zenbot vanilla
  • **OS: Windows 10:
  • **Zenbot version: 4.1.0
  • **Zenbot branch: Latest Docker
  • **NodeJS version: Latest Docker
  • command: docker-compose exec server zenbot trade gdax.BCH-EUR --period_length=1m --min_periods=52 --order_type=maker --sell_stop_pct=99 --buy_stop_pct=99 --trend_ema=14 --oversold_rsi_periods=35 --oversold_rsi=28 --neutral_rate=0.1 --buy_pct=33 --sell_pct=100 --max_slippage_pct=5 --profit_stop_enable_pct=6 --profit_stop_pct=0.1 --quarentine=0 --days=1 --markdown_buy_pct=-0.01 --markup_sell_pct=-0.01 --strategy=trend_ema --currency_capital=64.02 --asset_capital=0.18758 --days=60 --avg_slippage_pct=0.1 --silent
  • Did I make any changes to conf-sample.js? Only the api for GDAX and discord setup

Describe the problem

Any time I try to live trade with gdax.BCH-EUR pair (also tried LTC-EUR with the same results), I am getting "price is too accurate. Smallest unit is 0.01000000". In the payload request logged on the error the price is like: price: '290.27902500'. Also, tried to mess with asset_increment and increment on product.json, with no impacts on the tests.

I've found a few previous similar issues but related with size, not price.

Source code / Error logs

(...)
request:
Request {
domain: null,
_events: [Object],
_eventsCount: 5,
_maxListeners: undefined,
body: '{"price":"290.27902500","size":"0.07278243","fee":null,"orig_size":"0.07278243","remaining_size":"0.07278243","orig_price":"290.27902500","cancel_after":"day","product_id":"BCH-EUR","post_only":true,"time_in_force":"GTT","side":"buy"}',
headers: [Object],
method: 'POST',
uri: [Object],
qsStringifyOptions: [Object],
timeout: 10000,
callback: [Function],
readable: true,
writable: true,
explicitMethod: true,
_qs: [Object],
_auth: [Object],
_oauth: [Object],
_multipart: [Object],
_redirect: [Object],
_tunnel: [Object],
setHeader: [Function],
hasHeader: [Function],
getHeader: [Function],
removeHeader: [Function],
localAddress: undefined,
pool: {},
dests: [],
__isRequestRequest: true,
_callback: [Function],
proxy: null,
tunnel: true,
setHost: true,
originalCookieHeader: undefined,
_disableCookies: true,
_jar: undefined,
port: 443,
host: 'api.pro.coinbase.com',
path: '/orders',
httpModule: [Object],
agentClass: [Object],
agent: [Object],
_started: true,
href: 'https://api.pro.coinbase.com/orders',
req: [Object],
ntick: true,
timeoutTimer: null,
response: [Circular],
originalHost: 'api.pro.coinbase.com',
originalHostHeaderName: 'host',
responseContent: [Circular],
_destdata: true,
_ended: true,
_callbackCalled: true },
toJSON: [Function: responseToJSON],
caseless: Caseless { dict: [Object] },
read: [Function],
body: '{"message":"price is too accurate. Smallest unit is 0.01000000"}' },
data:
{ message: 'price is too accurate. Smallest unit is 0.01000000' } }
[ { price: '290.27902500',
size: '0.07278243',
fee: null,
orig_size: '0.07278243',
remaining_size: '0.07278243',
orig_price: '290.27902500',
cancel_after: 'day',
product_id: 'BCH-EUR',
post_only: true,
time_in_force: 'GTT',
side: 'buy' } ]

Can you guys help?

bug

All 5 comments

I did not have the issue running on the 'master' branch. The exchange module changed from 'gdax' to 'coinbase-pro', but the codebase seems to be unchanged. The 'engine.js' code is different, for validating order sizes (starts at line 445), and may be contributing to the problem (but likely isn't the only cause, since it doesn't happen on Binance or Bittrex). Like the OP, I double checked 'products.json' and verified it has the correct values, and I also verified that they are getting loaded into 's.product'.
I will keep digging, but a veteran programmer and/or someone familiar with the program, will probably fix it much faster.

This is anecdotal but I was just having a gdax.ETH-DAI error, on a hunch I removed the trailing zeros from "asset_increment" in the products.json. Now mine reads, "asset_increment": "0.0001", and is able to place and cancel orders.

That seems to be the solution. Still have one not working, but I had it at '1.0', so I am retrying at '1'.

Thank you.

I've been looking through the changelog of the project, and I've seen that some months ago, gdax's products.json didn't include trailing zeros in any of its variables.
Last products.json without trailing zeros is from June 27 commit bfeedfa35edc1feb3abdf1c410034c58f85e5e9c
Next products.json update was in July 23, commit 1334c48d9d8ead991f7e82ed3816e579b7ec9e26

However, I rolled back to June 27, and running update_products.sh generates the products.json with trailing zeros, so I think that something changed in coinbase's api products response.

If trailing zeros is truly a problem, it may be fixed in update_products.sh

@DeviaVir I think this was fixed and can be closed

Was this page helpful?
0 / 5 - 0 ratings

Related issues

njannink picture njannink  路  4Comments

sam-perez picture sam-perez  路  5Comments

nedievas picture nedievas  路  4Comments

linuxu678 picture linuxu678  路  4Comments

tabbek picture tabbek  路  3Comments