DecCF./ˈdɛk.ɛf/

Swedish investment accounts

Declare a person's Swedish investment savings account (ISK) and ordinary securities account (VP) with DECCF's core accounts and balanced cashflows. The pack publishes monthly SEK facts for a separate tax calculation to consume. It does not calculate Swedish tax or import the Swedish income-tax pack.

Use it in a model

The factory returns the component plus references for each account, posting flow, and monthly taxFacts calculation. Read the facts directly or pass them to a caller-owned adapter. Each fact record has accountId, accountType, period, currency, opening and closing cash and securities at book value, external deposits and withdrawals, realized gains and losses, dividends, interest, fees, and an optional-value pair (observedAccountValueAvailable and observedAccountValue).

Event and ledger contract

Events are declared for a valid YYYY-MM inside the fixed monthly timeline. All amounts must be non-negative SEK numbers, SEK Money, inputs, calculations, or expressions. Account IDs and event IDs are stable lowercase identifiers; event IDs are unique within an account. The owner must be the owner of the existing bank asset account.

EventDeclarationLedger effect
Deposit{ type: "deposit", amount }Debit brokerage cash, credit the household bank account.
Withdrawal{ type: "withdrawal", amount }Debit the household bank account, credit brokerage cash.
Purchase{ type: "purchase", amount }Debit securities at cost, credit brokerage cash.
Sale{ type: "sale", proceeds, costBasis }Debit cash for proceeds, credit securities for cost basis, and book the difference as a realized gain or loss.
Dividend{ type: "dividend", amount }Debit brokerage cash, credit dividend income.
Interest{ type: "interest", amount }Debit brokerage cash, credit interest income.
Fee{ type: "fee", amount }Debit fee expense, credit brokerage cash.
Valuation{ type: "valuation", value }Publish an observation without changing cost-basis assets or income.

Sales explicitly provide cost basis so the account activity remains auditable; the pack does not select securities or infer basis. External deposits and withdrawals are separate from purchases, sales, dividends and fees. The facts are accounting inputs, not a tax assessment: the selected account type does not apply an annual tax rate, tax-year threshold, or assumed yield.