Skip to main content

Event, Posting & Valuation

Planned

The CUE and PostgreSQL contracts for this stage exist and validate. The domain runtime that produces these records does not yet exist.

Responsibility boundary

An Observation records what a source or chain execution showed. It does not by itself say that a transfer was income, that two legs form a swap, or that an exchange withdrawal and wallet receipt are the same self-transfer.

The planned flow preserves those decisions as versioned records:

Observation → InterpretationHypothesis → InterpretationDecision
→ InterpretedEvent revision → FlowLeg · AssetPosting · FlowRelation
→ Valuation
  • AssetPosting records which owned account and asset increased or decreased.
  • FlowRelation records why two legs are linked, including confirmed continuity.
  • Valuation records a monetary measurement and the exact evidence and policy used.

These roles stay separate so that a changed interpretation does not rewrite source facts.

MVP behavior

Input scenarioRequired outputMust not happen
CEX trade fillDisposed asset, acquired asset, consideration, and separately evidenced fee PostingsCollapsing trade and fee into one unexplained delta
CEX withdrawal plus owned-wallet receiptA SELF_TRANSFER Event and CONFIRMED CONTINUITY only when ownership, asset, amount, and timing evidence support the joinTreating the withdrawal as a disposal or the receipt as new income
EVM swap plus gasSeparate swap legs and gas Posting with traceable chain coordinatesHiding gas in the acquired quantity or assigning a guessed protocol meaning
External inbound transferReview material until income, gift, transfer, or other economic grounds existAutomatically classifying every inbound transfer as income
Balance delta or account-state snapshotReconciliation evidenceCreating a Posting without a source movement or accepted Event
Unsupported DeFi interactionUNSUPPORTED or review-required terminal state with native evidence retainedProducing a confident Event from an unknown protocol pattern

Fail-closed interpretation

Insufficient evidence remains visible

When ownership, coordinates, asset identity, amount, or relation grounds are inadequate, the system does not auto-confirm the interpretation. It records the hypothesis and terminal decision, then leaves the item unresolved or review-required.

For example, a confirmed exchange withdrawal and confirmed wallet receipt plus an applicable OwnershipAssertion can support self-transfer continuity. If the destination is not confirmed, the OUT Posting remains, the destination leg is MISSING, and no arrival Posting or basis carry is created. Later evidence creates a new revision rather than deleting the earlier result.

Valuation rules

KRW FAIR_VALUE requires a PRICE selection and, when needed, an FX selection. Each selection pins the source artifacts, comparison policy, and tolerance.

  • Missing required evidence keeps the valuation incomplete.
  • A source conflict outside tolerance requires an explicit resolution.
  • Fallback use records both the reason and the fallback evidence.
  • assetQuantity × PRICE × FX is evaluated as an exact integer ratio.
  • Rounding occurs once, at the final KRW smallest unit.
  • COST_BASIS follows the original KRW acquisition evidence and never fabricates a market price that was not used.

Build boundary

ComponentCurrent state
CUE types and invariantsImplemented
Ledger and valuation persistence clientsImplemented
Hypothesis generation and decision runtimePlanned
Event revision and Posting projection runtimePlanned
Price/FX collection and valuation runtimePlanned
Golden fixtures for the six MVP cases abovePlanned

Tax inventory and report generation depend on accepted Postings and Valuations. See Tax Inventory & Report.