Cost basis for ToSelf txns is allocating instead of assigning #8

Closed
opened 2025-07-08 08:35:26 -04:00 by AtHeartEngineer · 0 comments

Originally created by @scoobybejesus on 11/18/2019

In a toSelf transaction, for n number of outgoing movements, there will be a corresponding n number of incoming movements. Though there will usually be a smaller quantity of cryptocurrency units incoming due to the network fee, the cost basis will remain the same.

The behavior is currently that the cost basis for the outgoing movements is summed, and then it is allocated to the incoming movements according to (quantity of incoming movement) / (quantity of incoming action_record) * cost basis sum of the outgoing action_record.

That's wrong. There should be no calculation.

The cost basis of the outgoing movement should be directly assigned as the cost basis of the corresponding incoming movement. Since lot order is already preserved when creating new lots for the incoming ToSelf action_record, this should be trivial.

*Originally created by @scoobybejesus on 11/18/2019* In a toSelf transaction, for `n` number of outgoing `movement`s, there will be a corresponding `n` number of incoming `movement`s. Though there will usually be a smaller quantity of cryptocurrency units incoming due to the network fee, the cost basis will remain the same. The behavior is currently that the cost basis for the outgoing movements is summed, and then it is allocated to the incoming `movement`s according to (quantity of incoming `movement`) / (quantity of incoming `action_record`) * cost basis sum of the outgoing `action_record`. That's wrong. There should be no calculation. The cost basis of the outgoing `movement` should be directly assigned as the cost basis of the corresponding incoming `movement`. Since `lot` order is already preserved when creating new `lot`s for the incoming ToSelf `action_record`, this should be trivial.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/cryptools#8