Skip to content

Commit

Permalink
fix(treasury): use liquidationMargin for maxDebt calculation (#4163)
Browse files Browse the repository at this point in the history
  • Loading branch information
samsiegart authored Dec 13, 2021
1 parent 4b40da0 commit c749af8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/treasury/src/vault.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ export function makeVaultKit(
);

// floorDivide because we want the debt ceiling lower
return floorDivideBy(getAmountOut(quoteAmount), manager.getInitialMargin());
return floorDivideBy(
getAmountOut(quoteAmount),
manager.getLiquidationMargin(),
);
}

async function assertSufficientCollateral(collateralAmount, wantedRun) {
Expand Down

0 comments on commit c749af8

Please sign in to comment.