auradefi 0.1.1
PyPI GitHub

TaxLot

auradefi.accounting.report · source

One open lot in Plaid's tax_lots[] shape (SPEC §6.2, DECISIONS "Plaid TaxLot mapping").

institution_lot_id is the deterministic id from lot_id, so the same acquisition reports the same lot across runs and across backends.

quantity, cost_basis and current_value all describe what is LEFT of the lot: units remaining, the exact un-disposed part of the basis rounded once into Money, and those units at the mark. purchase_price is the exception. It is cost_total / quantity_original, a fact of the ACQUISITION that does not move as the lot is drawn down, so a half-consumed lot still reports the price it was bought at.

purchase_price and cost_basis are None together when the acquisition was unpriced; current_value is None when the asset has no mark. Only lots with units remaining are ever emitted.

Fields

institution_lot_idstr
original_purchase_datetimeint
quantityDecimal
purchase_priceMoney | None
cost_basisMoney | None
current_valueMoney | None
position_typestrdefault 'LONG'
flagstuple[str, ...]default ()

__init__

__init__(self, institution_lot_id: str, original_purchase_datetime: int, quantity: Decimal, purchase_price: Money | None, cost_basis: Money | None, current_value: Money | None, position_type: str = LONG, flags: tuple[str, ...] = ()) -> None

Parameters

institution_lot_idrequired, str

none

original_purchase_datetimerequired, int

none

quantityrequired, Decimal

none

purchase_pricerequired, Money | None

none

cost_basisrequired, Money | None

none

current_valuerequired, Money | None

none

position_typeoptional, str, default 'LONG'

none

flagsoptional, tuple[str, ...], default ()

none