zapata / bitshares-pricefeed Goto Github PK
View Code? Open in Web Editor NEWThis project forked from xeroc/bitshares-pricefeed
Price Feed Script for BitShares
License: MIT License
This project forked from xeroc/bitshares-pricefeed
Price Feed Script for BitShares
License: MIT License
____________________________________________________ test_robinhood_equities_fetch ____________________________________________________
checkers = <class 'conftest.Checkers'>
def test_robinhood_equities_fetch(checkers):
source = RobinHood(equities=['F:USD', 'BABA:USD'], aliases={'F':'FORDCOM', 'BABA':'ALIBABACOM'})
feed = source.fetch()
> checkers.check_feed(feed, ['FORDCOM:USD', 'ALIBABACOM:USD'], noVolume=True)
tests/sources/test_robinhood.py:6:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
feed = {}, pairs = ['FORDCOM:USD', 'ALIBABACOM:USD'], kargs = {'noVolume': True}, pair = 'FORDCOM:USD', quote = 'FORDCOM', base = 'USD'
@py_assert1 = False, @py_format3 = "'USD' in {}", @py_format5 = "assert 'USD' in {}"
@staticmethod
def check_feed(feed, pairs, **kargs):
print(feed)
for pair in pairs:
(quote, base) = pair.split(':')
> assert base in feed
E AssertionError: assert 'USD' in {}
tests/sources/conftest.py:9: AssertionError
-------------------------------------------------------- Captured stdout call ---------------------------------------------------------
RobinHood encountered an error while loading live data.
{}
-------------------------------------------------------- Captured stderr call ---------------------------------------------------------
Traceback (most recent call last):
File "/home/zapata/Projects/bitshares/bitshares-pricefeed/wrappers_env/lib/python3.6/site-packages/bitshares_pricefeed-0.0.10-py3.6.egg/bitshares_pricefeed/sources/main.py", line 65, in fetch
feed = self._fetch() # pylint: disable=no-member
File "/home/zapata/Projects/bitshares/bitshares-pricefeed/wrappers_env/lib/python3.6/site-packages/bitshares_pricefeed-0.0.10-py3.6.egg/bitshares_pricefeed/sources/robinhood.py", line 23, in _fetch
result = response.json()['results']
File "/home/zapata/Projects/bitshares/bitshares-pricefeed/wrappers_env/lib/python3.6/site-packages/requests/models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
__________________________________________________________ test_okcoin_fetch __________________________________________________________
checkers = <class 'conftest.Checkers'>
def test_okcoin_fetch(checkers):
source = Okcoin(quotes=['BTC'], bases=['USD', 'CNY'])
feed = source.fetch()
> checkers.check_feed(feed, ['BTC:USD', 'BTC:CNY'])
tests/sources/test_okcoin.py:6:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
feed = {}, pairs = ['BTC:USD', 'BTC:CNY'], kargs = {}, pair = 'BTC:USD', quote = 'BTC', base = 'USD', @py_assert1 = False
@py_format3 = "'USD' in {}", @py_format5 = "assert 'USD' in {}"
@staticmethod
def check_feed(feed, pairs, **kargs):
print(feed)
for pair in pairs:
(quote, base) = pair.split(':')
> assert base in feed
E AssertionError: assert 'USD' in {}
tests/sources/conftest.py:9: AssertionError
-------------------------------------------------------- Captured stdout call ---------------------------------------------------------
Okcoin encountered an error while loading live data.
{}
-------------------------------------------------------- Captured stderr call ---------------------------------------------------------
Traceback (most recent call last):
File "/home/zapata/Projects/bitshares/bitshares-pricefeed/wrappers_env/lib/python3.6/site-packages/bitshares_pricefeed-0.0.10-py3.6.egg/bitshares_pricefeed/sources/main.py", line 65, in fetch
feed = self._fetch() # pylint: disable=no-member
File "/home/zapata/Projects/bitshares/bitshares-pricefeed/wrappers_env/lib/python3.6/site-packages/bitshares_pricefeed-0.0.10-py3.6.egg/bitshares_pricefeed/sources/okcoin.py", line 20, in _fetch
result = response.json()
File "/home/zapata/Projects/bitshares/bitshares-pricefeed/wrappers_env/lib/python3.6/site-packages/requests/models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
_________________________________________________________ test_coincap_fetch __________________________________________________________
checkers = <class 'conftest.Checkers'>
def test_coincap_fetch(checkers):
source = Coincap(quotes=['ALTCAP', 'ALTCAP.X'], bases=['BTC'])
feed = source.fetch()
> checkers.check_feed(feed, ['ALTCAP:BTC', 'ALTCAP.X:BTC'], noVolume=True)
tests/sources/test_coincap.py:6:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
feed = {}, pairs = ['ALTCAP:BTC', 'ALTCAP.X:BTC'], kargs = {'noVolume': True}, pair = 'ALTCAP:BTC', quote = 'ALTCAP', base = 'BTC'
@py_assert1 = False, @py_format3 = "'BTC' in {}", @py_format5 = "assert 'BTC' in {}"
@staticmethod
def check_feed(feed, pairs, **kargs):
print(feed)
for pair in pairs:
(quote, base) = pair.split(':')
> assert base in feed
E AssertionError: assert 'BTC' in {}
tests/sources/conftest.py:9: AssertionError
-------------------------------------------------------- Captured stdout call ---------------------------------------------------------
Coincap encountered an error while loading live data.
{}
-------------------------------------------------------- Captured stderr call ---------------------------------------------------------
Traceback (most recent call last):
File "/home/zapata/Projects/bitshares/bitshares-pricefeed/wrappers_env/lib/python3.6/site-packages/bitshares_pricefeed-0.0.10-py3.6.egg/bitshares_pricefeed/sources/main.py", line 65, in fetch
feed = self._fetch() # pylint: disable=no-member
File "/home/zapata/Projects/bitshares/bitshares-pricefeed/wrappers_env/lib/python3.6/site-packages/bitshares_pricefeed-0.0.10-py3.6.egg/bitshares_pricefeed/sources/coincap.py", line 14, in _fetch
coincap_front = requests.get('http://www.coincap.io/front').json()
File "/home/zapata/Projects/bitshares/bitshares-pricefeed/wrappers_env/lib/python3.6/site-packages/requests/models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
_______________________________________________________ test_iex_equities_fetch _______________________________________________________
checkers = <class 'conftest.Checkers'>
def test_iex_equities_fetch(checkers):
source = Iex(equities=['F:USD', 'BABA:USD'], aliases={'F':'FORDCOM', 'BABA':'ALIBABACOM'})
feed = source.fetch()
> checkers.check_feed(feed, ['FORDCOM:USD', 'ALIBABACOM:USD'])
tests/sources/test_iex.py:6:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
feed = {}, pairs = ['FORDCOM:USD', 'ALIBABACOM:USD'], kargs = {}, pair = 'FORDCOM:USD', quote = 'FORDCOM', base = 'USD'
@py_assert1 = False, @py_format3 = "'USD' in {}", @py_format5 = "assert 'USD' in {}"
@staticmethod
def check_feed(feed, pairs, **kargs):
print(feed)
for pair in pairs:
(quote, base) = pair.split(':')
> assert base in feed
E AssertionError: assert 'USD' in {}
tests/sources/conftest.py:9: AssertionError
-------------------------------------------------------- Captured stdout call ---------------------------------------------------------
Iex encountered an error while loading live data.
{}
-------------------------------------------------------- Captured stderr call ---------------------------------------------------------
Traceback (most recent call last):
File "/home/zapata/Projects/bitshares/bitshares-pricefeed/wrappers_env/lib/python3.6/site-packages/bitshares_pricefeed-0.0.10-py3.6.egg/bitshares_pricefeed/sources/main.py", line 65, in fetch
feed = self._fetch() # pylint: disable=no-member
File "/home/zapata/Projects/bitshares/bitshares-pricefeed/wrappers_env/lib/python3.6/site-packages/bitshares_pricefeed-0.0.10-py3.6.egg/bitshares_pricefeed/sources/iex.py", line 23, in _fetch
result = response.json()
File "/home/zapata/Projects/bitshares/bitshares-pricefeed/wrappers_env/lib/python3.6/site-packages/requests/models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Hey,
Can you please alter the price feeds for the Norns (Skuld, Verthandi & Urthr) to use the following new values?
CER: 0.95 (Up from 0.8)
MCR: 105 (Down from 200)
MSSR: 101 (Down from 110)
The intent behind this change is to encourage more participation. I believe these values will work due to the constrained volatility within the Norns ABA feed.
The black swan recovery method will soon also be changing from the default global settlement mechanism, to type 3 where individual undercollateralized positions are converted into market orders; the intent with this is to further encourage market participation.
As the asset owner, I could change these directly however reaching out seemed appropriate. If this route is easier for you and not something you disagree with, then I could go that route with the MCR & MSSR change if you want?
Cheers
edit: Updated the reference price feeds to reflect the change BTS-CM/Norns@5ee6fa7
______________________________________________________ test_currencylayer_fetch _______________________________________________________
checkers = <class 'conftest.Checkers'>
def test_currencylayer_fetch(checkers):
source = CurrencyLayer(quotes=['BTC', 'EUR'], bases=['USD'], api_key=os.environ['CURRENCYLAYER_APIKEY'], free_subscription=True)
feed = source.fetch()
> checkers.check_feed(feed, ['BTC:USD', 'EUR:USD'], noVolume=True)
tests/sources/test_currencylayer.py:7:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
feed = {}, pairs = ['BTC:USD', 'EUR:USD'], kargs = {'noVolume': True}, pair = 'BTC:USD', quote = 'BTC', base = 'USD'
@py_assert1 = False, @py_format3 = "'USD' in {}", @py_format5 = "assert 'USD' in {}"
@staticmethod
def check_feed(feed, pairs, **kargs):
print(feed)
for pair in pairs:
(quote, base) = pair.split(':')
> assert base in feed
E AssertionError: assert 'USD' in {}
tests/sources/conftest.py:9: AssertionError
-------------------------------------------------------- Captured stdout call ---------------------------------------------------------
CurrencyLayer encountered an error while loading live data.
{}
-------------------------------------------------------- Captured stderr call ---------------------------------------------------------
Traceback (most recent call last):
File "/home/zapata/Projects/bitshares/bitshares-pricefeed/wrappers_env/lib/python3.6/site-packages/bitshares_pricefeed-0.0.10-py3.6.egg/bitshares_pricefeed/sources/main.py", line 65, in fetch
feed = self._fetch() # pylint: disable=no-member
File "/home/zapata/Projects/bitshares/bitshares-pricefeed/wrappers_env/lib/python3.6/site-packages/bitshares_pricefeed-0.0.10-py3.6.egg/bitshares_pricefeed/sources/currencylayer.py", line 25, in _fetch
raise Exception(result.get("description"))
Exception: None
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.