Skip to content

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

Closed
@tiems90

Description

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:

df = resp.copy()[[ 'created_at', 'product_id', 'side', 'type', 'size', 'price', 'status' ]]

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" : "..."
     }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions