mirror of
https://github.com/Instadapp/dsa-resolvers-deprecated.git
synced 2024-07-29 22:38:16 +00:00
Added debt ceiling in maker resolver
This commit is contained in:
parent
a4c7e94fcd
commit
68e3f380f4
|
@ -110,6 +110,8 @@ contract Helpers is DSMath {
|
|||
uint borrowRate;
|
||||
uint price;
|
||||
uint liquidationRatio;
|
||||
uint debtCelling;
|
||||
uint totalDebt;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -162,6 +164,13 @@ contract Helpers is DSMath {
|
|||
address spot = InstaMcdAddress(getMcdAddresses()).spot();
|
||||
(, ratio) = SpotLike(spot).ilks(ilk);
|
||||
}
|
||||
|
||||
function getDebtCeiling(bytes32 ilk) internal view returns (uint debtCeiling, uint totalDebt) {
|
||||
address vat = InstaMcdAddress(getMcdAddresses()).vat();
|
||||
(uint totalArt,uint rate,,uint debtCeilingRad,) = VatLike(vat).ilks(ilk);
|
||||
debtCeiling = debtCeilingRad / 10 ** 45;
|
||||
totalDebt = rmul(totalArt, rate);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -236,10 +245,13 @@ contract VaultResolver is Helpers {
|
|||
|
||||
for (uint i = 0; i < name.length; i++) {
|
||||
bytes32 ilk = stringToBytes32(name[i]);
|
||||
(uint debtCeiling, uint totalDebt) = getDebtCeiling(ilk);
|
||||
colInfo[i] = ColInfo(
|
||||
getFee(ilk),
|
||||
getColPrice(ilk),
|
||||
getColRatio(ilk)
|
||||
getColRatio(ilk),
|
||||
debtCeiling,
|
||||
totalDebt
|
||||
);
|
||||
}
|
||||
return colInfo;
|
||||
|
@ -265,5 +277,5 @@ contract DSRResolver is VaultResolver {
|
|||
|
||||
|
||||
contract InstaMakerResolver is DSRResolver {
|
||||
string public constant name = "Maker-Resolver-v1";
|
||||
string public constant name = "Maker-Resolver-v1.1";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user