diff --git a/packages/app/components/stack-modal/StackFrequencyAndDates.tsx b/packages/app/components/stack-modal/StackFrequencyAndDates.tsx index 0d3640f3..81c1d72a 100644 --- a/packages/app/components/stack-modal/StackFrequencyAndDates.tsx +++ b/packages/app/components/stack-modal/StackFrequencyAndDates.tsx @@ -50,7 +50,7 @@ export const StackFrequencyAndDates = ({ stackOrder }: StackOrderProps) => { ? "Finished with funds" : stackOrder.cancelledAt ? "Cancelled" - : formatTimestampToDateWithTime(nextSlot)} + : formatTimestampToDateWithTime(hasSlots ? nextSlot : firstSlot)} ); diff --git a/packages/app/models/stack-order/stack-order.ts b/packages/app/models/stack-order/stack-order.ts index 5ba7fd44..6bb65fe7 100644 --- a/packages/app/models/stack-order/stack-order.ts +++ b/packages/app/models/stack-order/stack-order.ts @@ -41,7 +41,7 @@ export const calculateStackAveragePrice = (order: StackOrder) => { ); }); const averagePrice = totalExecutedSellAmount / totalExecutedBuyAmount; - return averagePrice; + return totalExecutedBuyAmount ? averagePrice : 0; }; export const totalFundsUsed = (order: StackOrder) => {