Skip to content

Commit

Permalink
order details: use remaining amount for insufficient balance calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
sehyunc committed Sep 24, 2024
1 parent dec910b commit 82fac48
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export function DetailsContent({ order }: { order: OrderMetadata }) {
Number(filledAmount),
Number(order.data.amount),
)
const remainingAmount = order.data.amount - filledAmount

const formattedTotalAmount = formatNumber(
order.data.amount,
Expand Down Expand Up @@ -108,7 +109,7 @@ export function DetailsContent({ order }: { order: OrderMetadata }) {
{isOpen && (
<InsufficientWarning
withDialog
amount={order.data.amount}
amount={remainingAmount}
baseMint={order.data.base_mint}
className="text-sm font-bold tracking-tighter lg:tracking-normal"
quoteMint={order.data.quote_mint}
Expand Down

0 comments on commit 82fac48

Please sign in to comment.