Decide the booking method for cost-basis accounts (Assets:Lightning:Balance) #45
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Background
Libra holds sats at a fiat cost basis — e.g.
"200000 SATS {100.00 EUR}". Each acquisition creates a lot (a quantity of sats tagged with the EUR cost it was acquired at). When sats are later spent/reduced, Beancount has to decide which lots are drawn down. That decision is the booking method, set per-account as an optional quoted string on theopendirective:Today we write no booking method, so cost-basis accounts inherit the global
booking_methodoption, which defaults toSTRICT. This is an implicit accounting-policy choice we're currently making by omission. This issue is to make it deliberate.Verified against the Beancount source (
beancount/core/data.pyBookingenum;parser/grammar.yopt_booking).Why it matters
The chosen method changes the realized EUR cost of a spend, and therefore any realized-gain/loss reporting, whenever sats were acquired at different rates and the price has since moved. Across an exchange-rate swing the same spend can book a very different cost depending on the method. It has no effect on the current sats balance — only on which fiat lots get consumed.
It only affects accounts that hold commodities at cost (
{...}annotations). Pure-SATS or pure-fiat operational accounts are unaffected.Options (pros / cons)
STRICT(current default by omission)Requires the reduction to unambiguously identify a single lot; errors on ambiguity.
STRICT_WITH_SIZELike
STRICT, but if a lot matches the reduction size exactly, it's accepted.STRICTwhile keeping its discipline.STRICTand inherits the same friction.NONEDisables lot matching; allows mixed inventories (positions at different costs coexist without reduction logic).
{cost}at all. Realized cost/gain becomes meaningless. Only sensible if we decide we don't actually want lot-level cost tracking.AVERAGEMerges all matching lots into a single average-cost position before/after each reduction.
FIFO(first-in, first-out)Oldest lots consumed first.
LIFO(last-in, first-out)Newest lots consumed first.
HIFO(highest-in, first-out)Highest-cost lots consumed first.
Recommendation (for discussion)
For a collective's pooled Lightning balance, the realistic contenders are
AVERAGE(simplest mental model — one blended cost for the pool) orFIFO(real lot-level basis, broad jurisdictional acceptance).STRICT/STRICT_WITH_SIZEare likely too operationally strict for commingled sats;NONEthrows away cost tracking;LIFO/HIFOare tax-optimization plays with narrower acceptance.The choice should be driven by the reporting/tax jurisdiction(s) the deploying collectives operate under — worth confirming that before locking it in.
Scope of the change
opendirectives (at minimumAssets:Lightning:Balance; review whether any other{cost}-bearing accounts need it).opendirective or globally via thebooking_methodoption (per-account is more explicit and self-documenting).Follow-up from the add-account UI work (PR
feat/add-account-ui).