Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Conflicts:
	scripts/pricefeeds/pricefeeds.py
  • Loading branch information
gileadmcgee committed Nov 5, 2015
2 parents 444df71 + 7b8a67d commit 7795d51
Show file tree
Hide file tree
Showing 4 changed files with 671 additions and 16 deletions.
4 changes: 3 additions & 1 deletion graphenebase/base58.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ def __format__(self, _format) :
elif _format.lower() == "btc":
return base58CheckEncode(0x00, self._hex)
elif _format.lower() == "bts" :
return _format + str(self)
return _format.upper() + str(self)
elif _format.lower() == "muse" :
return _format.upper() + str(self)
else :
raise Exception("Format %s unkown." %_format)
"""
Expand Down
10 changes: 8 additions & 2 deletions scripts/monitor-refcode/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,21 @@ def process_operations(self, operations) :
memomsg))

# Parse the memo
pattern = re.compile('[a-zA-Z0-9]{8}')
pattern = re.compile('[A-Z0-9]{3}-[A-Z0-9-]{8}')
searchResults = pattern.search(memomsg)
if not searchResults:
continue
ref_code = searchResults.group(0)

email = ""
pattern = re.compile('[a-z0-9][-a-z0-9_\+\.]*[a-z0-9]\@.+\.[a-z]+')
searchResults = pattern.search(memomsg.lower())
if searchResults:
email = searchResults.group(0)

# Request to Faucet
headers = {'content-type': 'text/plain'}
query = "refcode[code]=%s&refcode[account]=%s&refcode[asset_symbol]=%s&refcode[asset_amount]=%s" % (ref_code, from_account["name"], amount_asset["symbol"], op["amount"]["amount"])
query = "refcode[code]=%s&refcode[account]=%s&refcode[asset_symbol]=%s&refcode[asset_amount]=%s&refcode[send_to]=%s" % (ref_code, from_account["name"], amount_asset["symbol"], op["amount"]["amount"], email)
print("--- query: %s" % query)
response = requests.post(config.faucet_url,
params=query,
Expand Down
28 changes: 15 additions & 13 deletions scripts/pricefeeds/config-example.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,29 @@
core_exchange_factor = 0.95 # 5% discount if paying fees in bitassets
maintenance_collateral_ratio = 1750 # Call when collateral only pays off 175% the debt
maximum_short_squeeze_ratio = 1100 # Stop calling when collateral only pays off 110% of the debt
minValidAssetPriceInBTC = 0.00001# minimum valid price for BTS in BTC
minValidAssetPriceInBTC = 100 * 1e-8# minimum valid price for BTS in BTC

price_metric = "weighted" # "median", "mean", or "weighted" (by volume)
change_min = 0.5 # Percentage of price change to force an update
change_max = 5.0 # Percentage of price change to cause a warning

## Enable exchanges
enable_yunbi = False # currently halted
enable_btc38 = False # not yet trading bts2
enable_bter = False
enable_btcavg = True # used to get BTC/* prices
enable_bter = False # No BTS2
enable_btc38 = False # No official statement for BTS2 yet
enable_btcid = False # No official statement for BTS2 yet
enable_yunbi = True
enable_poloniex = True
enable_bittrex = True
enable_btcavg = True
enable_ccedk = True
enable_btcid = True

## trust level for exchanges (if an exception happens and level is 0.8 script
## will quit with a failure)
btc38_trust_level = 0.9
bter_trust_level = 0.5
poloniex_trust_level = 1.0
bittrex_trust_level = 0.5
yunbi_trust_level = 0.8
ccedk_trust_level = 1.0
btcid_trust_level = 1.0
poloniex_trust_level = 1.0 # trades BTS2
ccedk_trust_level = 1.0 # trades BTS2
bittrex_trust_level = 0.5 # is currently migrating
yunbi_trust_level = 0.5 # is currently migrating

btc38_trust_level = 0.0 # disabled!
btcid_trust_level = 0.0 # disabled!
bter_trust_level = 0.0 # disabled!
Loading

0 comments on commit 7795d51

Please sign in to comment.