Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement to renbtc strategy #192

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions config/badger_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,16 @@
cvxCrvHelperVault=convex.cvxCrvHelperVault,
),
),
unitRenBtc=DotMap(
strategyName="StrategyUnitProtocolRenbtc",
params=DotMap(
want=registry.tokens.renbtc,
performanceFeeStrategist=1000,
performanceFeeGovernance=1000,
withdrawalFee=0,
keepCRV=0,
),
),
),
helper=DotMap(
cvx=DotMap(
Expand Down
2 changes: 1 addition & 1 deletion config/env_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def __init__(self):
self.aws_secret_access_key = decouple.config(
"AWS_SECRET_ACCESS_KEY", default=""
)
self.graph_api_key = decouple.config("GRAPH_API_KEY")
self.graph_api_key = decouple.config("GRAPH_API_KEY", default="")
self.debug = debug


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ abstract contract StrategyUnitProtocolMeta is BaseStrategy, UniswapSwapper {
bool public collateralPriceEth = false;

// configurable minimum collateralization percent this strategy would hold for CDP
uint256 public minRatio = 200;
uint256 public minRatio = 150;
// collateralization percent buffer in CDP debt actions
uint256 public ratioBuff = 200;
uint256 public constant ratioBuffMax = 10000;
Expand Down Expand Up @@ -62,7 +62,13 @@ abstract contract StrategyUnitProtocolMeta is BaseStrategy, UniswapSwapper {

function getDebtWithoutFee() public view returns (uint256) {
return IUnitVault(unitVault).debts(collateral, address(this));
}
}

function getDueFee() public view returns (uint256) {
uint256 totalDebt = getDebtBalance();
uint256 borrowed = getDebtWithoutFee();
return totalDebt > borrowed? totalDebt.sub(borrowed) : 0;
}

function debtLimit() public view returns (uint256) {
return IUnitVaultParameters(unitVaultParameters).tokenDebtLimit(collateral);
Expand Down
Loading