Skip to main content

๐Ÿ‡ฎ๐Ÿ‡ฉ Average Cost (Compressed FIFO)

Average Cost (Compressed FIFO)

Written by Avery
Updated over 8 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?