diff --git a/catalyst/exchange/asset_finder_exchange.py b/catalyst/exchange/asset_finder_exchange.py index 0e01bd1a..dc3d00b1 100644 --- a/catalyst/exchange/asset_finder_exchange.py +++ b/catalyst/exchange/asset_finder_exchange.py @@ -10,6 +10,11 @@ class AssetFinderExchange(object): @property def sids(self): + """ + This seems to be used to pre-fetch assets. + I don't think that we need this for live-trading. + Leaving the list empty. + """ return list() def retrieve_all(self, sids, default_none=False): diff --git a/catalyst/exchange/bitfinex.py b/catalyst/exchange/bitfinex.py index c01413c3..13f35dba 100644 --- a/catalyst/exchange/bitfinex.py +++ b/catalyst/exchange/bitfinex.py @@ -166,14 +166,14 @@ class Bitfinex(Exchange): :return: """ response = self._request('balances', None) - positions = response.json() - if 'message' in positions: + balances = response.json() + if 'message' in balances: raise ValueError( - 'unable to fetch balance %s' % positions['message'] + 'unable to fetch balance %s' % balances['message'] ) base_position = None - for position in positions: + for position in balances: if not base_position and position['type'] == 'exchange' \ and position['currency'] == self.base_currency: base_position = position @@ -227,6 +227,12 @@ class Bitfinex(Exchange): @property def positions(self): + response = self._request('positions', None) + positions = response.json() + if 'message' in positions: + raise ValueError( + 'unable to fetch positions %s' % positions['message'] + ) raise NotImplementedError('positions not implemented') @property