BitShares Forum

Main => General Discussion => Topic started by: bytemaster on September 10, 2015, 06:54:35 pm

Title: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: bytemaster on September 10, 2015, 06:54:35 pm
We are looking for testers who will publish a BitUSD price feed in graphene.  You will need to be an elected witness to publish the feed.

You can either provide the script to an existing witness tester or become a tester yourself. 

Unfortunately there is little documentation on HOW to do this right now, hence the bounty.   Xeroc may be able to help.

Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: xeroc on September 10, 2015, 08:46:27 pm
This is what you need

Code: [Select]
/** Publishes a price feed for the named asset. * * Price feed providers use this command to publish their price feeds for market-issued assets. A price feed is * used to tune the market for a particular market-issued asset. For each value in the feed, the median across all * committee_member feeds for that asset is calculated and the market for the asset is configured with the median of that * value. * * The feed object in this command contains three prices: a call price limit, a short price limit, and a settlement price. * The call limit price is structured as (collateral asset) / (debt asset) and the short limit price is structured * as (asset for sale) / (collateral asset). Note that the asset IDs are opposite to eachother, so if we're * publishing a feed for USD, the call limit price will be CORE/USD and the short limit price will be USD/CORE. The * settlement price may be flipped either direction, as long as it is a ratio between the market-issued asset and * its collateral. * * @param publishing_account the account publishing the price feed * @param symbol the name or id of the asset whose feed we're publishing * @param feed the price_feed object containing the three prices making up the feed * @param broadcast true to broadcast the transaction on the network * @returns the signed transaction updating the price feed for the given asset */ signed_transaction publish_asset_feed(string publishing_account, string symbol, price_feed feed, bool broadcast = false);

I'll try to work out a basic script tomorrow .. but I dont have much time this week ..


wallet.hpp line 930
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: BTSdac on September 11, 2015, 02:38:35 am
is there bta in genesis block in bts 2.0?
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: svk on September 11, 2015, 04:30:48 am
is there bta in genesis block in bts 2.0?
Yes, all assets transfer over as is, including bit assets.
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: puppies on September 11, 2015, 04:42:01 am
I'm still unclear on who will be publishing feeds for assets?  I was under the impression that this would be something workers would do.  Is this something I will be expected to do as a witness?  Not that I mind or anything, just looking for clarity.
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: bytemaster on September 11, 2015, 04:14:00 pm
I'm still unclear on who will be publishing feeds for assets?  I was under the impression that this would be something workers would do.  Is this something I will be expected to do as a witness?  Not that I mind or anything, just looking for clarity.
Witnesses publish for the network.
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: xeroc on September 13, 2015, 09:16:21 am
I'm still unclear on who will be publishing feeds for assets?  I was under the impression that this would be something workers would do.  Is this something I will be expected to do as a witness?  Not that I mind or anything, just looking for clarity.
Witnesses publish for the network.
What that means is (iiuc) that witnesses produce feeds for bitassets .. there are also privatized smartcoins which mmay have different producers ..
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: sittingduck on September 13, 2015, 01:39:32 pm
It means bitusd works like it does in 1.0. 


Sent from my iPhone using Tapatalk
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: xeroc on September 13, 2015, 03:58:11 pm
It means bitusd works like it does in 1.0. 


Sent from my iPhone using Tapatalk
That statement will definitelly be misinterprered. Bitusd works differently in bts2 .. just the price feeds for bitusd work the same way .. except that there are now 3!!!! prices per bitasset.
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: xeroc on September 15, 2015, 08:27:28 am
More related info:
https://github.com/cryptonomex/graphene/blob/3eedabbac251b8afa585cb644f4b2b4596f2d37a/libraries/chain/include/graphene/chain/protocol/asset.hpp#L147-L194

Unfortunatelly, I have no clue why you say there are three prices in price_feed ..  I only see settlement_price, and core_exchange_rate. The other two are 'constants'
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: santaclause102 on September 15, 2015, 09:53:06 am
Have you developed a split forum personality, xeroc? :)

except that there are now 3!!!! prices per bitasset.

Unfortunatelly, I have no clue why you say there are three prices in price_feed ..  I only see settlement_price, and core_exchange_rate. The other two are 'constants'

lol one forum account isn't enough let's get another one that talks to me :)
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: xeroc on September 15, 2015, 10:11:15 am
hehe ... it's stated in the comments of the source code ..
https://github.com/cryptonomex/graphene/blob/master/libraries/wallet/include/graphene/wallet/wallet.hpp#L916-L939
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: betax on September 15, 2015, 12:07:55 pm
Have you developed a split forum personality, xeroc? :)

except that there are now 3!!!! prices per bitasset.

Unfortunatelly, I have no clue why you say there are three prices in price_feed ..  I only see settlement_price, and core_exchange_rate. The other two are 'constants'

lol one forum account isn't enough let's get another one that talks to me :)

LOL that is what I thought!
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: xeroc on September 18, 2015, 09:37:52 am
I am stuck ..
What's the syntax to hand over a price_feed object?
I am getting:
Code: [Select]
unlocked >>> publish_asset_feed init0 CORE {settlement_price:"0.4"} false
publish_asset_feed init0 CORE {settlement_price:"0.4"} false
4 parse_error_exception: Parse Error
Expected ':' after key "settlement_price"
    {"key":"settlement_price"}
    th_a  json_relaxed.hpp:589 objectFromStream
Error parsing object
    {}
    th_a  json_relaxed.hpp:611 objectFromStream

    {"str":"publish_asset_feed init0 CORE {settlement_price:\"0.4\"} false�"}
    th_a  json.cpp:494 variants_from_string
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: abit on September 19, 2015, 12:20:47 pm
I am stuck ..
What's the syntax to hand over a price_feed object?
I am getting:
Code: [Select]
unlocked >>> publish_asset_feed init0 CORE {settlement_price:"0.4"} false
publish_asset_feed init0 CORE {settlement_price:"0.4"} false
4 parse_error_exception: Parse Error
Expected ':' after key "settlement_price"
    {"key":"settlement_price"}
    th_a  json_relaxed.hpp:589 objectFromStream
Error parsing object
    {}
    th_a  json_relaxed.hpp:611 objectFromStream

    {"str":"publish_asset_feed init0 CORE {settlement_price:\"0.4\"} false"}
    th_a  json.cpp:494 variants_from_string

Here is my command which was able to create a transaction, but the transaction got refused by the chain:
Code: [Select]
publish_asset_feed in.abit USD {"settlement_price":{"base":{"amount":50000,"asset_id":"1.3.626"},"quote":{"amount":1000000000,"asset_id":"1.3.0"}},"core_exchange_rate":{"base":{"amount":100000,"asset_id":"1.3.0"},"quote":{"amount":10000,"asset_id":"1.3.626"}}} true

Looks like there is a bug. With current implementation, it's only possible to publish price feed for "committee issued assets" or "private assets", but all bitAssets are "witness issued assets". Submitted an issue here https://github.com/cryptonomex/graphene/issues/328.

p.s.
1. I think the command syntax isn't user-friendly (at all).
2. Can I get some part of the bounty?  8)
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: xeroc on September 19, 2015, 12:41:51 pm
@abit: thanks for figuring this out .. ill try to finish the script when back home (unless someone else can do more quickly) .. i'd be happy to share the bounty ..
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: abit on September 19, 2015, 12:46:47 pm
I did successfully published price feed for my bitAsset "ABITUSDA".  :D

Code: [Select]
publish_asset_feed in.abit ABITUSDA {"settlement_price":{"base":{"amount":50000,"asset_id":"1.3.662"},"quote":{"amount":1000000000,"asset_id":"1.3.0"}},"core_exchange_rate":{"base":{"amount":100000,"asset_id":"1.3.0"},"quote":{"amount":10000,"asset_id":"1.3.662"}}} true
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: xeroc on September 21, 2015, 01:59:03 pm
So ... assuming the following to be correct:
Code: [Select]
[
    [   
        "USD",
        {
            "core_exchange_rate": {
                "quote": {
                    "amount": 1044,
                    "asset_id": "1.3.626"
                },
                "base": {
                    "amount": 100000,
                    "asset_id": "1.3.0"
                }
            }, 
            "settlement_price": {
                "quote": {
                    "amount": 100000,
                    "asset_id": "1.3.0"
                }, 
                "base": {
                    "amount": 995,
                    "asset_id": "1.3.626"
                }   
            }   
        }   
    ], 
    [
        "EUR",
        {
            "core_exchange_rate": {
                "quote": {
                    "amount": 928,
                    "asset_id": "1.3.424"
                }, 
                "base": {
                    "amount": 100000,
                    "asset_id": "1.3.0"
                }   
            }, 
            "settlement_price": {
                "quote": {
                    "amount": 100000,
                    "asset_id": "1.3.0"
                }, 
                "base": {
                    "amount": 884,
                    "asset_id": "1.3.424"
                }   
            }   
        }   
    ]   
]
.. I have successfully modified my current price feed script to run for graphene ..
@bytemaster: if 1 BTS is worth $0.007 .. would the following price feed be correct?
Code: [Select]
                "quote": {
                    "amount": 700,
                    "asset_id": "1.3.424"
                }, 
                "base": {
                    "amount": 100000,
                    "asset_id": "1.3.0"
                }   
For now, I used the precision as base amount and the price multiplied by base amount as quote amount ..
Is this how it is supposed to be or am I understanding something wrong?


Code:
https://github.com/xeroc/python-graphenelib/blob/develop/scripts/pricefeeds.py
It requires installation of the python-graphenelib
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: xeroc on September 21, 2015, 03:19:41 pm
hmm .. thinking about this approach .. it should be possible to just represent the float as a rational (which is what you had in mind I suppose) and put nominator and denominator into base and quote ..
I will pimp this script this week ..
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: bytemaster on September 21, 2015, 08:29:36 pm
So ... assuming the following to be correct:
Code: [Select]
[
    [   
        "USD",
        {
            "core_exchange_rate": {
                "quote": {
                    "amount": 1044,
                    "asset_id": "1.3.626"
                },
                "base": {
                    "amount": 100000,
                    "asset_id": "1.3.0"
                }
            }, 
            "settlement_price": {
                "quote": {
                    "amount": 100000,
                    "asset_id": "1.3.0"
                }, 
                "base": {
                    "amount": 995,
                    "asset_id": "1.3.626"
                }   
            }   
        }   
    ], 
    [
        "EUR",
        {
            "core_exchange_rate": {
                "quote": {
                    "amount": 928,
                    "asset_id": "1.3.424"
                }, 
                "base": {
                    "amount": 100000,
                    "asset_id": "1.3.0"
                }   
            }, 
            "settlement_price": {
                "quote": {
                    "amount": 100000,
                    "asset_id": "1.3.0"
                }, 
                "base": {
                    "amount": 884,
                    "asset_id": "1.3.424"
                }   
            }   
        }   
    ]   
]
.. I have successfully modified my current price feed script to run for graphene ..
@bytemaster: if 1 BTS is worth $0.007 .. would the following price feed be correct?
Code: [Select]
                "quote": {
                    "amount": 700,
                    "asset_id": "1.3.424"
                }, 
                "base": {
                    "amount": 100000,
                    "asset_id": "1.3.0"
                }   
For now, I used the precision as base amount and the price multiplied by base amount as quote amount ..
Is this how it is supposed to be or am I understanding something wrong?


Code:
https://github.com/xeroc/python-graphenelib/blob/develop/scripts/pricefeeds.py
It requires installation of the python-graphenelib


What you have is almost correct, except it fails to consider the precision difference between BITUSD and BTS.   BTS has 5 digits and BitUSD has 4 so you are off by a factor of 10.
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: abit on September 23, 2015, 04:41:55 pm
I've managed to get the script run, but the result seems a bit wrong.
Code: [Select]
[
    [
        "CNY",
        {
            "core_exchange_rate": {
                "quote": {
                    "amount": 6670,
                    "asset_id": "1.3.379"
                },
                "base": {
                    "amount": 100000,
                    "asset_id": "1.3.0"
                }
            },
            "settlement_price": {
                "quote": {
                    "amount": 100000,
                    "asset_id": "1.3.0"
                },
                "base": {
                    "amount": 6353,
                    "asset_id": "1.3.379"
                }
            }
        }
    ],
...
...
    [
        "USD",
        {
            "core_exchange_rate": {
                "quote": {
                    "amount": 1044,
                    "asset_id": "1.3.626"
                },
                "base": {
                    "amount": 100000,
                    "asset_id": "1.3.0"
                }
            },
            "settlement_price": {
                "quote": {
                    "amount": 100000,
                    "asset_id": "1.3.0"
                },
                "base": {
                    "amount": 995,
                    "asset_id": "1.3.626"
                }
            }
        }
    ]
]
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: xeroc on September 23, 2015, 05:49:58 pm
It lacks the ratio between precisions .. i will fix this tomorrow ..
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: abit on September 23, 2015, 06:35:35 pm
It lacks the ratio between precisions .. i will fix this tomorrow ..
Not only that.. I'll submit a pull request soon.
//Update:
pull request requested. https://github.com/xeroc/python-graphenelib/pull/1
New source can be found here:
 https://github.com/abitmore/python-graphenelib/
 https://github.com/abitmore/python-graphenelib/blob/master/scripts/pricefeeds.py
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: abit on September 23, 2015, 08:19:19 pm
@bytemaster: should "core_exchange_rate" equal to external exchanges, and "settlement_price" be a bit higher?
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: xeroc on September 23, 2015, 08:23:40 pm
@abit: thanks for your inputs .. I took some of your patch but sticked to my philisophy of [base][qu ote] ..
anyway .. I also added another btc price feed and modified the price feed structure .. it should now do what it is supposed to do ..

also, the exchange_rate is for transactions fees that are paid in bitasset .. in my script .. paying your transactions in bitUSD (or any other bitasset) is 5% more expensive (read: supposed to be)

If you find the time, please go through the script .. I appreciate your input!!! +5%
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: abit on September 23, 2015, 09:05:13 pm
@abit: thanks for your inputs .. I took some of your patch but sticked to my philisophy of [base][qu ote] ..
anyway .. I also added another btc price feed and modified the price feed structure .. it should now do what it is supposed to do ..

also, the exchange_rate is for transactions fees that are paid in bitasset .. in my script .. paying your transactions in bitUSD (or any other bitasset) is 5% more expensive (read: supposed to be)

If you find the time, please go through the script .. I appreciate your input!!! +5%

Result of your latest script is here:
Code: [Select]
    [
        "USD",
        {
            "settlement_price": {
                "base": {
                    "asset_id": "1.3.626",
                    "amount": 85427
                },
                "quote": {
                    "asset_id": "1.3.0",
                    "amount": 55
                }
            },
            "core_exchange_rate": {
                "base": {
                    "asset_id": "1.3.0",
                    "amount": 55
                },
                "quote": {
                    "asset_id": "1.3.626",
                    "amount": 89698
                }
            }
        }
    ]
The numbers are wrong..
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: xeroc on September 24, 2015, 05:55:18 am
The numbers are wrong..
How so?

The output says:

Code: [Select]
   "settlement_price": {
       "base": {
           "asset_id": "1.3.626",
           "amount": 85427
       },
       "quote": {
           "asset_id": "1.3.0",
           "amount": 55
       }
   },

which is:
55/85427 BTS/USD = 0.000644 * 10 (precision) BTS/USD
That has been the price yesterday.

For the core_exchange rate (if you look at the code), I added a 5% premium.

Don't see how that is 'wrong'
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: svk on September 24, 2015, 09:55:06 am
The numbers are wrong..
How so?

The output says:

Code: [Select]
   "settlement_price": {
       "base": {
           "asset_id": "1.3.626",
           "amount": 85427
       },
       "quote": {
           "asset_id": "1.3.0",
           "amount": 55
       }
   },

which is:
55/85427 BTS/USD = 0.000644 * 10 (precision) BTS/USD
That has been the price yesterday.

For the core_exchange rate (if you look at the code), I added a 5% premium.

Don't see how that is 'wrong'

Why are the base and quote assets inverted for settlement_price and core_exchange_rate?
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: xeroc on September 24, 2015, 02:59:19 pm
From what I understa.d I shouldn really matter since you have the asset-id side by side with the amount ... 10 x/y is identical to 0.1 y/x. ... isnt it?
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: abit on September 24, 2015, 03:21:18 pm
The numbers are wrong..
How so?

The output says:

Code: [Select]
   "settlement_price": {
       "base": {
           "asset_id": "1.3.626",
           "amount": 85427
       },
       "quote": {
           "asset_id": "1.3.0",
           "amount": 55
       }
   },

which is:
55/85427 BTS/USD = 0.000644 * 10 (precision) BTS/USD
That has been the price yesterday.

For the core_exchange rate (if you look at the code), I added a 5% premium.

Don't see how that is 'wrong'

The result says 85427/10^4 USD == 55/10^5 CORE. (it can be checked with https://graphene.bitshares.org/ after pushed a price feed.)
The correct result should be like 0.00644 USD == 1 CORE, or 0.0644 USD = 10 CORE. Bring in the precision, it should be 644/10^4 USD == 1000000/10^5 CORE, so the json should be
Code: [Select]
   "settlement_price": {
       "base": {
           "asset_id": "1.3.626",
           "amount": 644
       },
       "quote": {
           "asset_id": "1.3.0",
           "amount": 1000000
       }
   },
By the way, I think
1, it's more human-readable if one of the amount is 10^n
2, a little more precision could be better
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: xeroc on September 25, 2015, 08:15:51 am
I know see what you mean.

This patch (https://github.com/xeroc/python-graphenelib/commit/421d9c04785b5ce3d70f77376485109f808133cd) will result in the following output:

Code: [Select]
            "core_exchange_rate": {
                "quote": {
                    "amount": 52,
                    "asset_id": "1.3.626"
                },
                "base": {
                    "amount": 92170,
                    "asset_id": "1.3.0"
                }
            }
would the numbers now fit you too?

BTW, I am using "fractions" to get a numerator and denominator instead of just using 10^x .. but in the end, they all represent the same ratio ..
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: xeroc on September 25, 2015, 08:22:59 am
Then you need to publish a feed.  If you did it today on the testnet, you'd use the publish_asset_feed command.  But soon (as in I'm working on it right now) there will be a much better command for this (publish_asset_feed requires you to specify prices in satoshis which is...inconvenient).
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: abit on September 25, 2015, 12:50:59 pm
I know see what you mean.

This patch (https://github.com/xeroc/python-graphenelib/commit/421d9c04785b5ce3d70f77376485109f808133cd) will result in the following output:

Code: [Select]
            "core_exchange_rate": {
                "quote": {
                    "amount": 52,
                    "asset_id": "1.3.626"
                },
                "base": {
                    "amount": 92170,
                    "asset_id": "1.3.0"
                }
            }
would the numbers now fit you too?
Yes they are right.
Quote
BTW, I am using "fractions" to get a numerator and denominator instead of just using 10^x .. but in the end, they all represent the same ratio ..
Yes I saw it. But personally I like 10^x more because I don't need to take out a calculator to check the numbers ;D

Then you need to publish a feed.  If you did it today on the testnet, you'd use the publish_asset_feed command.  But soon (as in I'm working on it right now) there will be a much better command for this (publish_asset_feed requires you to specify prices in satoshis which is...inconvenient).
Good news. Easier to use is better.
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: xeroc on October 07, 2015, 04:08:31 pm
So @bytemaster, what else needs to be done for the price feed script to qualify for the bounty?
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: xeroc on October 08, 2015, 06:54:04 am
I have now added a quick "howto": http://python-graphenelib.readthedocs.org/en/latest/pricefeed.html
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: bytemaster on October 08, 2015, 12:44:28 pm
So @bytemaster, what else needs to be done for the price feed script to qualify for the bounty?

I think you have qualified.   In the test net your script published some prices with the wrong asset id.     We tightened the validation to catch those errors, but it appears Ben has not committed them yet.
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: Riverhead on October 08, 2015, 01:48:46 pm
So @bytemaster, what else needs to be done for the price feed script to qualify for the bounty?

I think you have qualified.

Grats Xeroc! :)
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: bytemaster on October 08, 2015, 01:51:48 pm
Can we get a summary of what data sources are being used by this script?
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: xeroc on October 08, 2015, 02:08:15 pm
Can we get a summary of what data sources are being used by this script?
Code: [Select]
mythreads["yahoo"]    = threading.Thread(target = fetch_from_yahoo)
 mythreads["yunbi"]    = threading.Thread(target = fetch_from_yunbi)
 mythreads["btc38"]    = threading.Thread(target = fetch_from_btc38)
 #mythreads["bter"]     = threading.Thread(target = fetch_from_bter)
 mythreads["poloniex"] = threading.Thread(target = fetch_from_poloniex)
 mythreads["bittrex"]  = threading.Thread(target = fetch_from_bittrex)
 mythreads["btcavg"]   = threading.Thread(target = fetch_bitcoinaverage)

Yahoo for traditional assets like GOLD, Silver.
Yunbi, btc38, bter (disabled atm), poloniex and bittrex for BTS/BTC pair
btcavg for USD/EUR to BTC pair ..


I am not sure how my script was even possible to submit prices for the wrong
paris.
Code: [Select]
  price_feed = {
                      "settlement_price": {
                        "quote": {
                          "asset_id": "1.3.0",
                          "amount": denominator
                        },
                        "base": {
                          "asset_id": assets[asset]["id"],
                          "amount": numerator
                        }
                      },
                      "core_exchange_rate": {
                        "quote": {
                          "asset_id": assets[asset]["id"],
                          "amount": numerator
                        },
                        "base": {
                          "asset_id": "1.3.0",
                          "amount": int(denominator * 1.05) # 5% extra
                        }
                      }
                    }
I load all publishing assets into ``assets`` and read the id JIT.
I'll investigate
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: bytemaster on October 08, 2015, 09:33:22 pm
You script should attempt to include all feed update operations in a single transaction to minimize load on the network.
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: xeroc on October 09, 2015, 11:57:03 am
You script should attempt to include all feed update operations in a single transaction to minimize load on the network.
Sounds like a good idea .. but for that I need to use the transaction_builder ..
I can do this but I may not be able to finish this up until after Shanghai

Beside that, could you please give you thoughts on this topic?
https://bitsharestalk.org/index.php/topic,18831.msg242310.html#msg242310
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: xeroc on October 09, 2015, 01:01:25 pm
I have updated the code:

+ reneabled bter
+ added another parameter "core_exchange_factor"
+ readded publishing rules which now allows to run it in a cron job on only publish every X seconds or on larger price changes (config parameter)
+ reenabled all other currencies that have been available in BTS1 already (INDICES still not complete)

TODO:
 + indices
 + bundle prices into a single transaction
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: BunkerChainLabs-DataSecurityNode on October 09, 2015, 05:15:51 pm
I have updated the code:

+ reneabled bter
+ added another parameter "core_exchange_factor"
+ readded publishing rules which now allows to run it in a cron job on only publish every X seconds or on larger price changes (config parameter)
+ reenabled all other currencies that have been available in BTS1 already (INDICES still not complete)

TODO:
 + indices
 + bundle prices into a single transaction

 +5%
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: xeroc on December 05, 2015, 12:19:24 pm
We are looking for testers who will publish a BitUSD price feed in graphene.  You will need to be an elected witness to publish the feed.

You can either provide the script to an existing witness tester or become a tester yourself. 

Unfortunately there is little documentation on HOW to do this right now, hence the bounty.   Xeroc may be able to help.
Can I request the bounty now?
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: bytemaster on December 06, 2015, 11:05:41 pm
Bounty is all yours, where do you want the BitUSD sent?
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: Thom on December 07, 2015, 01:10:43 am
That payout took awhile. Luck for you BM many of us here are a patient lot. Some of us grumble more than others but we're still here.

Xeroc certainly deserves the bounty, and perhaps some BROWNIES for the patience.
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: xeroc on December 07, 2015, 08:15:18 am
Bounty is all yours, where do you want the BitUSD sent?
you can send it all to "xeroc" .. I'll share a cut with @abit
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: abit on December 07, 2015, 06:43:40 pm
Bounty is all yours, where do you want the BitUSD sent?
you can send it all to "xeroc" .. I'll share a cut with @abit
Thanks  ;) my account is "abit"
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: abit on December 12, 2015, 09:01:32 pm
Just a note: alt made another price feed script, see https://bitsharestalk.org/index.php/topic,20529.msg265069.html
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: bytemaster on December 12, 2015, 10:17:44 pm
FYI this bounty has been paid.
Title: Re: 100 BitUSD to First Person to Publish a working Price Feed Script for Graphene
Post by: tonyk on December 12, 2015, 10:22:58 pm
FYI this bounty has been paid.

That's worth mentioning for sure ... not paid in timely manner but for sure better than

 half ass excuses citing unseen yet but upcoming best practices.