Skip to content

Commit f80eac7

Browse files
committed
remove duplicated code
1 parent 61196a6 commit f80eac7

1 file changed

Lines changed: 0 additions & 8 deletions

File tree

cadence/contracts/TidalProtocol.cdc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -903,14 +903,6 @@ access(all) contract TidalProtocol {
903903
adjustedCollateral = adjustedCollateral - collateralEffectiveValue
904904
log(" [CONTRACT] collateralTokenCount: \(collateralTokenCount)")
905905
log(" [CONTRACT] effectiveCollateralAfterDeposit: \(effectiveCollateral)")
906-
907-
// We can calculate the available debt increase that would bring us to the target health, unless the health
908-
// after deposit is an edgecase, in which case getting to the target health is impossible.
909-
var availableDebtIncrease = (healthAfterAdjustment == UFix64.max ? effectiveCollateral : effectiveCollateral / targetHealth) - effectiveDebt
910-
911-
// var availableDebtIncrease = (effectiveCollateralAfterDeposit / targetHealth) - effectiveDebtAfterDeposit
912-
let availableTokens = (availableDebtIncrease * self.borrowFactor[withdrawType]!) / self.priceOracle.price(ofToken: withdrawType)!
913-
return availableTokens + collateralTokenCount
914906
}
915907

916908
// At this point, we're either dealing with a position that didn't have a credit balance in the withdraw

0 commit comments

Comments
 (0)