Comments (7)
Ok, I fixed it, finally. Now it replies with "Insufficient funds" as it should.
Code for testing:
# Python
import ccxt
gdax = ccxt.gdax ({
'apiKey': '92560ffae9b8a01d012726c698bcb2f1', # standard
'secret': '9aHjPmW+EtRRKN/OiZGjXh8OxyThnDL4mMDre4Ghvn8wjMniAr5jdEZJLN/knW6FHeQyiz3dPIL5ytnF0Y6Xwg==',
'password': '6kszf4aci8r', # GDAX requires a password!
})
gdax.urls['api'] = 'https://api-public.sandbox.gdax.com'
gdax.load_products ()
gdax.create_limit_buy_order ('BTC/USD', 1, 2000)
The problem was that their sandbox does not accept client_oid
field. Removed it. Should work now. Thanks again!
from ccxt.
Thanks for a detailed report! Can you please paste the following short test in python console and report on what you get:
# Python
import ccxt
gdax = ccxt.gdax ({
'apiKey': '92560ffae9b8a01d012726c698bcb2f1', # standard
'secret': '9aHjPmW+EtRRKN/OiZGjXh8OxyThnDL4mMDre4Ghvn8wjMniAr5jdEZJLN/knW6FHeQyiz3dPIL5ytnF0Y6Xwg==',
'password': '6kszf4aci8r', # GDAX requires a password!
})
gdax.urls['api'] = 'https://api-public.sandbox.gdax.com'
gdax.fetch_balance ()
Note, that GDAX requires the password for authentication. Read the API Keys Setup section in the Manual for more details.
Waiting for your reply.
from ccxt.
Fixing this...
from ccxt.
I have tried your code and the methods still don't work unofrtunately.
My code is similar I have also been testing it on sandbox with a password.
from ccxt.
It seems like I fixed it, and the order signatures are now generated correctly, but their sandbox matching engine responds with 'offline' message. Should work normally though when it's back online or on production.
from ccxt.
Here is how I test:
mbp:ccxt igorkroitor$ python
Python 2.7.13 (default, Jun 5 2017, 10:04:07)
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ccxt
>>> gdax = ccxt.gdax ({
... 'apiKey': '92560ffae9b8a01d012726c698bcb2f1', # standard
... 'secret': '9aHjPmW+EtRRKN/OiZGjXh8OxyThnDL4mMDre4Ghvn8wjMniAr5jdEZJLN/knW6FHeQyiz3dPIL5ytnF0Y6Xwg==',
... 'password': '6kszf4aci8r', # GDAX requires a password!
... })
>>> gdax.urls['api'] = 'https://api-public.sandbox.gdax.com'
>>> gdax.create_limit_buy_order ('BTC/USD', 1, 2000)
('gdax', 'POST', 'https://api-public.sandbox.gdax.com/orders', 400, 'Bad Request', 'Market Not Available')
('gdax', 'POST', 'https://api-public.sandbox.gdax.com/orders', 400, 'Bad Request', '{"message":"Matching engine offline"}')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "ccxt/__init__.py", line 504, in create_limit_buy_order
return self.create_order (product, 'limit', 'buy', amount, price, params)
File "ccxt/__init__.py", line 6422, in create_order
return self.privatePostOrders (self.extend (order, params))
File "ccxt/__init__.py", line 6448, in request
return self.fetch (url, method, headers, body)
File "ccxt/__init__.py", line 238, in fetch
raise MarketNotAvailaibleError (self.id + ' ' + error)
ccxt.MarketNotAvailaibleError: gdax Market Not Available
mbp:ccxt igorkroitor$ python3
Python 3.6.1 (default, Jul 10 2017, 04:32:51)
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ccxt
gdax = ccxt.gdax ({
'apiKey': '92560ffae9b8a01d012726c698bcb2f1', # standard
'secret': '9aHjPmW+EtRRKN/OiZGjXh8OxyThnDL4mMDre4Ghvn8wjMniAr5jdEZJLN/knW6FHeQyiz3dPIL5ytnF0Y6Xwg==',
'password': '6kszf4aci8r', # GDAX requires a password!
})
gdax.urls['api'] = 'https://api-public.sandbox.gdax.com'
gdax.create_limit_buy_order ('BTC/USD', 1, 2000)
>>> gdax = ccxt.gdax ({
... 'apiKey': '92560ffae9b8a01d012726c698bcb2f1', # standard
... 'secret': '9aHjPmW+EtRRKN/OiZGjXh8OxyThnDL4mMDre4Ghvn8wjMniAr5jdEZJLN/knW6FHeQyiz3dPIL5ytnF0Y6Xwg==',
... 'password': '6kszf4aci8r', # GDAX requires a password!
... })
>>> gdax.urls['api'] = 'https://api-public.sandbox.gdax.com'
>>> gdax.create_limit_buy_order ('BTC/USD', 1, 2000)
gdax POST https://api-public.sandbox.gdax.com/orders 400 Bad Request b'{"message":"Matching engine offline"}'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/igorkroitor/ccxt/ccxt/__init__.py", line 504, in create_limit_buy_order
return self.create_order (product, 'limit', 'buy', amount, price, params)
File "/Users/igorkroitor/ccxt/ccxt/__init__.py", line 6422, in create_order
return self.privatePostOrders (self.extend (order, params))
File "/Users/igorkroitor/ccxt/ccxt/__init__.py", line 6448, in request
return self.fetch (url, method, headers, body)
File "/Users/igorkroitor/ccxt/ccxt/__init__.py", line 207, in fetch
response = opener.open (request, timeout = int (self.timeout / 1000))
File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 532, in open
response = meth(req, response)
File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 642, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 570, in error
return self._call_chain(*args)
File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 650, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request
So now it's the problem with their sandbox matching engine. Will wait for it back online and test later again.
from ccxt.
So now it says "Insufficient funds" as it should... Will add an exception for this case, though.
mbp:ccxt igorkroitor$ python3
Python 3.6.1 (default, Jul 10 2017, 04:32:51)
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ccxt
>>> gdax = ccxt.gdax ({
... 'apiKey': '92560ffae9b8a01d012726c698bcb2f1', # standard
... 'secret': '9aHjPmW+EtRRKN/OiZGjXh8OxyThnDL4mMDre4Ghvn8wjMniAr5jdEZJLN/knW6FHeQyiz3dPIL5ytnF0Y6Xwg==',
... 'password': '6kszf4aci8r', # GDAX requires a password!
... })
>>> gdax.urls['api'] = 'https://api-public.sandbox.gdax.com'
>>> gdax.load_products ()
{'BTC/USD': {'id': 'BTC-USD', 'symbol': 'BTC/USD', 'base': 'BTC', 'quote': 'USD', 'info': {'id': 'BTC-USD', 'base_currency': 'BTC', 'quote_currency': 'USD', 'base_min_size': '0.01', 'base_max_size': '10000', 'quote_increment': '0.01', 'display_name': 'BTC/USD'}}, 'BTC/GBP': {'id': 'BTC-GBP', 'symbol': 'BTC/GBP', 'base': 'BTC', 'quote': 'GBP', 'info': {'id': 'BTC-GBP', 'base_currency': 'BTC', 'quote_currency': 'GBP', 'base_min_size': '0.01', 'base_max_size': '10000', 'quote_increment': '0.01', 'display_name': 'BTC/GBP'}}, 'BTC/EUR': {'id': 'BTC-EUR', 'symbol': 'BTC/EUR', 'base': 'BTC', 'quote': 'EUR', 'info': {'id': 'BTC-EUR', 'base_currency': 'BTC', 'quote_currency': 'EUR', 'base_min_size': '0.01', 'base_max_size': '10000', 'quote_increment': '0.01', 'display_name': 'BTC/EUR'}}, 'ETH/BTC': {'id': 'ETH-BTC', 'symbol': 'ETH/BTC', 'base': 'ETH', 'quote': 'BTC', 'info': {'id': 'ETH-BTC', 'base_currency': 'ETH', 'quote_currency': 'BTC', 'base_min_size': '0.01', 'base_max_size': '1000000', 'quote_increment': '0.00001', 'display_name': 'ETH/BTC'}}, 'ETH/USD': {'id': 'ETH-USD', 'symbol': 'ETH/USD', 'base': 'ETH', 'quote': 'USD', 'info': {'id': 'ETH-USD', 'base_currency': 'ETH', 'quote_currency': 'USD', 'base_min_size': '0.01', 'base_max_size': '1000000', 'quote_increment': '0.01', 'display_name': 'ETH/USD'}}, 'LTC/BTC': {'id': 'LTC-BTC', 'symbol': 'LTC/BTC', 'base': 'LTC', 'quote': 'BTC', 'info': {'id': 'LTC-BTC', 'base_currency': 'LTC', 'quote_currency': 'BTC', 'base_min_size': '0.01', 'base_max_size': '1000000', 'quote_increment': '0.00001', 'display_name': 'LTC/BTC'}}, 'LTC/USD': {'id': 'LTC-USD', 'symbol': 'LTC/USD', 'base': 'LTC', 'quote': 'USD', 'info': {'id': 'LTC-USD', 'base_currency': 'LTC', 'quote_currency': 'USD', 'base_min_size': '0.01', 'base_max_size': '1000000', 'quote_increment': '0.01', 'display_name': 'LTC/USD'}}, 'ETH/EUR': {'id': 'ETH-EUR', 'symbol': 'ETH/EUR', 'base': 'ETH', 'quote': 'EUR', 'info': {'id': 'ETH-EUR', 'base_currency': 'ETH', 'quote_currency': 'EUR', 'base_min_size': '0.01', 'base_max_size': '1000000', 'quote_increment': '0.01', 'display_name': 'ETH/EUR'}}}
>>> gdax.create_limit_buy_order ('BTC/USD', 1, 2000)
gdax POST https://api-public.sandbox.gdax.com/orders 400 Bad Request b'{"message":"Insufficient funds"}'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/igorkroitor/ccxt/ccxt/__init__.py", line 504, in create_limit_buy_order
return self.create_order (product, 'limit', 'buy', amount, price, params)
File "/Users/igorkroitor/ccxt/ccxt/__init__.py", line 6422, in create_order
return self.privatePostOrders (self.extend (order, params))
File "/Users/igorkroitor/ccxt/ccxt/__init__.py", line 6448, in request
return self.fetch (url, method, headers, body)
File "/Users/igorkroitor/ccxt/ccxt/__init__.py", line 207, in fetch
response = opener.open (request, timeout = int (self.timeout / 1000))
File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 532, in open
response = meth(req, response)
File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 642, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 570, in error
return self._call_chain(*args)
File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 650, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request
from ccxt.
Related Issues (20)
- Bybit exchange: Positions data always returns marginMode: "cross" HOT 1
- One Trading - API Domain Change HOT 3
- Poblem with method fetch_currencies HOT 5
- Binance Futures fetch_my_trades() only returning < 7 days of trades HOT 1
- Kucoin spot watchOrderBook - can't listen to top50 bbo HOT 1
- Bitfinex2 rateLimitExceeded HOT 5
- Bitget error when use fetch_deposit_address HOT 8
- Binance watch_positions and positions object HOT 2
- CCXT filters out some Binance non-pm positions HOT 21
- Bybit exchange: Positions data always returns marginMode: "cross" on version 4.2.36 HOT 3
- Support `closePosition()` on Phemex HOT 3
- NotSupported: bybit closePosition() is not supported yet HOT 1
- OKX, fetch_open_orders() not fetching trigger orders HOT 5
- Blofin: support CCXT Pro websocket functions HOT 1
- OKX, error change an order with associated TP and SL HOT 3
- Bitget symbol not working for private methods HOT 8
- Bitget create_order reduceOnly not working HOT 9
- bybit ccxt.base.errors.OrderNotFound: HOT 4
- New Bitget newSize field for websocket orders HOT 5
- Bitget fetchOHLCV 1d issue after updated from 4.2.31 to 4.2.40 HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ccxt.