diff --git a/scripts/pricefeeds/config-example.py b/scripts/pricefeeds/config-example.py index 2b89de64..3dce06b9 100644 --- a/scripts/pricefeeds/config-example.py +++ b/scripts/pricefeeds/config-example.py @@ -1,29 +1,32 @@ ################################################################################ ## RPC-client connection information (required) ################################################################################ -host = "localhost" -port = 8092 -user = "" -passwd = "" -unlock = "" - -ask_confirmation = True +host = "localhost" # machine that runs a cli-wallet with -H parameter +port = 8092 # RPC port, e.g.`-H 127.0.0.1:8092` +user = "" # API user (optional) +passwd = "" # API user passphrase (optional) +unlock = "" # password to unlock the wallet if the cli-wallet is locked ################################################################################ -## Delegate Feed Publish Parameters +## Script runtime parameters ################################################################################ -delegate_name = "init0" -maxAgeFeedInSeconds = 60*60 # 1hour +ask_confirmation = True # if true, a manual confirmation is required ################################################################################ -## Fine tuning +## Witness Feed Publish Parameters ################################################################################ -discount = 0.995 # discount for borrowing of an asset -minValidAssetPriceInBTC = 100 * 1e-8# minimum valid price for BTS in BTC -price_metric = "weighted" # "median", "mean", or "weighted" (by volume) +witness_name = "init0" +maxAgeFeedInSeconds = 60*60 # A feed should be at most 1hour old change_min = 0.5 # Percentage of price change to force an update change_max = 5.0 # Percentage of price change to cause a warning +################################################################################ +## Fine tuning +################################################################################ +discount = 0.995 # discount for borrowing of an asset +minValidAssetPriceInBTC = 100 * 1e-8 # minimum valid price for BTS in BTC +price_metric = "weighted" # "median", "mean", or "weighted" (by volume) + ################################################################################ ## Asset specific Borrow/Short parameters ################################################################################ diff --git a/scripts/pricefeeds/pricefeeds.py b/scripts/pricefeeds/pricefeeds.py index 6b082671..b8c7f545 100755 --- a/scripts/pricefeeds/pricefeeds.py +++ b/scripts/pricefeeds/pricefeeds.py @@ -309,7 +309,7 @@ def fetch_from_wallet(rpc): print("Fetching data from wallet...") ## Get my Witness global myWitness - myWitness = rpc.get_witness(config.delegate_name) + myWitness = rpc.get_witness(config.witness_name) witnessId = myWitness["witness_account"] ## asset definition - mainly for precision @@ -365,7 +365,7 @@ def update_feed(rpc, feeds): print( "Unlocking wallet" ) ret = rpc.unlock(config.unlock) - print("constructing feed for witness %s"%config.delegate_name) + print("constructing feed for witness %s"%config.witness_name) handle = rpc.begin_builder_transaction(); for asset in feeds : if not feeds[asset]["publish"] : continue