[task] add LTV to vault tables (#381)

This commit is contained in:
Bob van der Helm 2023-08-21 08:02:32 -03:00 committed by GitHub
parent 179400fe08
commit e76a5dfc96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 4 deletions

View File

@ -1,2 +1,3 @@
src/utils/charting_library
src/utils/datafeeds
src/types/generated

View File

@ -1,2 +1,3 @@
src/utils/charting_library
src/utils/datafeeds
src/types/generated

View File

@ -25,7 +25,7 @@ import useStore from 'store'
import { BNCoin } from 'types/classes/BNCoin'
import { VaultStatus } from 'types/enums/vault'
import { getAssetByDenom } from 'utils/assets'
import { produceCountdown } from 'utils/formatters'
import { formatPercent, produceCountdown } from 'utils/formatters'
type Props = {
data: Vault[] | DepositedVault[]
@ -178,6 +178,20 @@ export const VaultTable = (props: Props) => {
)
},
},
{
accessorKey: 'ltv.max',
header: 'Max LTV',
cell: ({ row }) => {
return <Text className='text-xs'>{formatPercent(row.original.ltv.max)}</Text>
},
},
{
accessorKey: 'ltv.liq',
header: 'Liq. LTV',
cell: ({ row }) => {
return <Text className='text-xs'>{formatPercent(row.original.ltv.liq)}</Text>
},
},
{
accessorKey: 'details',
enableSorting: false,
@ -188,6 +202,7 @@ export const VaultTable = (props: Props) => {
},
cell: ({ row }) => {
const vault = row.original as DepositedVault
function enterVaultHandler() {
useStore.setState({
vaultModal: {
@ -230,7 +245,7 @@ export const VaultTable = (props: Props) => {
<thead className='bg-black/20'>
{table.getHeaderGroups().map((headerGroup) => (
<tr key={headerGroup.id}>
{headerGroup.headers.map((header, index) => {
{headerGroup.headers.map((header) => {
return (
<th
key={header.id}