0 Members and 1 Guest are viewing this topic.
FYI this bounty has been paid.
Quote from: bytemaster on December 06, 2015, 11:05:41 pmBounty is all yours, where do you want the BitUSD sent?you can send it all to "xeroc" .. I'll share a cut with @abit
Bounty is all yours, where do you want the BitUSD sent?
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.
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
You script should attempt to include all feed update operations in a single transaction to minimize load on the network.
Can we get a summary of what data sources are being used by this script?
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)
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 } } }
Quote from: xeroc on October 07, 2015, 04:08:31 pmSo @bytemaster, what else needs to be done for the price feed script to qualify for the bounty?I think you have qualified.
So @bytemaster, what else needs to be done for the price feed script to qualify for the bounty?
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?
"core_exchange_rate": { "quote": { "amount": 52, "asset_id": "1.3.626" }, "base": { "amount": 92170, "asset_id": "1.3.0" } }
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 ..
Quote from: theoretical on September 24, 2015, 08:23:37 pmThen 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).
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).
Quote from: abit on September 23, 2015, 09:05:13 pmThe 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/USDThat 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 numbers are wrong..
"settlement_price": { "base": { "asset_id": "1.3.626", "amount": 85427 }, "quote": { "asset_id": "1.3.0", "amount": 55 } },
"settlement_price": { "base": { "asset_id": "1.3.626", "amount": 644 }, "quote": { "asset_id": "1.3.0", "amount": 1000000 } },
@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!!!
[ "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 } } } ]
It lacks the ratio between precisions .. i will fix this tomorrow ..
[ [ "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" } } } ]]
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.pyIt requires installation of the python-graphenelib
[ [ "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" } } } ] ]
"quote": { "amount": 700, "asset_id": "1.3.424" }, "base": { "amount": 100000, "asset_id": "1.3.0" }
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
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"} falsepublish_asset_feed init0 CORE {settlement_price:"0.4"} false4 parse_error_exception: Parse ErrorExpected ':' after key "settlement_price" {"key":"settlement_price"} th_a json_relaxed.hpp:589 objectFromStreamError 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
unlocked >>> publish_asset_feed init0 CORE {settlement_price:"0.4"} falsepublish_asset_feed init0 CORE {settlement_price:"0.4"} false4 parse_error_exception: Parse ErrorExpected ':' after key "settlement_price" {"key":"settlement_price"} th_a json_relaxed.hpp:589 objectFromStreamError 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
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
unlocked >>> publish_asset_feed init0 CORE {settlement_price:"0.4"} falsepublish_asset_feed init0 CORE {settlement_price:"0.4"} false4 parse_error_exception: Parse ErrorExpected ':' after key "settlement_price" {"key":"settlement_price"} th_a json_relaxed.hpp:589 objectFromStreamError 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
Have you developed a split forum personality, xeroc? Quote from: xeroc on September 13, 2015, 03:58:11 pmexcept that there are now 3!!!! prices per bitasset.Quote from: xeroc on September 15, 2015, 08:27:28 amUnfortunatelly, 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
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'
It means bitusd works like it does in 1.0. Sent from my iPhone using Tapatalk
Quote from: puppies on September 11, 2015, 04:42:01 amI'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.
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.
is there bta in genesis block in bts 2.0?
/** 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);