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

0 Members and 1 Guest are viewing this topic.

Offline Customminer

  • Sr. Member
  • ****
  • Posts: 456
  • Bitshares FTW!
    • View Profile
    • Gridcoin.US
  • GitHub: grctest
Hertz, Beyond Bitshares, Gridcoin!

Offline Customminer

  • Sr. Member
  • ****
  • Posts: 456
  • Bitshares FTW!
    • View Profile
    • Gridcoin.US
  • GitHub: grctest
Re: HERTZ - Oscillating Formula Based Asset
« Reply #46 on: March 23, 2018, 03:10:42 pm »
Hertz, Beyond Bitshares, Gridcoin!

Offline Customminer

  • Sr. Member
  • ****
  • Posts: 456
  • Bitshares FTW!
    • View Profile
    • Gridcoin.US
  • GitHub: grctest
Re: HERTZ - Oscillating Formula Based Asset
« Reply #47 on: March 25, 2018, 05:57:51 pm »
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?
Hertz, Beyond Bitshares, Gridcoin!

Offline zapata42

  • Jr. Member
  • **
  • Posts: 44
    • View Profile
  • BitShares: zapata42
Re: HERTZ - Oscillating Formula Based Asset
« Reply #48 on: March 26, 2018, 09:23:09 pm »
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 Customminer

  • Sr. Member
  • ****
  • Posts: 456
  • Bitshares FTW!
    • View Profile
    • Gridcoin.US
  • GitHub: grctest
Re: HERTZ - Oscillating Formula Based Asset
« Reply #49 on: March 27, 2018, 12:37:32 am »
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!
Hertz, Beyond Bitshares, Gridcoin!

Offline zapata42

  • Jr. Member
  • **
  • Posts: 44
    • View Profile
  • BitShares: zapata42
Re: HERTZ - Oscillating Formula Based Asset
« Reply #50 on: March 27, 2018, 03:59:12 pm »

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 Customminer

  • Sr. Member
  • ****
  • Posts: 456
  • Bitshares FTW!
    • View Profile
    • Gridcoin.US
  • GitHub: grctest
Re: HERTZ - Oscillating Formula Based Asset
« Reply #51 on: April 01, 2018, 11:44:10 am »
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 :)
Hertz, Beyond Bitshares, Gridcoin!

Offline Customminer

  • Sr. Member
  • ****
  • Posts: 456
  • Bitshares FTW!
    • View Profile
    • Gridcoin.US
  • GitHub: grctest
Re: HERTZ - Oscillating Formula Based Asset
« Reply #52 on: April 08, 2018, 01:18:41 am »
@zapata42 just to confirm, your BTS account is 'zapata42', yeah?
Hertz, Beyond Bitshares, Gridcoin!

Offline zapata42

  • Jr. Member
  • **
  • Posts: 44
    • View Profile
  • BitShares: zapata42
Re: HERTZ - Oscillating Formula Based Asset
« Reply #53 on: April 08, 2018, 09:07:28 pm »
@zapata42 just to confirm, your BTS account is 'zapata42', yeah?

Yes, it's my account.

Do you have any news from the witness?


Offline Customminer

  • Sr. Member
  • ****
  • Posts: 456
  • Bitshares FTW!
    • View Profile
    • Gridcoin.US
  • GitHub: grctest
Re: HERTZ - Oscillating Formula Based Asset
« Reply #54 on: April 08, 2018, 11:11:37 pm »
@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.
Hertz, Beyond Bitshares, Gridcoin!

Online clockwork

  • Committee member
  • Full Member
  • *
  • Posts: 103
    • View Profile
  • BitShares: clockwork
Re: HERTZ - Oscillating Formula Based Asset
« Reply #55 on: April 12, 2018, 07:50:38 am »
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 Customminer

  • Sr. Member
  • ****
  • Posts: 456
  • Bitshares FTW!
    • View Profile
    • Gridcoin.US
  • GitHub: grctest
Re: HERTZ - Oscillating Formula Based Asset
« Reply #56 on: April 12, 2018, 07:09:33 pm »
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..
Hertz, Beyond Bitshares, Gridcoin!

Online clockwork

  • Committee member
  • Full Member
  • *
  • Posts: 103
    • View Profile
  • BitShares: clockwork
Re: HERTZ - Oscillating Formula Based Asset
« Reply #57 on: April 13, 2018, 08:49:11 am »
that commit mainly changes the warning/skip levels ets...

seems to be a bigger issue in play here..

Does it work for you?

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12567
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Re: HERTZ - Oscillating Formula Based Asset
« Reply #58 on: April 13, 2018, 11:05:02 am »
I'm not sure why it's not been merged into the master branch yet..

Too busy ... sorry .. will take a look asap
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH

Offline Customminer

  • Sr. Member
  • ****
  • Posts: 456
  • Bitshares FTW!
    • View Profile
    • Gridcoin.US
  • GitHub: grctest
Re: HERTZ - Oscillating Formula Based Asset
« Reply #59 on: April 13, 2018, 11:43:28 am »
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.
Hertz, Beyond Bitshares, Gridcoin!