Skip to content

Commit c749af8

Browse files
authored
fix(treasury): use liquidationMargin for maxDebt calculation (#4163)
1 parent 4b40da0 commit c749af8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/treasury/src/vault.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,10 @@ export function makeVaultKit(
100100
);
101101

102102
// floorDivide because we want the debt ceiling lower
103-
return floorDivideBy(getAmountOut(quoteAmount), manager.getInitialMargin());
103+
return floorDivideBy(
104+
getAmountOut(quoteAmount),
105+
manager.getLiquidationMargin(),
106+
);
104107
}
105108

106109
async function assertSufficientCollateral(collateralAmount, wantedRun) {

0 commit comments

Comments
 (0)