Skip to content

Commit

Permalink
[Price Feed] Delegate->Witness rename / More comments in configuratio…
Browse files Browse the repository at this point in the history
…n file
  • Loading branch information
xeroc committed Nov 26, 2015
1 parent fa0fbf9 commit 4db1f0a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
31 changes: 17 additions & 14 deletions scripts/pricefeeds/config-example.py
Original file line number Diff line number Diff line change
@@ -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
################################################################################
Expand Down
4 changes: 2 additions & 2 deletions scripts/pricefeeds/pricefeeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4db1f0a

Please sign in to comment.