Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Hero & Hertz] 'bitshares-pricefeed' referencing bitUSD | BTS_Tools referencing BTC:USD (bitUSD|BTC:USD) #33

Open
grctest opened this issue Jan 19, 2018 · 3 comments

Comments

@grctest
Copy link
Contributor

grctest commented Jan 19, 2018

Summarized snippets of Wackou's price feed script:

btc_price = feeds_bts_btc.price()

feeds_btc_usd = get_multi_feeds('get', [('BTC', 'USD')],
                                active_providers_bts({providers.BitcoinAverage,
                                                      providers.CoinMarketCap,
                                                      providers.Bitfinex,
                                                      providers.Bitstamp}))
btc_usd = feeds_btc_usd.price()
usd_price = btc_price * btc_usd
feeds['HERO'] = usd_price / (1.05 ** ((pendulum.today() - pendulum.Pendulum(1913, 12, 23)).in_days() / 365.2425))

Current Hero&Hertz Yaml USD reference:

# ... namely "USD" a.k.a. "bitUSD"
ref_asset: USD

There's a difference in price BTS:USD reference between the two Bitshares price feed libraries. @xeroc's scripts reference bitUSD (decentralized, reliant on bitUSD functioning properly, less volatile?) meanwhile @wackou's price feed scripts reference external BTC:USD price feeds (Reliant on centralized exchanges, potentially vulnerable to manipulation, potentially avoid following bitUSD into a blackswan).

What's the appropriate USD reference for Hero (and consequentially Hertz) bitUSD:BTS and/or BTC:USD?

Cheers

@Zapata
Copy link

Zapata commented Jun 7, 2018

From what I understand from the code, @xeroc's script use bitUSD market price. There is usually a 10% spread between the market price and the settlement price.

Another approach could be to use bitUSD settlement price/current feed (= the median price of all the feeds).
This way you rely on Bitshares decentralization of the price feed to get a proper price.

I think if you already publish the price of USD:BTS it's better to use your computed price (this way USD and HERTZ price will be consistent), but if you publish only HERTZ, the best it's to get bitUSD settlement price.

I have added BitsharesFeed source for this purpose in my repo.

@grctest
Copy link
Contributor Author

grctest commented Oct 15, 2019

BSIP 76 (bitshares/bsips#221) has now set fixed (fake) price feeds for bitUSD.

Since this price feed script uses bitUSD as the price feed reference it's now producing inaccurate Hertz price feeds.

Can an alternative to bitUSD be provided for Hertz to become accurate again?

@Zapata
Copy link

Zapata commented Oct 18, 2019

Note that using my fork (which is used by most of the witnesses), the USD price used depends of the configuration file.
All three sources are possible:

  • Bitshares USD feed:
    hero:
        klass: Hero
    bitshares_usd_feed:
        klass: BitsharesFeed
        assets:
            - USD
  • USD/BTS from Dex:
    hero:
        klass: Hero
    bitshares_usd_market:
        klass: Graphene
        quotes:
            - USD
        bases:
            - BTS
        aliases:
            USD: BITUSD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants