pycryptobot: Launch with error 'KeyError: "['specified_funds'] not in index"'

Describe the bug Errors at launch. It only affects one of my 3 portfolios on startup, as the format doesn’t confirm to the specc here: https://github.com/whittlem/pycryptobot/blob/d530ab7d59364acfd4322f47bfc5ee9af35fe289/models/CoinbasePro.py#L192

To Reproduce Steps to reproduce the behavior:

  1. launch using python3 pycryptobot.py
  2. See error

Error Log

Traceback (most recent call last):
  File "pycryptobot.py", line 66, in <module>
    orders = account.getOrders(app.getMarket(), '', 'done')
  File "/home/pi/pycryptobot/BTC/models/TradingAccount.py", line 110, in getOrders
    self.orders = model.getOrders(market, action, status)
  File "/home/pi/pycryptobot/BTC/models/CoinbasePro.py", line 195, in getOrders
    df = resp.copy()[[ 'created_at', 'product_id', 'side', 'type', 'filled_size', 'specified_funds', 'executed_value', 'fill_fees', 'status' ]]
  File "/home/pi/.local/lib/python3.7/site-packages/pandas/core/frame.py", line 3030, in __getitem__
    indexer = self.loc._get_listlike_indexer(key, axis=1, raise_missing=True)[1]
  File "/home/pi/.local/lib/python3.7/site-packages/pandas/core/indexing.py", line 1265, in _get_listlike_indexer
    self._validate_read_indexer(keyarr, indexer, axis, raise_missing=raise_missing)
  File "/home/pi/.local/lib/python3.7/site-packages/pandas/core/indexing.py", line 1315, in _validate_read_indexer
    raise KeyError(f"{not_found} not in index")
KeyError: "['specified_funds'] not in index"

I’ve gone in to actually check the columns of resp, and it only contains the following:

['id', 'price', 'size', 'product_id', 'profile_id', 'side', 'type', 'time_in_force', 'post_only', 'created_at', 'done_at', 'done_reason', 'fill_fees', 'filled_size', 'executed_value', 'status', 'settled']

Desktop (please complete the following information):

  • OS: Linux; Debian
  • Version: latest git pull as of 2.0.6

Additional context Config file, aside from base_currency identical to working ones. :

{
     "coinbasepro" : {
         "api_url" : "https://api.pro.coinbase.com",
         "api_key" : "...",
         "api_secret" : "...",
         "api_passphrase" : "...",
         "config" : {
             "base_currency" : "BTC",
             "quote_currency" : "USD",
             "live" : 1,
             "sellatloss" : 0,
             "granularity": 60
         }
     },
     "telegram" : {
         "token" : "...",
         "client_id" : "..."
     }
}

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (5 by maintainers)

Commits related to this issue

Most upvoted comments

This should be fixed now. Can you confirm?

I will look later and fix it. Thanks.

Same issue here, apparently the property “specified_funds” is returned only for a single order (GET /orders/<id>) but not for a list of orders (GET /orders). Seen in Coinbase Api Docs