Author Topic: publish feed price automatic(From BitSuperLab)  (Read 52815 times)

0 Members and 1 Guest are viewing this topic.

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
I have try to use this command, but it's failed, do you know how to use this?
Code: [Select]
delegate (unlocked) >>> wallet_publish_feeds delegate.baozi {"USD":0.033,"CNY":0.204}
7 bad_cast_exception: Bad Cast
Invalid cast from object_type to Array
    {"type":"object_type"}
    th_a  variant.cpp:463 get_array

    {"command":"wallet_publish_feeds"}
    th_a  cli.cpp:555 execute_command

alt - There is a new command called wallet_update_feeds that publishes all feeds as one transaction. Will your code be updated to this? It would make for more accurate price feeds as when one feed needs updating they all get refreshed. With this command there's no reason every delegate won't support feeds for every pair!  :o



wallet_publish_feeds
Usage:
wallet_publish_feeds <delegate_account> <symbol_to_price_map>                                         
publishes a set of feeds for BitAssets, only active delegates may do this

Parameters:
  delegate_account (account_name, required): the delegate to publish the price under
  symbol_to_price_map (price_map, required): maps the BitAsset symbol to the price per BTSX

Returns:
  transaction_record


Thanks!!

Offline Riverhead

While you're in there making changes any chance bitUSD/BTSX Bid/Ask/Short tables can be updated to USD/BTSX (0.036 vs 25.0) like the other bitUSD stats? Would make it much easier to read :) .
there is a little button next to the bitUSD/BTSX on the top ... that makes the market swap/flip


That's on the client, not his website. Or is the button just not showing?

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
While you're in there making changes any chance bitUSD/BTSX Bid/Ask/Short tables can be updated to USD/BTSX (0.036 vs 25.0) like the other bitUSD stats? Would make it much easier to read :).
there is a little button next to the bitUSD/BTSX on the top ... that makes the market swap/flip

should read more before posting .. sry
« Last Edit: September 15, 2014, 11:52:15 am by xeroc »

Offline Riverhead

While you're in there making changes any chance bitUSD/BTSX Bid/Ask/Short tables can be updated to USD/BTSX (0.036 vs 25.0) like the other bitUSD stats? Would make it much easier to read :).

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
https://github.com/dacsunlimited/bitsharesx/commit/94a9c9af095d28e0795c0132e3537ccc2478a926

requires     v0.4.15-a

that's why I am not seeing it ... yet


I was wrong ... command is called "wallet_publish_feeds" and "wallet_publish_price_feed" .. little confusing .. (inconsistent)
« Last Edit: September 15, 2014, 11:48:00 am by xeroc »

Offline Riverhead

alt - There is a new command called wallet_update_feeds that publishes all feeds as one transaction. Will your code be updated to this? It would make for more accurate price feeds as when one feed needs updating they all get refreshed. With this command there's no reason every delegate won't support feeds for every pair!  :o



wallet_publish_feeds
Usage:
wallet_publish_feeds <delegate_account> <symbol_to_price_map>                                         
publishes a set of feeds for BitAssets, only active delegates may do this

Parameters:
  delegate_account (account_name, required): the delegate to publish the price under
  symbol_to_price_map (price_map, required): maps the BitAsset symbol to the price per BTSX

Returns:
  transaction_record


Thanks!!
« Last Edit: September 15, 2014, 11:12:11 am by Riverhead »

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
thanks, this looks so complex, I still have no idea about this...
Please be careful with WTI. Usually websites publish the front month contract as the current oil price, and each time the front month expires, there is a roll to the next month with a different price. I already wrote about this issue here:
https://bitsharestalk.org/index.php?topic=8679.msg113184#msg113184

I don't know how to get WTI and SLV from yahoo.

busygin

  • Guest
Please be careful with WTI. Usually websites publish the front month contract as the current oil price, and each time the front month expires, there is a roll to the next month with a different price. I already wrote about this issue here:
https://bitsharestalk.org/index.php?topic=8679.msg113184#msg113184

I don't know how to get WTI and SLV from yahoo.

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
have update btsx_feed_auto.py, now support more asset except: "PTS", "PPC", "LTC", "WTI"
I don't know how to get WTI  from yahoo.
« Last Edit: September 15, 2014, 06:35:08 am by alt »

Offline amencon

  • Sr. Member
  • ****
  • Posts: 227
    • View Profile
Hey,

What are the limits of publishing price feeds to btsx as a delegate?
Can this script be scaled up to provide dozens of price feeds? Or is there a limit?
Eli5 how price feeds work? :S

Cheers :)
It's dynamic in that you can set a change_min and change_max threshold, when the script polls the prices and seeing a change that fits in the range you set it publishes the new price.  On top of that you can set a periodic time countdown where it will publish the price on a schedule.  So currently I have my script setup to publish the feeds if prices go over 1% and under 50% change and also every 4 hours regardless of price activity.

As far as how many feeds it can monitor and update, skimming the script I see nothing that would limit how many are allowed.  When a price is published it is a separate RPC call with normal fee so the script just runs through the feeds and publishes them one by one when the criteria matches.

Let us know if you need any help customizing the script, it is very simple and just some variables that need changing.

Offline cryptillionaire

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Hey,

What are the limits of publishing price feeds to btsx as a delegate?
Can this script be scaled up to provide dozens of price feeds? Or is there a limit?
Eli5 how price feeds work? :S

Cheers :)

Offline mtang

  • Sr. Member
  • ****
  • Posts: 366
  • BTSX id:mtang
    • View Profile
Great job. +5%
I'm using this tool and it looks like very steady.
BTSX:wallet_approve_delegate btsx.outofcontrol true
DNS :wallet_account_set_approval mtang true
感谢给我们的受托人团队“失控”btsx.outofcontro以及she.bitrose投票。请关注FUND数字资产运作计划//立足兢兢业业的standby delegate//weibo ID:汤O包

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
updated:
1. update config file
2. use median price to replace average price, to protect system from  a suddenly drop price with a short period at the central trade site.

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
updated:
now we can set up a price change limit with config.json
in case that exchange return a very stupid price.
the default limit is 5%~50%

Offline alt

  • Hero Member
  • *****
  • Posts: 2821
    • View Profile
  • BitShares: baozi
update to github.

update the feed price at least every 23.5 hours. because the feed price will expired after 24 hours.