Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

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

Closed
bgsilva13 opened this issue Aug 20, 2019 · 5 comments
Labels

Comments

@bgsilva13
Copy link

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?

@DeviaVir DeviaVir added the bug label Aug 20, 2019
@grber1234
Copy link

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.

@trees-smoke
Copy link

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.

@grber1234
Copy link

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.

@mmdiego
Copy link
Contributor

mmdiego commented Sep 21, 2019

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 bfeedfa
Next products.json update was in July 23, commit 1334c48

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 pushed a commit that referenced this issue Oct 3, 2019
Also sorts the products' list alphabetically.
olexiyb pushed a commit to olexiyb/zenbot that referenced this issue Feb 2, 2020
YarnSeemannsgarn pushed a commit to YarnSeemannsgarn/zenbot that referenced this issue Apr 15, 2020
@mmdiego
Copy link
Contributor

mmdiego commented Nov 28, 2020

@DeviaVir I think this was fixed and can be closed

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

No branches or pull requests

5 participants