How does Run Cost basis work

Created by Sanjayan Arulsakaran, Modified on Thu, 18 May, 2023 at 11:03 AM by Sanjayan Arulsakaran

Description

The Cost Basis calculation in softledger automatically calculates the realized gain / loss amounts for transactions along with prepare the cost layers for subsequent transactions. The Logic for how cost basis knows what date to run from is provided below


How


SoftLedger stores a timestamp of the next time we plan to run costbasis "nextCostBasisDate". 


It can be viewed in the UI by hovering over the run costbasis icon:


This date will get updated in the following situations

  1. If you run costbasis, to the date of the most recent transaction it finishes calculating for (whether it stops from cancellation, error, or completing).
  2. If you delete a transaction, the date will be updated to the oldest of [date of the deleted transaction, or currently set "nextCostBasisDate"]
  3. If you create a transaction, the date will be updated to the oldest of [date of the created transaction, or currently set "nextCostBasisDate"]
  4. If you edit a transaction, and update a field that could impact costbasis(type/price/quantity/coin/wallet/date/currency), the date will be updated to the oldest of [date of the updated transaction, or currently set "nextCostBasisDate"]





Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article