Skip to content

Commit

Permalink
fix wallet balance
Browse files Browse the repository at this point in the history
  • Loading branch information
7ayd committed Jan 21, 2025
1 parent ae5581f commit dde9d4d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/app/src/lib/components/foil/addEditTrade.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default function AddEditTrade() {
const isNonZeroSizeChange = sizeChangeInContractUnit !== BigInt(0);

const formError = useMemo(() => {
if (Number(quotedResultingWalletBalance) < 0) {
if (Number(quotedResultingWalletBalance) < 0 || Number(walletBalance) <= 0) {
return 'Insufficient wallet balance to perform this trade.';
}
if (
Expand All @@ -121,6 +121,7 @@ export default function AddEditTrade() {
sizeChangeInContractUnit,
isLong,
quotedResultingWalletBalance,
walletBalance,
]);

// Position data
Expand Down

0 comments on commit dde9d4d

Please sign in to comment.