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

fix: temporarily hide staging data on liquidated dashboard #86

Merged
merged 3 commits into from
Jun 25, 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
30 changes: 15 additions & 15 deletions src/components/LiquidatedVaultsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,26 +50,26 @@ export const columns: DataColumn<Row>[] = [
type: 'number',
header: 'IST Debt Amount',
},
{
accessorKey: 'liquidation_margin_avg',
type: 'percent',
header: 'Liquidation Ratio',
},
{
accessorKey: 'liquidating_rate',
type: 'usd',
header: 'Liquidation Price',
},
// {
// accessorKey: 'liquidation_margin_avg',
// type: 'percent',
// header: 'Liquidation Ratio',
// },
// {
// accessorKey: 'liquidating_rate',
// type: 'usd',
// header: 'Liquidation Price',
// },
{
accessorKey: 'liquidated_return_amount',
type: 'number',
header: 'Collateral Returned Amount',
},
{
accessorKey: 'liquidated_return_amount_usd',
type: 'usd',
header: 'Collateral Returned ($USD)',
},
// {
// accessorKey: 'liquidated_return_amount_usd',
// type: 'usd',
// header: 'Collateral Returned ($USD)',
// },
];

export function LiquidatedVaultsTable({ data }: Props) {
Expand Down
44 changes: 22 additions & 22 deletions src/pages/Liquidated.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { ErrorAlert } from '@/components/ErrorAlert';

export function Liquidated() {
const { data, isLoading, error } = useSWR<AxiosResponse, AxiosError>(LIQUIDATIONS_DASHBOARD, (query: string) =>
subQueryFetcher(query, SUBQUERY_STAGING_URL),
subQueryFetcher(query),
);
const response: LiquidationDashboardResponse = data?.data?.data;

Expand All @@ -28,28 +28,28 @@ export function Liquidated() {
};

// Queries for graph
const {
data: vaultStateDailyData,
isLoading: graphDataIsLoading,
error: graphDataError,
} = useSWR<AxiosResponse, AxiosError>(VAULT_STATE_DAILIES_QUERY, (query: string) =>
subQueryFetcher(query, SUBQUERY_STAGING_URL),
);
const vaultStateDailyResponse: VaultStateDailyResponse = vaultStateDailyData?.data?.data;
const graphDataMap: { [key: number]: GraphData } = {};
vaultStateDailyResponse?.vaultStatesDailies.nodes?.forEach((vaultState) => {
graphDataMap[Number(vaultState.id)] = {
x: vaultState.blockTimeLast?.split('T')[0],
key: Number(vaultState.id),
active: Number(vaultState.active),
liquidated: Number(vaultState.liquidated) + Number(vaultState.liquidatedClosed),
closed: Number(vaultState.closed),
};
});
// const {
// data: vaultStateDailyData,
// isLoading: graphDataIsLoading,
// error: graphDataError,
// } = useSWR<AxiosResponse, AxiosError>(VAULT_STATE_DAILIES_QUERY, (query: string) =>
// subQueryFetcher(query, SUBQUERY_STAGING_URL),
// );
// const vaultStateDailyResponse: VaultStateDailyResponse = vaultStateDailyData?.data?.data;
// const graphDataMap: { [key: number]: GraphData } = {};
// vaultStateDailyResponse?.vaultStatesDailies.nodes?.forEach((vaultState) => {
// graphDataMap[Number(vaultState.id)] = {
// x: vaultState.blockTimeLast?.split('T')[0],
// key: Number(vaultState.id),
// active: Number(vaultState.active),
// liquidated: Number(vaultState.liquidated) + Number(vaultState.liquidatedClosed),
// closed: Number(vaultState.closed),
// };
// });

const graphDataList = populateMissingDays(graphDataMap, GRAPH_DAYS);
// const graphDataList = populateMissingDays(graphDataMap, GRAPH_DAYS);

const errorMessage = error || graphDataError;
const errorMessage = error;
if (errorMessage) {
return <ErrorAlert value={errorMessage} title="Request Error" />;
}
Expand All @@ -61,7 +61,7 @@ export function Liquidated() {
<ValueCardGrid>
<LiquidatedVaultCountCard data={response?.vaultManagerMetrics?.nodes} isLoading={isLoading} />
</ValueCardGrid>
<VaultStatesChart data={graphDataList} isLoading={graphDataIsLoading} />
{/* <VaultStatesChart data={graphDataList} isLoading={graphDataIsLoading} /> */}
<hr className="my-5" />
<LiquidatedVaults data={liquidationDashboardData} boardAuxes={boardAuxes} isLoading={isLoading} />
</PageContent>
Expand Down
2 changes: 0 additions & 2 deletions src/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,6 @@ query {
state
balance
blockTime
oraclePrice
vaultManagerGovernance
currentState {
id
denom
Expand Down
Loading