From 6027374fcc1abb6caf6ca8f430a250a2279bcb41 Mon Sep 17 00:00:00 2001 From: Thrilok Kumar Date: Tue, 26 Nov 2019 05:13:20 +0800 Subject: [PATCH] added liquidity bal in mcd read --- contracts/Read/InstaMcdRead.sol | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/contracts/Read/InstaMcdRead.sol b/contracts/Read/InstaMcdRead.sol index f2bc68c..dd3619c 100644 --- a/contracts/Read/InstaMcdRead.sol +++ b/contracts/Read/InstaMcdRead.sol @@ -18,7 +18,7 @@ interface VatLike { function ilks(bytes32) external view returns (uint, uint, uint, uint, uint); function dai(address) external view returns (uint); function urns(bytes32, address) external view returns (uint, uint); - + function gem(bytes32, address) external view returns (uint); } interface JugLike { @@ -142,6 +142,7 @@ contract Helpers is DSMath { uint ink; uint art; uint debt; + uint liqInk; uint stabiltyRate; uint price; uint liqRatio; @@ -178,6 +179,7 @@ contract McdResolver is Helpers { uint debt = rmul(art,rate); uint price = rmul(priceMargin, mat); uint feeRate = getFee(ilks[i]); + uint liqInk = VatLike(ManagerLike(manager).vat()).gem(ilks[i], urns[i]); cdps[i] = CdpData( ids[i], @@ -186,6 +188,7 @@ contract McdResolver is Helpers { ink, art, debt, + liqInk, feeRate, price, mat, @@ -207,6 +210,8 @@ contract McdResolver is Helpers { uint mat = getIlkRatio(ilk); uint price = rmul(priceMargin, mat); + uint liqInk = VatLike(ManagerLike(manager).vat()).gem(ilk, urn); + uint feeRate = getFee(ilk); CdpData memory cdp = CdpData( @@ -216,6 +221,7 @@ contract McdResolver is Helpers { ink, art, debt, + liqInk, feeRate, price, mat, @@ -243,8 +249,4 @@ contract McdResolver is Helpers { address spot = InstaMcdAddress(getMcdAddresses()).spot(); (, ratio) = SpotLike(spot).ilks(ilk); } - - function getMkrToTknAmt(address tokenAddr, uint mkrAmt) public view returns (uint tknAmt) { - tknAmt = OtcInterface(getOtcAddress()).getPayAmount(tokenAddr, address(mkrAddr), mkrAmt); - } }