fix slippage page

This commit is contained in:
Adrian Brzeziński 2024-01-08 17:50:13 +01:00
parent 879a2a4ea7
commit 25bd37b163
1 changed files with 6 additions and 2 deletions

View File

@ -199,6 +199,7 @@ const RiskDashboard: NextPage = () => {
apiNameToBankName(row.symbol),
)
const bank = banks && banks[0]
const borrowsEnabled = bank?.reduceOnly === 0
const hasAssetWeight =
bank &&
@ -229,9 +230,9 @@ const RiskDashboard: NextPage = () => {
bank &&
toUiDecimals(bank.depositWeightScaleStartQuote, 6)
const notionalDeposits =
bank!.uiDeposits() * bank!.uiPrice
(bank && bank!.uiDeposits() * bank!.uiPrice) || 0
const notionalBorrows =
bank!.uiBorrows() * bank!.uiPrice
(bank && bank!.uiBorrows() * bank!.uiPrice) || 0
const isAboveLiqFee =
(hasAssetWeight || borrowsEnabled) &&
@ -367,5 +368,8 @@ const apiNameToBankName = (val: string) => {
if (val === 'ETH') {
return 'ETH (Portal)'
}
if (val === '$WIF') {
return 'WIF'
}
return val
}