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

order table: fix undercapitalized calc #159

Merged
merged 1 commit into from
Oct 25, 2024
Merged
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
6 changes: 3 additions & 3 deletions app/orders/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export const columns: ColumnDef<ExtendedOrderMetadata>[] = [
accessorKey: "state",
header: () => <div>Status</div>,
cell: function Cell({ row }) {
const { data: isCapitalized } = useBackOfQueueWallet({
const { data: isUndercapitalized } = useBackOfQueueWallet({
query: {
select: (data) =>
data.balances.some(
Expand All @@ -115,12 +115,12 @@ export const columns: ColumnDef<ExtendedOrderMetadata>[] = [
(row.original.data.side === "Buy"
? row.original.data.quote_mint
: row.original.data.base_mint) &&
balance.amount > BigInt(0),
balance.amount > row.original.data.amount,
),
},
})
let status: string = formatOrderState[row.getValue<OrderState>("status")]
if (!isCapitalized && status === "Open") {
if (!isUndercapitalized && status === "Open") {
status = "Undercapitalized"
}
return <div className="whitespace-nowrap">{status}</div>
Expand Down
Loading