HERO Feed Producers

The price feed producers are defined by the HERO management and can be distinct from the BitShares witnesses.

Requirements

  • BitShares account
  • some BTS to pay for the small transaction fee
  • approval for a slot as producer by the HERO management

Note

In order to obtain a slot as feed producer, please send an email to::: feed@hero.global.

Example Script

This example requires:

For reference, the scritps used to

  • feed a price feed, and
  • setup the HERO

are provided as public good on github:

Add your key to pybitshares wallet

uptick addkey

In order to get a price feed published for HERO

from getpass import getpass
from bitshares.price import Price
from bitshares.market import Market
from datetime import date

# USD:BTS price
market = Market("USD:BTS")
price = market.ticker()["quoteSettlement_price"]
price.invert()  # invert to allow easier multiplication

# HERO:USD price
hero_usd = (1.05 ** ((date.today() - date(1913, 12, 23)).days / 365.2425))
hero = Price(hero_usd, "USD/HERO")

# HERO:BTS price
hero_bts = price * hero

print("Price of HERO in USD: {}".format(hero))
print("Price of USD in BTS: {}".format(price))
print("Price of HERO in BTS: {}".format(hero_bts))

# unlock wallet
market.bitshares.wallet.unlock(getpass("Password: "))
print(market.bitshares.publish_price_feed(
    "HERO",
    hero_bts,
    mssr=110,
    mcr=175,
    account="<YOUR-PUBLISHER-NAME>"
))

BitShares-PriceFeed

Alternatively, the bitshares-pricefeed project allows to produce feeds for HERO as well:

pip3 install bitshares_pricefeed   [--user]
uptick addkey   # Add your account's active key

bitshares-pricefeed --configfile=hero.yaml create hero
... edit hero.yaml

bitshares-pricefeed --configfile=hero.yaml update HERO

For automation, you may set the environmental variable UNLOCK to prevent the tool from asking for the unlock password.