Author Topic: HERTZ - Oscillating Formula Based Asset  (Read 33337 times)

0 Members and 1 Guest are viewing this topic.

Offline R

  • Hero Member
  • *****
  • Posts: 1034
    • View Profile
During the bitUSD GS, don't forget to check out Hertz as an alternative to short 👍


Offline R

  • Hero Member
  • *****
  • Posts: 1034
    • View Profile
that commit mainly changes the warning/skip levels ets...

seems to be a bigger issue in play here..

Does it work for you?

I've not had any feedback from witnesses regarding hertz integration into xeroc's price feed script, it looks like the pull request has been merged by @xeroc, perhaps blockchaind (rudex) are using this repo and can provide input on this matter? I use the stand alone price feed script for hertz.

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
I'm not sure why it's not been merged into the master branch yet..

Too busy ... sorry .. will take a look asap

Offline clockwork

  • Committee member
  • Sr. Member
  • *
  • Posts: 376
    • View Profile
  • BitShares: clockwork
that commit mainly changes the warning/skip levels ets...

seems to be a bigger issue in play here..

Does it work for you?

Offline R

  • Hero Member
  • *****
  • Posts: 1034
    • View Profile
Hey Customminer,

Trying to use: https://github.com/xeroc/bitshares-pricefeed/blob/master/bitshares_pricefeed/examples/hertz.yaml until I sort out my own pricefeed solution and I get the following error:

AssertionError: You cannot provide a 'price' this way

Are there any adjustments needed to the pricefeed code?
Have you implemented this pull request? https://github.com/xeroc/bitshares-pricefeed/pull/32

I'm not sure why it's not been merged into the master branch yet..

Offline clockwork

  • Committee member
  • Sr. Member
  • *
  • Posts: 376
    • View Profile
  • BitShares: clockwork
Hey Customminer,

Trying to use: https://github.com/xeroc/bitshares-pricefeed/blob/master/bitshares_pricefeed/examples/hertz.yaml until I sort out my own pricefeed solution and I get the following error:

AssertionError: You cannot provide a 'price' this way

Are there any adjustments needed to the pricefeed code?


Offline R

  • Hero Member
  • *****
  • Posts: 1034
    • View Profile
@zapata42 just to confirm, your BTS account is 'zapata42', yeah?

Yes, it's my account.

Do you have any news from the witness?

None yet, sent you 2/3 of the bounty & will send the last 1/3 once it's proven working in production.

Offline zapata42

  • Full Member
  • ***
  • Posts: 62
    • View Profile
  • BitShares: zapata42
@zapata42 just to confirm, your BTS account is 'zapata42', yeah?

Yes, it's my account.

Do you have any news from the witness?


Offline R

  • Hero Member
  • *****
  • Posts: 1034
    • View Profile
@zapata42 just to confirm, your BTS account is 'zapata42', yeah?

Offline R

  • Hero Member
  • *****
  • Posts: 1034
    • View Profile
I'll contact you or any witnesses in private so we can proceed with more testing.

Witnesses I've contacted requesting btsprice hertz testing:
magicwallet.witness https://bitsharestalk.org/index.php?topic=26069.msg317391#msg317391
witness.hiblockchain https://bitsharestalk.org/index.php?topic=25888.msg317390#msg317390
winex.witness https://bitsharestalk.org/index.php?topic=25831.msg317389#msg317389

Hopefully this works & these 3 witnesses begin publishing Hertz price feeds :)

Offline zapata42

  • Full Member
  • ***
  • Posts: 62
    • View Profile
  • BitShares: zapata42

Code: [Select]
rate_cny["HERTZ"] = compute_hertz() * rate_cny["USD"]
In the above snippet of code, does
Code: [Select]
rate_cny["USD"] result in the bitCNY:bitUSD rate, or the BTS:bitUSD rate?

If it's not BTS:bitUSD then it will not line up with the other hertz price feeds.

It is: CNY/USD rate (FIAT not bit).

The rates are taken from hq.sina.cn (see btsprice/sina.py).  Yahoo Finance API could be as source also, but the service has been closed by Yahoo. It might worth updating the scripts to get another source of rates like Alpha Vantage API (https://www.alphavantage.co/).. but this is another topic.

The formula does not end here, you have at btsprice/feedprice.py:161
Code: [Select]
self.price_queue[asset].append(bts_price_in_cny / self.bts_price.rate_cny[asset])
The main work (and difference) of alt's script is to compute 'bts_price_in_cny' from a variety of exchange's _order books_ (not tickers), then compute all other prices using the rate CNY / XXX.
I didn't change this principle, as I think it's the behavior expected by the witnesses are using this script maybe because they trust the BTS/CNY rate more than the others.

This mean the complete formula is:
Code: [Select]
BTS/CNY / (compute_HERTZ() * CNY/USD)
I hope this is fine.

Do not hesitate to do a review of the pull request. It will be easier to discuss around the code.


I'm not a witness so I can't test the publication. I'll try to setup it on testnet when I will have some time (probably next week).
Let me know if a witness using alt's script is avialable for testing.

I've got the hertz name reserved on testnet, I can provide you price feed publish rights on testnet if you're interested.

In the mean time, there were multiple witnesses on bitsharestalk who stated that they would consider supporting hertz once integrated into btsprice - I'll reach out to them in the next couple days.

I'll contact you or any witnesses in private so we can proceed with more testing.

Offline R

  • Hero Member
  • *****
  • Posts: 1034
    • View Profile
An attempt to help you: https://github.com/pch957/btsprice/pull/6

Many thanks, I replied to the pull request before spotting your post here. Once it's been tested as functional I'll release the 750 bitUSD bounty.

alt's btsprice use CNY/BTS rate as a base for all the prices, so I'm using it for Hertz/Hero.

Code: [Select]
rate_cny["HERTZ"] = compute_hertz() * rate_cny["USD"]
In the above snippet of code, does
Code: [Select]
rate_cny["USD"] result in the bitCNY:bitUSD rate, or the BTS:bitUSD rate?

If it's not BTS:bitUSD then it will not line up with the other hertz price feeds.

I'm not a witness so I can't test the publication. I'll try to setup it on testnet when I will have some time (probably next week).
Let me know if a witness using alt's script is avialable for testing.

I've got the hertz name reserved on testnet, I can provide you price feed publish rights on testnet if you're interested.

In the mean time, there were multiple witnesses on bitsharestalk who stated that they would consider supporting hertz once integrated into btsprice - I'll reach out to them in the next couple days.

I have also started to gather all changes from the community on my repo: https://github.com/Zapata/btsprice/commits/master (WIP)

Thanks, this is well needed!

Offline zapata42

  • Full Member
  • ***
  • Posts: 62
    • View Profile
  • BitShares: zapata42
An attempt to help you: https://github.com/pch957/btsprice/pull/6

alt's btsprice use CNY/BTS rate as a base for all the prices, so I'm using it for Hertz/Hero.

I'm not a witness so I can't test the publication. I'll try to setup it on testnet when I will have some time (probably next week).
Let me know if a witness using alt's script is avialable for testing.

I have also started to gather all changes from the community on my repo: https://github.com/Zapata/btsprice/commits/master (WIP)

Offline R

  • Hero Member
  • *****
  • Posts: 1034
    • View Profile
Really need to create Hertz price feeds for btsprice https://github.com/pch957/btsprice/issues/4

Would anyone be interested in working on this in return for some bitUSD? :D

$750 for Hertz implementation sound tempting? It needs to be pegged to BTS:USD settlement rate (not BTS:CNY).

Use the time() reference instead of pendulum & try to get the BTS:USD rate from existing btsprice functionality (or implement following the existing coding style).

Hertz references:
https://github.com/BTS-CM/scripts/blob/master/hertz-feed.py
https://github.com/grctest/bts_tools/blob/master/bts_tools/feeds.py#L275
https://github.com/grctest/bts_tools/blob/master/bts_tools/feeds.py#L439

Anyone interested in this bounty?