Skip to content

Commit

Permalink
fix: revert vol factor to 0.98 and remove vol factor on max withdraw
Browse files Browse the repository at this point in the history
  • Loading branch information
jkbpvsc authored and chambaz committed Dec 13, 2023
1 parent 5023a3d commit 0a192ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/marginfi-v2-ui-state/src/lib/mrgnlend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { Connection, PublicKey, SystemProgram } from "@solana/web3.js";
import BN from "bn.js";

const FEE_MARGIN = 0.01;
const VOLATILITY_FACTOR = 1;
const VOLATILITY_FACTOR = 0.98;

const DEFAULT_ACCOUNT_SUMMARY = {
healthFactor: 0,
Expand Down Expand Up @@ -347,7 +347,7 @@ function makeExtendedBankInfo(

const maxWithdraw = floor(
Math.min(
marginfiAccount.computeMaxWithdrawForBank(bank.address, { volatilityFactor: VOLATILITY_FACTOR }).toNumber(),
marginfiAccount.computeMaxWithdrawForBank(bank.address).toNumber(),
bankInfo.availableLiquidity
),
bankInfo.mintDecimals
Expand Down

0 comments on commit 0a192ea

Please sign in to comment.