Skip to content

Commit

Permalink
mindebt indicator based on accrued debt not maxRepay
Browse files Browse the repository at this point in the history
  • Loading branch information
brucedonovan committed Feb 21, 2022
1 parent 1127531 commit aa64c52
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/views/VaultPosition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ const VaultPosition = () => {
<InputInfoWrap action={() => setRepayInput(maxRepay_)}>
{_selectedVault.accruedArt.gt(maxRepay) ? (
<Text color="text" alignSelf="end" size="xsmall">
Maximum repayable is {cleanValue(maxRepay_!, 2)} {vaultBase?.displaySymbol!}{' '}
Maximum repayable is {cleanValue(maxRepay_!, 2)} {vaultBase?.displaySymbol!}
{!protocolLimited
? '(based on your token balance)'
: '(limited by protocol reserves)'}
Expand All @@ -411,12 +411,17 @@ const VaultPosition = () => {
</InputInfoWrap>
)}

{!repayInput && minDebt?.gt(ZERO_BN) && maxRepay.gt(ZERO_BN) && minDebt.gt(maxRepay) && (
<InputInfoWrap>
<Text size="xsmall">Your debt is below the current minimumn debt requirement. </Text>
<Text size="xsmall">(It is only possible to repay the full debt)</Text>
</InputInfoWrap>
)}
{!repayInput &&
minDebt?.gt(ZERO_BN) &&
_selectedVault.accruedArt.gt(ZERO_BN) &&
minDebt.gt(_selectedVault.accruedArt) && (
<InputInfoWrap>
<Text size="xsmall">
Your debt is below the current minimumn debt requirement.
</Text>
<Text size="xsmall">(It is only possible to repay the full debt)</Text>
</InputInfoWrap>
)}

{protocolLimited && (
<InputInfoWrap>
Expand Down

0 comments on commit aa64c52

Please sign in to comment.