MP-3483: all Depo. Caps are now % filled (#551)

This commit is contained in:
Linkie Link 2023-10-17 09:08:25 +02:00 committed by GitHub
parent 19fb876668
commit 623bbe8854
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -154,7 +154,6 @@ export const VaultTable = (props: Props) => {
const percent = vault.cap.used
.dividedBy(vault.cap.max.multipliedBy(VAULT_DEPOSIT_BUFFER))
.multipliedBy(100)
.integerValue()
const decimals = getAssetByDenom(vault.cap.denom)?.decimals ?? 6

View File

@ -99,7 +99,9 @@ export default function LendingMarketsTable(props: Props) {
header: 'Depo. Cap',
cell: ({ row }) => {
const { marketDepositCap, marketDepositAmount, asset } = row.original
const remainingCap = row.original.marketDepositCap.minus(marketDepositAmount)
const percent = marketDepositAmount
.dividedBy(row.original.marketDepositCap)
.multipliedBy(100)
return (
<TitleAndSubCell
@ -113,8 +115,8 @@ export default function LendingMarketsTable(props: Props) {
}
sub={
<FormattedNumber
amount={remainingCap.toNumber()}
options={{ abbreviated: true, decimals: asset.decimals, suffix: ` left` }}
amount={percent.toNumber()}
options={{ minDecimals: 2, maxDecimals: 2, suffix: '% Filled' }}
animate
/>
}