Author Topic: who can tell me what's the GOLD price?  (Read 16382 times)

0 Members and 1 Guest are viewing this topic.

Offline kani

  • Full Member
  • ***
  • Posts: 56
    • View Profile
I have adapted the @xeroc developed pricefeed script included within the python-graphenelib repository:

<snip>

Cheers!
Fox

Beautiful!  Thank you Fox!

GOLD can be an important asset and is worth supporting.  There are many who choose to hold savings in (real) gold, so having a stable and worthwhile SmartCoin which tracks the value faithfully is important.  Personally, I'd love to see GOLD supported as a method of payment (hello BLOCKPAY), or available on those crypto-credit-cards.
My opinions are my own

Turn up the H.E.A.T.

Offline 天籁

  • Hero Member
  • *****
  • Posts: 744
    • View Profile
I have adapted the @xeroc developed pricefeed script included within the python-graphenelib repository:
Code: [Select]
https://github.com/xeroc/python-graphenelib
If you are using this script, you may use the steps below as a guide to provide valid feeds for gold and silver.

1.   Edit config.py to remove Yahoo as a feed provider for GOLD and SILVER (Yahoo is not providing a valid USD price at this time)
1.1         Locate the feedsources.Yahoo function
1.2         Comment out the XAU and XAG entries using the hash symbol
Code: [Select]
#"XAU"       : "GOLD",
#"XAG"       : "SILVER",

2.   Ensure Quandl is enable as a feed provider for GOLD and SILVER
Code: [Select]
feedSources["quandl"]    = feedsources.Quandl(datasets={  # You provide a valid API Key or this will fail!
                                                  "GOLD:USD": [
                                                      "WGC/GOLD_DAILY_USD",
                                                      "LBMA/GOLD",
                                                      "PERTH/GOLD_USD_D"
                                                      ],
                                                  "SILVER:USD": [
                                                      "LBMA/SILVER",
                                                      "PERTH/SLVR_USD_D"
                                                      ]
                                                  }
                                              )

3.   Acquire a Quandl API Key
3.1         http://help.quandl.com/article/118-how-do-i-pass-along-my-user-id-or-api-key
3.2         It’s free, but requires a valid email account, GitHub account or other authentication provider

4.   Edit config.py to add your Quandl API Key
Code: [Select]
quandlApiKey = "dsahFHUiewjjd" # This is an invalid API Key. Replace with yours!
5.   Edit feedsources.py to include your Quandl API Key
5.1         Locate the Quandl URL string:
Code: [Select]
url = "https://www.quandl.com/api/v3/datasets/{dataset}.json?start_date={date}.format(5.2         Modify the query string portion of the URL to include your API Key from the config.py file
Code: [Select]
url = "https://www.quandl.com/api/v3/datasets/{dataset}.json?start_date={date}&api_key=" + config.quandlApiKey.format(
These modifications should allow your witness to provide a valid feed for both gold and silver.

I know others are using the scripts from the @wackou provided bts_tools repository:
Code: [Select]
https://github.com/wackou/bts_tools
I quickly glanced at this codebase, but did not locate Quandl as a feed provider.    I will endeavor to scratch together some code for bts_tools as well.

Cheers!
Fox
+100%

Offline Fox

I have adapted the @xeroc developed pricefeed script included within the python-graphenelib repository:
Code: [Select]
https://github.com/xeroc/python-graphenelib
If you are using this script, you may use the steps below as a guide to provide valid feeds for gold and silver.

1.   Edit config.py to remove Yahoo as a feed provider for GOLD and SILVER (Yahoo is not providing a valid USD price at this time)
1.1         Locate the feedsources.Yahoo function
1.2         Comment out the XAU and XAG entries using the hash symbol
Code: [Select]
#"XAU"       : "GOLD",
#"XAG"       : "SILVER",

2.   Ensure Quandl is enable as a feed provider for GOLD and SILVER
Code: [Select]
feedSources["quandl"]    = feedsources.Quandl(datasets={  # You provide a valid API Key or this will fail!
                                                  "GOLD:USD": [
                                                      "WGC/GOLD_DAILY_USD",
                                                      "LBMA/GOLD",
                                                      "PERTH/GOLD_USD_D"
                                                      ],
                                                  "SILVER:USD": [
                                                      "LBMA/SILVER",
                                                      "PERTH/SLVR_USD_D"
                                                      ]
                                                  }
                                              )

3.   Acquire a Quandl API Key
3.1         http://help.quandl.com/article/118-how-do-i-pass-along-my-user-id-or-api-key
3.2         It’s free, but requires a valid email account, GitHub account or other authentication provider

4.   Edit config.py to add your Quandl API Key
Code: [Select]
quandlApiKey = "dsahFHUiewjjd" # This is an invalid API Key. Replace with yours!
5.   Edit feedsources.py to include your Quandl API Key
5.1         Locate the Quandl URL string:
Code: [Select]
url = "https://www.quandl.com/api/v3/datasets/{dataset}.json?start_date={date}.format(5.2         Modify the query string portion of the URL to include your API Key from the config.py file
Code: [Select]
url = "https://www.quandl.com/api/v3/datasets/{dataset}.json?start_date={date}&api_key=" + config.quandlApiKey.format(
These modifications should allow your witness to provide a valid feed for both gold and silver.

I know others are using the scripts from the @wackou provided bts_tools repository:
Code: [Select]
https://github.com/wackou/bts_tools
I quickly glanced at this codebase, but did not locate Quandl as a feed provider.    I will endeavor to scratch together some code for bts_tools as well.

Cheers!
Fox

Witness: fox

Offline yvv

  • Hero Member
  • *****
  • Posts: 1186
    • View Profile
Due to unable to provide a forever accurate price feed, or no time to track whether they're correct, I'll stop producing price feeds for assets other than CNY/BTC/USD/EUR and their copies e.g. TUSD. IIRC actually I've never supported the assets with next to zero activity. It's my fault to provide price feeds for them.
maybe we can't stop publish price for GOLD/SILVER unless all short positions quit.
Just let them trigger a black swain event or something similar. We lack of resources, we need to focus on the popular products.

bitGOLD/bitSILVER are among few actually traded bitassets, and it would be sad if they go down.

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 4664
    • View Profile
    • Abit's Hive Blog
  • BitShares: abit
  • GitHub: abitmore
Just FYI Gold price can be get from this link from Yahoo:
http://download.finance.yahoo.com/d/quotes.csv?s=GC=F&f=l1&e=.csv
which stands for COMEX Gold Futures (next month).
BitShares committee member: abit
BitShares witness: in.abit

Offline kani

  • Full Member
  • ***
  • Posts: 56
    • View Profile
Just let them trigger a black swain event or something similar. We lack of resources, we need to focus on the popular products.

You want it to black swan just because you don't like it?!?!?!?!

This attitude is NOT okay!!!
My opinions are my own

Turn up the H.E.A.T.

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 4664
    • View Profile
    • Abit's Hive Blog
  • BitShares: abit
  • GitHub: abitmore
Due to unable to provide a forever accurate price feed, or no time to track whether they're correct, I'll stop producing price feeds for assets other than CNY/BTC/USD/EUR and their copies e.g. TUSD. IIRC actually I've never supported the assets with next to zero activity. It's my fault to provide price feeds for them.
maybe we can't stop publish price for GOLD/SILVER unless all short positions quit.
Just let them trigger a black swain event or something similar. We lack of resources, we need to focus on the popular products.
BitShares committee member: abit
BitShares witness: in.abit

Offline rnglab

  • Full Member
  • ***
  • Posts: 171
    • View Profile
  • BitShares: rnglab
It may be fair to note that most witnesses have been working practically ad honorem for between one and three years with such a responsability, the most with almost 24/7 avaibility to take care of the network.

Fetching a price sometimes fails due to source API problems. Sometimes it requires small modifications in the script to keep working. Some times the whole logic of the script had to be renewed.

But this is no excuse, we have to fix this asap.

I agree with abit on that stoping a low volume market is better than risking its users and the whole network with wrong feeds.
His decision looks to me as a call for attention.


It looks like only four witnesses are fetching gold and silver prices from sources other than yahoo.

For a fast short term correction, have you tried adding a quandl API key to its URL?





Offline yvv

  • Hero Member
  • *****
  • Posts: 1186
    • View Profile
just wanted to chime in and say that, as a witness and feed script provider, I will update/fix/do whatever is necessary to produce correct feed price for GOLD (as well as for other assets) but as most other people I am currently on holidays with the family, so it will have to wait a week or so.

Nice to hear this. Happy New Year!

Offline kani

  • Full Member
  • ***
  • Posts: 56
    • View Profile
just wanted to chime in and say that, as a witness and feed script provider, I will update/fix/do whatever is necessary to produce correct feed price for GOLD (as well as for other assets) but as most other people I am currently on holidays with the family, so it will have to wait a week or so.

Thank you.  That's very reassuring.
My opinions are my own

Turn up the H.E.A.T.

Offline wackou

just wanted to chime in and say that, as a witness and feed script provider, I will update/fix/do whatever is necessary to produce correct feed price for GOLD (as well as for other assets) but as most other people I am currently on holidays with the family, so it will have to wait a week or so.
Please vote for witness wackou! More info at http://digitalgaia.io

Offline kani

  • Full Member
  • ***
  • Posts: 56
    • View Profile
Yes, I’m relatively new here and yes I can be abrasive.  And no, I don’t really know who the important players are.  But, I thought I had found something special in Bitshares: a professional-grade network, and many robust features ensured by delegated proof of stake.

I’m sorry, I just don’t understand why abdication of responsibility shouldn’t have consequences for something as important as the witness.

Being a witness in Bitshares is the foundation of a secure network and is the primary mechanism to ensure that Market Pegged Assets (aka: SmartCoins, or bitAssets) function as intended.  Without responsible witnesses (and a community voting to ensure it), the Bitshares ecosystem is less enticing for use and investment.

I mean no disrespect to abit and his many contributions to Bitshares.  It’s just that running a witness node should not be viewed as an ‘inconvenience’ — many will gladly take the job for the important one that it is.

A professional network requires professional witnesses.

And that includes GOLD.  Please don't throw up your hands and give up when someone suggests an improvement.  Work to fix it!
« Last Edit: December 28, 2016, 02:41:52 am by kani »
My opinions are my own

Turn up the H.E.A.T.

Offline kani

  • Full Member
  • ***
  • Posts: 56
    • View Profile
Due to unable to provide a forever accurate price feed, or no time to track whether they're correct, I'll stop producing price feeds for assets other than CNY/BTC/USD/EUR and their copies e.g. TUSD. IIRC actually I've never supported the assets with next to zero activity. It's my fault to provide price feeds for them.

Wait.  WHAT?

Really, that's your attitude?  Jeez, let's vote this guy out and find a new witness who actually cares about Bitshares.

EDIT: I mean, really!  If you're not prepared to handle the responsibilities involved with being a witness, there are many others who can step up and fill that role.

Bitshares is a business.  If anyone is incapable or unwilling to do their JOB, it should be given to someone who will.
« Last Edit: December 27, 2016, 11:46:35 pm by kani »
My opinions are my own

Turn up the H.E.A.T.

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
Due to unable to provide a forever accurate price feed, or no time to track whether they're correct, I'll stop producing price feeds for assets other than CNY/BTC/USD/EUR and their copies e.g. TUSD. IIRC actually I've never supported the assets with next to zero activity. It's my fault to provide price feeds for them.
maybe we can't stop publish price for GOLD/SILVER unless all short positions quit.

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 4664
    • View Profile
    • Abit's Hive Blog
  • BitShares: abit
  • GitHub: abitmore
Due to unable to provide a forever accurate price feed, or no time to track whether they're correct, I'll stop producing price feeds for assets other than CNY/BTC/USD/EUR and their copies e.g. TUSD. IIRC actually I've never supported the assets with next to zero activity. It's my fault to provide price feeds for them.
« Last Edit: December 27, 2016, 04:29:55 pm by abit »
BitShares committee member: abit
BitShares witness: in.abit