Declare the cost-allocation model first
An entered ledger needs to state how cost is allocated to a partial exit. This example uses a deliberately simplified proportional average-cost model. It is not a tax method, a statement of US accounting requirements or an assertion about any broker’s records.
Preserve the source quantities, entry amounts, fee conventions and chosen allocation policy. A different lot-identification or expense treatment can produce a different accounting result. Do not silently mix policies between the opening and remaining-position rows.
Work through a fictional two-entry position
Enter 2 units at 100 USD and 1 unit at 130 USD. Total entered quantity is 3 and supplied cost is 330 USD, giving a model average of 110 USD per unit. If 1 unit is then sold for 120 USD, the proportional model allocates 110 USD of cost to that exited unit.
The remaining 2 units retain 220 USD of allocated cost, still 110 per unit. Subtracting the 120 sale proceeds from 330 instead leaves 210 of net cash spent, or 105 per remaining unit. That second ratio is a cash-recovery calculation, not the same remaining-entry-cost measure.
| Teaching measure after one-unit sale | Amount or ratio | Interpretation |
|---|---|---|
| Remaining allocated cost | 330 − 110 = 220 USD | Proportional cost model |
| Remaining average entry | 220 / 2 = 110 USD/unit | Same declared model |
| Net cash spent per remaining unit | (330 − 120) / 2 = 105 | Different cash-recovery statistic |
An asset-denominated fee can change another denominator
If a separate teaching convention deducts 0.01 units from the received opening quantity while retaining 330 USD as an allocated cost amount, the resulting quantity would be 2.99 and its ratio about 110.3679 USD per unit. This is another explicitly supplied convention, not a universal fee treatment.
Keep a fee’s asset and amount separate from cash proceeds. Whether an expense is included in a cost figure needs its own evidence. An unexplained quantity mismatch should not be repaired by changing a price until the average looks plausible.
Do not treat the remaining units as already realised
A partial exit supplies information about the exited portion under the model. The remaining quantity has no realised sale result merely because one exit price is available. Keep it open in the record unless separate evidence supports another event.
Preserve duplicate, amended or reversed source rows rather than assuming every exported line is a new fill. The calculation cannot authenticate an execution or resolve missing movement evidence. All quantities and prices in this case are invented.
Give each ratio its own label and assumptions
The final comparison can retain 110 as the model’s remaining entry average and 105 as a different cash-recovery ratio. A reader should be able to reproduce each from its own numerator and denominator without deciding that one must be an arithmetic error.
This guide does not calculate a tax result, recommend selling, establish a real cost basis or verify the linked offer’s trading record. It explains a distinction between two fictional bookkeeping questions and leaves the original market commentary page unchanged.
The optional link below leads to this site's separate crypto signals and Telegram updates offer. The record method is usable without that offer. It does not independently verify the offer, establish country eligibility or turn the teaching example into an actual transaction.
Primary sources and scope
- Python documentation: rational numbers
Exact rational arithmetic supports independent reproduction of the fictional numerical examples; it is not a venue, accounting rule or strategy validation. Checked 2026-10-21.