Giter Site home page Giter Site logo

bitshares-pricefeed's People

Contributors

bitphage avatar grctest avatar roelandp avatar ryanrfox avatar wmbutler avatar xeroc avatar zapata avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bitshares-pricefeed's Issues

Fix RobinHood

____________________________________________________ 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)

Fix OKCoin

__________________________________________________________ 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)

Fix coincap

_________________________________________________________ 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)

Fix IEX

_______________________________________________________ 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)

Request: Modify Norn price feeds

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

Fix currencylayer

______________________________________________________ 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.