Skip to main content

🇮🇩 Average Cost (Compressed FIFO)

Average Cost (Compressed FIFO)

KAI avatar
Written by KAI
Updated over 2 months ago

🥖 What is Compressed FIFO?

Imagine you're running a bakery.

On Monday, you bake 100 loaves at $10 each, and later that day bake 50 more at $12 each. At the end of the day, you’ve spent a total of $1,600 for 150 loaves, meaning your compressed cost per loaf is $10.67 (=$1,600 ÷ 150).

Two days later, a customer comes in and buys 120 loaves. You use FIFO, so you sell the earliest loaves first, all using that compressed price from Monday.

This is how Gotrade’s Compressed FIFO works:

  • Each day’s buys are compressed into a single average cost.

  • When you sell shares on a later day, we calculate cost basis using FIFO, starting with that day’s compressed cost.


🧾 Example: Sell on a Different Day (With Remaining Shares)

Day 1 – Multiple Buys

  • Buy 100 shares at $10 → $1,000

  • Buy 50 shares at $12 → $600

End of Day 1 – Compressed Price Calculation

  • Total Shares: 150

  • Total Value: $1,600

  • Compressed Price: $10.67

Day 2 – Additional Buy

  • Buy 30 shares at $15 → $450

Day 3 – Sell 120 shares

Compressed FIFO Sell Logic:

  • We apply FIFO starting with Day 1’s 150 shares at $10.67

  • After selling 120 shares, you still have 60 shares left (30 from Day 1 + 30 from Day 2)

Cost Basis Calculation:

  • Day 1’s compressed trade value: $1,600

  • 120 shares sold from Day 1 = 120 × $10.67 = $1,280

  • Remaining Day 1 value = $320 (30 shares × $10.67)

  • Day 2 value remains untouched = $450

→ Cost Basis After Sale = $320 (Day 1 left) + $450 (Day 2) = $770 → Average Cost = $770 ÷ 60 = $12.83

Did this answer your question?