Skip to content

Commit

Permalink
[Price Feed] Make default price parameters more clean
Browse files Browse the repository at this point in the history
  • Loading branch information
xeroc committed Nov 26, 2015
1 parent 4db1f0a commit ea91778
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions scripts/pricefeeds/config-example.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@
## Asset specific Borrow/Short parameters
################################################################################
# Core exchange rate for paying transaction fees in non-BTS assets
default_core_exchange_factor = 0.95
core_exchange_factor = {
"USD" : 0.95,
"default" : 0.95, # default value
"USD" : 0.95, # asset-specific overwrite
}

# Call when collateral only pays off 175% the debt
default_maintenance_collateral_ratio = 1750
maintenance_collateral_ratio = {
"USD" : 1750,
"default" : 1750, # default value
"USD" : 1750, # asset-specific overwrite
}

# Stop calling when collateral only pays off 110% of the debt
default_maximum_short_squeeze_ratio = 1100
maximum_short_squeeze_ratio = {
"USD" : 1100,
"default" : 1100, # default value
"USD" : 1100, # asset-specific overwrite
}

################################################################################
Expand Down
6 changes: 3 additions & 3 deletions scripts/pricefeeds/pricefeeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,18 +566,18 @@ def update_price_feed() :
"maintenance_collateral_ratio" :
config.maintenance_collateral_ratio[ symbol ]
if (symbol in config.maintenance_collateral_ratio)
else config.default_maintenance_collateral_ratio,
else config.maintenance_collateral_ratio["default"],
"maximum_short_squeeze_ratio" :
config.maximum_short_squeeze_ratio[ symbol ]
if (symbol in config.maximum_short_squeeze_ratio)
else config.default_maximum_short_squeeze_ratio,
else config.maximum_short_squeeze_ratio["default"],
"core_exchange_rate": {
"quote": {
"asset_id": "1.3.0",
"amount": int(denominator * (
config.core_exchange_factor[ symbol ]
if (symbol in config.core_exchange_factor)
else config.default_core_exchange_factor
else config.core_exchange_factor["default"]
))
},
"base": {
Expand Down

0 comments on commit ea91778

Please sign in to comment.