Moltline TaxLots

v1.2.0
com.moltlinestudio/taxlots Checked 2 days ago Published 2 months ago

Crypto cost-basis lots (FIFO/LIFO/HIFO/specific-ID), Form 8949 rows, 1099-DA diff.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

parse_transactions Parse Transactions

Normalise an exchange CSV export into the canonical ledger rows. FREE. Supports the Coinbase transaction-history export (Transaction Type / Asset / Quantity Transacted columns), the Kraken ledgers export (txid / refid / type / asset / amount / fee) and a generic CSV with the canonical columns ts, type, asset, qty, fiat_value, fee_qty, fee_asset, fee_fiat, counter_asset, counter_qty, account, id. Typical input {"csv_text": "...", "source_hint": "coinbase"} returns {"rows": [...], "detected": "coinbase", "unrecognised": [...], "warnings": [...]}. Rows it cannot read are returned under unrecogni…

ParameterTypeDescription
csv_text *stringthe CSV file contents (up to 2 MB).
accountstringaccount label to stamp on every row (defaults to the source name).
source_hintstringcoinbase, kraken or generic; empty to detect from the header.

ledger_lint Ledger Lint

Find the problems that break a lot build: missing values, duplicates, negative balances. FREE. Typical input {"ledger": <rows from parse_transactions>} returns {"issues": [{"severity": "error", "row": "cb12", "issue": "sell of 0.5 BTC exceeds balance 0.2 in account coinbase"}], "balances": {"coinbase": {"BTC": "0.2"}}, "counts": {...}}. Balances are running quantities per account and asset in time order, ignoring transfers' fiat values. Use after parse_transactions and before build_lots. Not a tax check: it checks the ledger's arithmetic consistency only. Errors: on invalid, missing, or malfo…

ParameterTypeDescription
ledger *arraycanonical rows (ts, type, asset, qty, fiat_value, fees, account...).

match_transfers Match Transfers

Pair withdrawals with the deposits that received them between your own accounts. FREE. Typical input {"ledger": <rows>, "window_minutes": 1440} returns {"pairs": [{"out": "kr91", "in": "cb14", "asset": "BTC", "from": "kraken", "to": "coinbase", "network_fee": "0.0001", "minutes": 42.0}], "unmatched": {"transfer_out": [...], "transfer_in": [...]}}. A pair needs the same asset, a different account, the deposit inside the window after the withdrawal, and a quantity within tolerance_pct of the amount sent net of the fee. Use before build_lots so basis and holding period move with the coins instea…

ParameterTypeDescription
ledger *arraycanonical rows.
tolerance_pctnumberallowed quantity difference in percent after the fee (default 1).
window_minutesintegerhow long after the withdrawal the deposit may land (default one day).

build_lots Build Lots

Build the lot inventory per account and every disposal with basis, gain and holding period. PREMIUM (license). Methods: fifo (the default rule when no specific identification is made, Treas. Reg. 1.1012-1(j)), lifo, hifo, or specific_id via a row's specific_lots {lot_id: qty}. Typical input {"ledger": <rows>, "method": "hifo", "transfers": <pairs from match_transfers>} returns {"disposals": [{"row": "cb9", "asset": "BTC", "qty": "0.5", "proceeds": "31000.00", "basis": "20000.00", "gain": "11000.00", "term": "long", ...}], "open_lots": [...], "summary": {"short_term": {...}, "long_term": {...}…

ParameterTypeDescription
ledger *arraycanonical rows.
methodstringfifo, lifo, hifo or specific_id (rows without specific_lots fall back to fifo).
on_missing_lotsstringerror (default), or zero_basis for lenient mode - disposals beyond the lots held get zero basis and unmatched transfer_out rows simply leave the inventory, each flagged.
tax_yearintegerwhen set, only disposals in that calendar year are returned (the inventory still runs from the start).
transfer_fee_policystringdispose (default) or ignore for network fees paid in the transferred asset.
transfersarraypairs from match_transfers ({"out": id, "in": id, ...}); empty to auto-match with the defaults.

form_8949_rows Form 8949 Rows

Lay the disposals out as Form 8949 rows with box categories and totals. PREMIUM (license). Typical input {"disposals": <from build_lots>, "tax_year": 2026, "default_reporting": "proceeds_only"} returns {"part_i": {"B": [rows]}, "part_ii": {"E": [rows]}, "totals": {...}}. Columns follow the form: description (a), date acquired (b), date sold (c), proceeds (d), cost or other basis (e), code (f), adjustment (g), gain or loss (h). Box: A/D when the broker reported proceeds and basis, B/E when proceeds only, C/F when no broker form - set per row in reporting {row_id: value} or for all rows with de…

ParameterTypeDescription
disposals *arrayrows from build_lots.
tax_year *integerthe calendar year of the disposals to include.
default_reportingstringproceeds_and_basis, proceeds_only or none (default).
reportingobjectper-row override: proceeds_and_basis, proceeds_only or none.
whole_dollarsbooleanround each row to whole dollars as the form permits.

reconcile_1099da Reconcile 1099Da

Diff the broker's 1099-DA lines against the computed disposals. PREMIUM (license). Typical input {"disposals": <from build_lots>, "form_rows": [{"asset": "BTC", "date_sold": "2026-03-04", "qty": "0.5", "proceeds": "31000", "basis": "", "account": "coinbase"}]} returns {"matched": [...], "broker_missing_basis": [...], "basis_mismatch": [...], "proceeds_mismatch": [...], "unmatched_form_rows": [...], "unmatched_disposals": [...]}. A line matches a disposal on the same account (when given), asset and sale date with quantity and proceeds inside the tolerances; several lots sold in one order are s…

ParameterTypeDescription
disposals *arrayrows from build_lots.
form_rows *array1099-DA lines: asset, date_sold, qty, proceeds, basis (may be blank), account (optional), id (optional).
money_tolerancenumberallowed proceeds/basis difference in fiat units (default 1.00).
qty_tolerance_pctnumberallowed quantity difference in percent (default 0.5).

wash_window_check Wash Window Check

Flag loss disposals with a repurchase of the same asset inside the window. FREE. Typical input {"disposals": <from build_lots>, "acquisitions": [{"asset": "ETH", "ts": "2026-02-10T10:00:00Z", "qty": "2"}]} returns {"flags": [{"row": "cb7", "asset": "ETH", "loss": "-410.00", "repurchases": [...]}], "rule_status": "..."}. The 30-day window before and after the sale is the one IRC 1091 uses for stock or securities; as checked on the verification date that statute had not been extended to digital assets that are not securities, so the output is a heads-up for planning, not an adjustment. Use when…

ParameterTypeDescription
acquisitions *arraypurchases/income rows with asset, ts, qty (ledger rows work as-is).
disposals *arrayrows from build_lots (uses asset, disposed_at, gain, row).
window_daysintegerdays before and after the loss disposal to scan (default 30).

lp_position_math Lp Position Math

Impermanent loss, hold-vs-pool value and basis split for a two-asset constant-product pool. FREE. Typical input {"deposit": {"asset_a": "ETH", "qty_a": "1", "price_a": "2000", "asset_b": "USDC", "qty_b": "2000", "price_b": "1"}, "current_prices": {"ETH": "3000", "USDC": "1"}} returns {"il_pct": "-2.02", "hold_value": "5000.00", "pool_value": "4898.98", "deposit_value": "4000.00", "basis_split": {...}}. The pool value assumes x*y=k with no fees; add fees_earned_fiat to see the net. The basis split is the deposit's fiat value at deposit, allocated by each side's share, which is the arithmetic a…

ParameterTypeDescription
current_prices *object{asset: price} for both assets now.
deposit *objectasset_a, qty_a, price_a, asset_b, qty_b, price_b at the time of deposit.
fees_earned_fiatnumberfees accrued to the position, in fiat.