Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added created at time for open vaults #88

Merged
merged 3 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/components/OpenVaultsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ export const columns: DataColumn<Row>[] = [
type: 'markup',
header: 'Collateral Type',
},
{
accessorKey: 'vault_created_time',
type: 'text',
header: 'Date Opened',
},
{
accessorKey: 'debt_type',
type: 'text',
Expand Down
2 changes: 2 additions & 0 deletions src/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ query {
balance
state
debt
blockTime
}
totalCount
}
Expand All @@ -116,6 +117,7 @@ query {
balance
state
debt
blockTime
}
}`)}
}`
Expand Down
1 change: 1 addition & 0 deletions src/types/vault-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export type VaultsNode = {
id: string;
state: string;
denom: string;
blockTime: string;
};

export type VaultManagerGovernancesNode = {
Expand Down
2 changes: 2 additions & 0 deletions src/widgets/OpenVaults.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { format } from 'date-fns';
import { Skeleton } from '@/components/ui/skeleton';
import { OpenVaultsTable } from '@/components/OpenVaultsTable';
import { SectionHeader } from '@/components/SectionHeader';
Expand Down Expand Up @@ -58,6 +59,7 @@ export function OpenVaults({ title = 'Open Vaults', data, isLoading }: Props) {
liquidation_price: liquidationPrice,
liquidation_cushion: currentCollateralPrice / (liquidationPrice - 1),
collateralization_ratio: collateralizationRatio === Infinity ? 0 : collateralizationRatio,
vault_created_time: format(new Date(vaultData?.blockTime), 'yyyy-MM-dd HH:mm'),
};
});

Expand Down
Loading
Loading