From e790b64799b1d0488d649d0757d9696cbf222fe1 Mon Sep 17 00:00:00 2001 From: Yichao Zhou Date: Sat, 15 Jul 2023 15:35:10 -0400 Subject: [PATCH] Add ofx support for treasury T-Bill (#187) --- beancount_import/source/ofx.py | 81 ++++++++-- beancount_import/source/ofx_test.py | 1 + .../test_ofx_basic/0/pending.beancount | 2 +- .../test_ofx_cleared/0/pending.beancount | 2 +- .../0/pending.beancount | 2 +- .../test_ofx_ignore_price/0/pending.beancount | 2 + .../test_ofx_matching/0/candidates.diff | 3 + .../test_ofx_matching/0/pending.beancount | 4 + testdata/source/ofx/fidelity_treasury.ofx | 146 ++++++++++++++++++ .../ofx/test_fidelity_treasury/accounts.txt | 3 + .../import_results.beancount | 59 +++++++ .../test_fidelity_treasury/journal.beancount | 6 + .../training_examples.json | 1 + .../import_results.beancount | 28 ++-- .../import_results.beancount | 2 +- .../import_results.beancount | 2 +- .../import_results.beancount | 2 +- 17 files changed, 309 insertions(+), 37 deletions(-) create mode 100644 testdata/source/ofx/fidelity_treasury.ofx create mode 100644 testdata/source/ofx/test_fidelity_treasury/accounts.txt create mode 100644 testdata/source/ofx/test_fidelity_treasury/import_results.beancount create mode 100644 testdata/source/ofx/test_fidelity_treasury/journal.beancount create mode 100644 testdata/source/ofx/test_fidelity_treasury/training_examples.json diff --git a/beancount_import/source/ofx.py b/beancount_import/source/ofx.py index 360cf646..4ec15a95 100644 --- a/beancount_import/source/ofx.py +++ b/beancount_import/source/ofx.py @@ -484,6 +484,7 @@ def parse_ofx_time(date_str): ('units', Optional[Decimal]), ('unitprice', Optional[Decimal]), ('inv401ksource', Optional[str]), + ('tolerance', Optional[Decimal]), ]) RawCashBalanceEntry = NamedTuple('RawCashBalanceEntry', [ @@ -566,8 +567,9 @@ def get_info( # nor the target account, and should be ignored while building training # examples. AUX_CAPITAL_GAINS_KEY = 'capital_gains' +AUX_INTEREST_KEY = 'interest_income' AUX_FEE_KEYS = ['fees', 'commission'] -AUX_ACCOUNT_KEYS = [AUX_CAPITAL_GAINS_KEY] + AUX_FEE_KEYS +AUX_ACCOUNT_KEYS = [AUX_CAPITAL_GAINS_KEY, AUX_INTEREST_KEY] + AUX_FEE_KEYS def get_aux_account_by_key(account: Open, key: str, results: SourceResults) -> str: """Like get_account_by_key. Ensures the account isn't used for training.""" @@ -619,14 +621,18 @@ def get_securities(soup: bs4.BeautifulSoup) -> List[SecurityInfo]: STOCK_BUY_SELL_TYPES = set( - ['BUYMF', 'SELLMF', 'SELLSTOCK', 'BUYSTOCK', 'REINVEST']) -SELL_TYPES = set(['SELLMF', 'SELLSTOCK']) + ['BUYMF', 'SELLMF', 'SELLSTOCK', 'BUYSTOCK', 'REINVEST', 'BUYDEBT', + 'SELLDEBT', 'SELLOTHER']) +SELL_TYPES = set(['SELLMF', 'SELLSTOCK', 'SELLDEBT', 'SELLOTHER']) OPT_TYPES = set(['BUYOPT', 'SELLOPT']) RELATED_ACCOUNT_KEYS = ['aftertax_account', 'pretax_account', 'match_account'] # Tolerance allowed in transaction balancing. In units of base currency used, e.g. USD. TOLERANCE = 0.05 +UNITPRICE_ERROR_LOWER_BOUND = 0.2 +UNITPRICE_ERROR_UPPER_BOUND = 5.0 + class ParsedOfxStatement(object): def __init__(self, seen_fitids, filename, securities_map, org, stmtrs): @@ -655,7 +661,7 @@ def __init__(self, seen_fitids, filename, securities_map, org, stmtrs): for invtranlist in stmtrs.find_all(re.compile('invtranlist|banktranlist')): for tran in invtranlist.find_all( re.compile( - '^(buymf|sellmf|reinvest|buystock|sellstock|buyopt|sellopt|transfer|income|invbanktran|stmttrn)$' + '^(buymf|sellmf|reinvest|buystock|sellstock|buyopt|sellopt|buydebt|selldebt|sellother|transfer|income|invbanktran|stmttrn)$' )): fitid = find_child(tran, 'fitid') date = parse_ofx_time( @@ -679,6 +685,17 @@ def __init__(self, seen_fitids, filename, securities_map, org, stmtrs): total = find_child(tran, 'trnamt', D) else: total = find_child(tran, 'total', D) + units = find_child(tran, 'units', D) + unitprice = find_child(tran, 'unitprice', D) + if units and total and unitprice: + error_ratio = abs(units * unitprice / total) + if error_ratio > UNITPRICE_ERROR_UPPER_BOUND or error_ratio < UNITPRICE_ERROR_LOWER_BOUND: + id_type = find_child(tran, 'uniqueidtype') + unique_id = find_child(tran, 'uniqueid') + units_x_unitprice = units*unitprice + unitprice = abs(total / units) + print( + f"Transaction [{id_type} {unique_id}]: Mismatch between UNITS * UNITPRICE = {units_x_unitprice:.2f} and TOTAL = {total:.2f}. Inferring price: {unitprice:.3f}") opttrantype = None shares_per_contract = find_child(tran, 'shperctrct', D) @@ -698,8 +715,8 @@ def __init__(self, seen_fitids, filename, securities_map, org, stmtrs): name=find_child(tran, 'name'), trntype=find_child(tran, 'trntype'), uniqueid=uniqueid, - units=find_child(tran, 'units', D), - unitprice=find_child(tran, 'unitprice', D), + units=units, + unitprice=unitprice, tferaction=find_child(tran, 'tferaction'), fees=find_child(tran, 'fees', D), commission=find_child(tran, 'commission', D), @@ -725,27 +742,46 @@ def __init__(self, seen_fitids, filename, securities_map, org, stmtrs): for bal in stmtrs.find_all('ledgerbal'): bal_amount_str = find_child(bal, 'balamt') - if not bal_amount_str.strip(): continue + if not bal_amount_str.strip(): + continue bal_amount = D(bal_amount_str) date = find_child(bal, 'dtasof', parse_ofx_time).date() raw_cash_balance_entries.append( RawCashBalanceEntry( date=date, number=bal_amount, filename=filename)) - for invposlist in stmtrs.find_all('invposlist'): for invpos in invposlist.find_all('invpos'): time_str = find_child(invpos, 'dtpriceasof') + units = find_child(invpos, 'units', D) + unitprice = find_child(invpos, 'unitprice', D) + mktval = find_child(invpos, 'mktval', D) + tolerance = None + if mktval and mktval > 0: + error_ratio = units*unitprice/mktval + # these thresholds are arbitrary and could be tightened + if error_ratio > UNITPRICE_ERROR_UPPER_BOUND or error_ratio < UNITPRICE_ERROR_LOWER_BOUND: + id_type = find_child(invpos, 'uniqueidtype') + unique_id = find_child(invpos, 'uniqueid') + units_x_unitprice = units*unitprice + unitprice = mktval / units if units > 0 else None + print( + f"Balance [{id_type} {unique_id}]: Mismatch between UNITS * UNITPRICE = {units_x_unitprice:.2f} and MKTVAL = {mktval:.2f}. Inferring price: {unitprice:.3f}") + if self.org == "Vanguard": + # For Vanguard balance, tolerance needs to be set. See + # https://beancount.github.io/docs/precision_tolerances.html#explicit-tolerances-on-balance-assertions + tolerance = round(abs(units) * Decimal(0.001)) t = parse_ofx_time(time_str) date = t.date() raw_balance_entries.append( RawBalanceEntry( date=date, uniqueid=find_child(invpos, 'uniqueid'), - units=find_child(invpos, 'units', D), - unitprice=find_child(invpos, 'unitprice', D), + units=units, + unitprice=unitprice, inv401ksource=find_child(invpos, 'inv401ksource'), - filename=filename)) + filename=filename, + tolerance=tolerance)) def get_entries(self, prepare_state): account = prepare_state.ofx_id_to_account.get(self.ofx_id) @@ -797,6 +833,10 @@ def get_security(unique_id: str) -> Optional[str]: return None sec = securities_map[unique_id] ticker = sec.ticker + # Treasury bill and bond start with 912 + if ticker.startswith("912"): + # Prepend "T" to make it a valid ticker + ticker = "T" + ticker if ticker is None: results.add_error( 'Missing ticker for security %r. You must specify it manually using a commodity directive with a cusip metadata field.' @@ -1027,7 +1067,7 @@ def get_subaccount_cash(inv401ksource: Optional[str] = None) -> str: else: number_per_fix = unitprice if abs(total + fee_total + (units * unitprice)) >= TOLERANCE: - number_per_fix = normalize_fraction((abs(total)-abs(fee_total))/units) + number_per_fix = normalize_fraction((abs(total)-abs(fee_total))/units) cost_spec = CostSpec( number_per=number_per_fix, number_total=None, @@ -1053,13 +1093,19 @@ def get_subaccount_cash(inv401ksource: Optional[str] = None) -> str: )) if is_closing_txn: + if security.startswith("T9127") or "-9127" in security: + # Treasury bill: add interest posting. + account_name = AUX_INTEREST_KEY + "_account" + else: + # Others: add capital gains posting. + account_name = AUX_CAPITAL_GAINS_KEY + "_account" # Add capital gains posting. entry.postings.append( Posting( meta=None, account=get_aux_account_by_key( account, - AUX_CAPITAL_GAINS_KEY + '_account', + account_name, results) + ':' + security, units=MISSING, cost=None, @@ -1181,6 +1227,7 @@ def get_subaccount_cash(inv401ksource: Optional[str] = None) -> str: security = get_security(raw.uniqueid) if security is None: continue + units = raw.units associated_currency = cash_securities_map.get(security) if associated_currency is not None: if raw.date not in cash_activity_dates: @@ -1189,9 +1236,9 @@ def get_subaccount_cash(inv401ksource: Optional[str] = None) -> str: meta=None, account=get_subaccount_cash(raw.inv401ksource), amount=Amount( - number=round(raw.units + self.availcash, 2), + number=round(units + self.availcash, 2), currency=associated_currency), - tolerance=None, + tolerance=raw.tolerance, diff_amount=None, ) results.add_pending_entry( @@ -1206,8 +1253,8 @@ def get_subaccount_cash(inv401ksource: Optional[str] = None) -> str: date=raw.date, meta=None, account=security_account_name, - amount=Amount(number=raw.units, currency=security), - tolerance=None, + amount=Amount(number=units, currency=security), + tolerance=raw.tolerance, diff_amount=None, ) results.add_pending_entry( diff --git a/beancount_import/source/ofx_test.py b/beancount_import/source/ofx_test.py index 59042b48..1fa12a8f 100644 --- a/beancount_import/source/ofx_test.py +++ b/beancount_import/source/ofx_test.py @@ -22,6 +22,7 @@ ('test_vanguard_401k_matching', 'vanguard401k.ofx'), ('test_vanguard_xfer_in', 'vanguard_xfer_in.ofx'), ('test_fidelity_savings', 'fidelity-savings.ofx'), + ('test_fidelity_treasury', 'fidelity_treasury.ofx'), ('test_suncorp', 'suncorp.ofx'), ('test_checking', 'checking.ofx'), ('test_checking_emptyledgerbal', 'checking-emptyledgerbal.ofx'), diff --git a/testdata/reconcile/test_ofx_basic/0/pending.beancount b/testdata/reconcile/test_ofx_basic/0/pending.beancount index f18e7346..47afd86f 100644 --- a/testdata/reconcile/test_ofx_basic/0/pending.beancount +++ b/testdata/reconcile/test_ofx_basic/0/pending.beancount @@ -15,4 +15,4 @@ 2018-07-03 balance Assets:Retirement:Vanguard:Roth-IRA:TYCDT 46.872 TYCDT -2018-07-03 price TYCDT 84.20 USD +2018-07-03 price TYCDT 1.554232804232804232804232804 USD diff --git a/testdata/reconcile/test_ofx_cleared/0/pending.beancount b/testdata/reconcile/test_ofx_cleared/0/pending.beancount index f18e7346..47afd86f 100644 --- a/testdata/reconcile/test_ofx_cleared/0/pending.beancount +++ b/testdata/reconcile/test_ofx_cleared/0/pending.beancount @@ -15,4 +15,4 @@ 2018-07-03 balance Assets:Retirement:Vanguard:Roth-IRA:TYCDT 46.872 TYCDT -2018-07-03 price TYCDT 84.20 USD +2018-07-03 price TYCDT 1.554232804232804232804232804 USD diff --git a/testdata/reconcile/test_ofx_ignore_balance/0/pending.beancount b/testdata/reconcile/test_ofx_ignore_balance/0/pending.beancount index cabcf9b9..bacb9fb2 100644 --- a/testdata/reconcile/test_ofx_ignore_balance/0/pending.beancount +++ b/testdata/reconcile/test_ofx_ignore_balance/0/pending.beancount @@ -13,4 +13,4 @@ ;; date: 2018-07-03 ;; info: null -2018-07-03 price TYCDT 84.20 USD +2018-07-03 price TYCDT 1.554232804232804232804232804 USD diff --git a/testdata/reconcile/test_ofx_ignore_price/0/pending.beancount b/testdata/reconcile/test_ofx_ignore_price/0/pending.beancount index 00ddf44d..47afd86f 100644 --- a/testdata/reconcile/test_ofx_ignore_price/0/pending.beancount +++ b/testdata/reconcile/test_ofx_ignore_price/0/pending.beancount @@ -14,3 +14,5 @@ ;; info: null 2018-07-03 balance Assets:Retirement:Vanguard:Roth-IRA:TYCDT 46.872 TYCDT + +2018-07-03 price TYCDT 1.554232804232804232804232804 USD diff --git a/testdata/reconcile/test_ofx_matching/0/candidates.diff b/testdata/reconcile/test_ofx_matching/0/candidates.diff index e69de29b..0b87e80f 100644 --- a/testdata/reconcile/test_ofx_matching/0/candidates.diff +++ b/testdata/reconcile/test_ofx_matching/0/candidates.diff @@ -0,0 +1,3 @@ +/journal.beancount ++ ++2018-07-03 price TYCDT 1.554232804232804232804232804 USD diff --git a/testdata/reconcile/test_ofx_matching/0/pending.beancount b/testdata/reconcile/test_ofx_matching/0/pending.beancount index 8b137891..32fe9d80 100644 --- a/testdata/reconcile/test_ofx_matching/0/pending.beancount +++ b/testdata/reconcile/test_ofx_matching/0/pending.beancount @@ -1 +1,5 @@ +;; source: ofx +;; date: 2018-07-03 +;; info: null +2018-07-03 price TYCDT 1.554232804232804232804232804 USD diff --git a/testdata/source/ofx/fidelity_treasury.ofx b/testdata/source/ofx/fidelity_treasury.ofx new file mode 100644 index 00000000..200bf76b --- /dev/null +++ b/testdata/source/ofx/fidelity_treasury.ofx @@ -0,0 +1,146 @@ + + + + + + + 0 + INFO + SUCCESS + + 20230101011111.111[-5:EST] + ENG + + fidelity.com + 7776 + + + + + + + 0 + INFO + SUCCESS + + + 20230121000000.000[-5:EST] + USD + + fidelity.com + X0000001 + + + + + + Z0000000000000000000009 + 20230119000000.000[-5:EST] + YOU BOUGHT + + + 912796Z77 + CUSIP + + +0000000096000.00000 + 000000099.296889000 + +00000000000000.0000 + +00000000000000.0000 + -95325.01 + + 1.00 + USD + + CASH + CASH + + +00000000000000.0000 + + + + DEP + 20221123000000.000[-5:EST] + +00000000001111.0000 + Z0000000000000000000003 + ELECTRONIC FUNDS TRANSFER RCVD + ELECTRONIC FUNDS TRANSFER RCVD + + 1.00 + USD + + + CASH + + + + + Z0464551608101420230321 + 20230321000000.000[-4:EDT] + REDEMPTION PAYOUT + + + 912796Z77 + CUSIP + + -0000000096000.00000 + 000000100.000000000 + +00000000000000.0000 + +00000000000000.0000 + +00000000096000.0000 + + 1.00 + USD + + CASH + CASH + + + + + + + + 912796Z77 + CUSIP + + CASH + LONG + 96000.00000 + 99.2920000 + +00000095320.32 + 20230121000000.000[-5:EST] + + 1.0 + USD + + + + + + + + + + + + + 912796Z77 + CUSIP + + 912796Z77 UNITED STATES TREAS BILLS ZERO CPN 0.00000% 03/21/2023 + 912796Z77 + 99.2920000 + 20230121033012.000[-5:EST] + + 1.000 + USD + + + 1000.00 + COUPON + TREASURY + 0000.00000 + + + + diff --git a/testdata/source/ofx/test_fidelity_treasury/accounts.txt b/testdata/source/ofx/test_fidelity_treasury/accounts.txt new file mode 100644 index 00000000..54ceb90f --- /dev/null +++ b/testdata/source/ofx/test_fidelity_treasury/accounts.txt @@ -0,0 +1,3 @@ +Assets:Savings:Fidelity +Assets:Savings:Fidelity:Cash +Assets:Savings:Fidelity:T912796Z77 diff --git a/testdata/source/ofx/test_fidelity_treasury/import_results.beancount b/testdata/source/ofx/test_fidelity_treasury/import_results.beancount new file mode 100644 index 00000000..e14b3c33 --- /dev/null +++ b/testdata/source/ofx/test_fidelity_treasury/import_results.beancount @@ -0,0 +1,59 @@ +;; date: 2022-11-23 +;; info: {"filename": "/fidelity_treasury.ofx", "type": "application/x-ofx"} + +; features: [ +; { +; "amount": "1111.00 USD", +; "date": "2022-11-23", +; "key_value_pairs": { +; "desc": "ELECTRONIC FUNDS TRANSFER RCVD", +; "ofx_memo": "ELECTRONIC FUNDS TRANSFER RCVD", +; "ofx_type": "INVBANKTRAN" +; }, +; "source_account": "Assets:Savings:Fidelity:Cash" +; } +; ] +2022-11-23 * "INVBANKTRAN - ELECTRONIC FUNDS TRANSFER RCVD" + Assets:Savings:Fidelity:Cash 1111.00 USD + date: 2022-11-23 + ofx_fitid: "Z0000000000000000000003" + ofx_memo: "ELECTRONIC FUNDS TRANSFER RCVD" + ofx_type: "INVBANKTRAN" + Expenses:FIXME -1111.00 USD + +;; date: 2023-01-19 +;; info: {"filename": "/fidelity_treasury.ofx", "type": "application/x-ofx"} + +; features: [] +2023-01-19 * "BUYDEBT - YOU BOUGHT" + Assets:Savings:Fidelity:T912796Z77 96000 T912796Z77 {0.9929688541666666666666666667 USD} + date: 2023-01-19 + ofx_fitid: "Z0000000000000000000009" + ofx_memo: "YOU BOUGHT" + ofx_type: "BUYDEBT" + Assets:Savings:Fidelity:Cash -95325.01 USD + ofx_fitid: "Z0000000000000000000009" + +;; date: 2023-01-21 +;; info: {"filename": "/fidelity_treasury.ofx", "type": "application/x-ofx"} + +2023-01-21 balance Assets:Savings:Fidelity:T912796Z77 96000.00000 T912796Z77 + +;; date: 2023-01-21 +;; info: {"filename": "/fidelity_treasury.ofx", "type": "application/x-ofx"} + +2023-01-21 price T912796Z77 0.99292 USD + +;; date: 2023-03-21 +;; info: {"filename": "/fidelity_treasury.ofx", "type": "application/x-ofx"} + +; features: [] +2023-03-21 * "SELLOTHER - REDEMPTION PAYOUT" + Assets:Savings:Fidelity:T912796Z77 -96000 T912796Z77 {} @ 1 USD + date: 2023-03-21 + ofx_fitid: "Z0464551608101420230321" + ofx_memo: "REDEMPTION PAYOUT" + ofx_type: "SELLOTHER" + Income:Interest:Savings:Fidelity:T912796Z77 + Assets:Savings:Fidelity:Cash 96000.00 USD + ofx_fitid: "Z0464551608101420230321" diff --git a/testdata/source/ofx/test_fidelity_treasury/journal.beancount b/testdata/source/ofx/test_fidelity_treasury/journal.beancount new file mode 100644 index 00000000..e76e87a1 --- /dev/null +++ b/testdata/source/ofx/test_fidelity_treasury/journal.beancount @@ -0,0 +1,6 @@ +1900-01-01 open Assets:Savings:Fidelity + ofx_org: "fidelity.com" + ofx_broker_id: "fidelity.com" + account_id: "X0000001" + ofx_account_type: "securities_and_cash" + interest_income_account: "Income:Interest:Savings:Fidelity" diff --git a/testdata/source/ofx/test_fidelity_treasury/training_examples.json b/testdata/source/ofx/test_fidelity_treasury/training_examples.json new file mode 100644 index 00000000..0637a088 --- /dev/null +++ b/testdata/source/ofx/test_fidelity_treasury/training_examples.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/testdata/source/ofx/test_investment_buy_sell_income/import_results.beancount b/testdata/source/ofx/test_investment_buy_sell_income/import_results.beancount index 6efda888..9d042913 100644 --- a/testdata/source/ofx/test_investment_buy_sell_income/import_results.beancount +++ b/testdata/source/ofx/test_investment_buy_sell_income/import_results.beancount @@ -173,7 +173,7 @@ ;; date: 2018-08-04 ;; info: {"filename": "/investment_buy_sell_income.ofx", "type": "application/x-ofx"} -2018-08-04 price FCSNO 47.5020085 USD +2018-08-04 price FCSNO 0.9096295696637586707365384542 USD ;; date: 2018-08-04 ;; info: {"filename": "/investment_buy_sell_income.ofx", "type": "application/x-ofx"} @@ -183,7 +183,7 @@ ;; date: 2018-08-04 ;; info: {"filename": "/investment_buy_sell_income.ofx", "type": "application/x-ofx"} -2018-08-04 price DSNTH 45.6437641 USD +2018-08-04 price DSNTH 0.9355978515414792829046193951 USD ;; date: 2018-08-04 ;; info: {"filename": "/investment_buy_sell_income.ofx", "type": "application/x-ofx"} @@ -193,7 +193,7 @@ ;; date: 2018-08-04 ;; info: {"filename": "/investment_buy_sell_income.ofx", "type": "application/x-ofx"} -2018-08-04 price MCYFM 43.6188596 USD +2018-08-04 price MCYFM 1.433211947229007178415011552 USD ;; date: 2018-08-04 ;; info: {"filename": "/investment_buy_sell_income.ofx", "type": "application/x-ofx"} @@ -203,7 +203,7 @@ ;; date: 2018-08-04 ;; info: {"filename": "/investment_buy_sell_income.ofx", "type": "application/x-ofx"} -2018-08-04 price URMFO 19.9728700 USD +2018-08-04 price URMFO 0.4551200219710029279760823805 USD ;; date: 2018-08-04 ;; info: {"filename": "/investment_buy_sell_income.ofx", "type": "application/x-ofx"} @@ -213,7 +213,7 @@ ;; date: 2018-08-04 ;; info: {"filename": "/investment_buy_sell_income.ofx", "type": "application/x-ofx"} -2018-08-04 price DGTGU 25.3577699 USD +2018-08-04 price DGTGU 0.7518815041951127002058296873 USD ;; date: 2018-08-04 ;; info: {"filename": "/investment_buy_sell_income.ofx", "type": "application/x-ofx"} @@ -223,7 +223,7 @@ ;; date: 2018-08-04 ;; info: {"filename": "/investment_buy_sell_income.ofx", "type": "application/x-ofx"} -2018-08-04 price MXMUK 81.7052756 USD +2018-08-04 price MXMUK 0.8247564557666200903791577938 USD ;; date: 2018-08-04 ;; info: {"filename": "/investment_buy_sell_income.ofx", "type": "application/x-ofx"} @@ -233,7 +233,7 @@ ;; date: 2018-08-04 ;; info: {"filename": "/investment_buy_sell_income.ofx", "type": "application/x-ofx"} -2018-08-04 price XBFMS 97.2183155 USD +2018-08-04 price XBFMS 1.172175503071948878775077293 USD ;; date: 2018-08-04 ;; info: {"filename": "/investment_buy_sell_income.ofx", "type": "application/x-ofx"} @@ -243,7 +243,7 @@ ;; date: 2018-08-04 ;; info: {"filename": "/investment_buy_sell_income.ofx", "type": "application/x-ofx"} -2018-08-04 price OMCNS 93.7687778 USD +2018-08-04 price OMCNS 1.026535152297954102146195540 USD ;; date: 2018-08-04 ;; info: {"filename": "/investment_buy_sell_income.ofx", "type": "application/x-ofx"} @@ -253,7 +253,7 @@ ;; date: 2018-08-04 ;; info: {"filename": "/investment_buy_sell_income.ofx", "type": "application/x-ofx"} -2018-08-04 price RDTAF 80.9348507 USD +2018-08-04 price RDTAF 0.7630804932322338789445969589 USD ;; date: 2018-08-04 ;; info: {"filename": "/investment_buy_sell_income.ofx", "type": "application/x-ofx"} @@ -263,7 +263,7 @@ ;; date: 2018-08-04 ;; info: {"filename": "/investment_buy_sell_income.ofx", "type": "application/x-ofx"} -2018-08-04 price IQVJK 27.7635148 USD +2018-08-04 price IQVJK 1.714967820408059013623574335 USD ;; date: 2018-08-04 ;; info: {"filename": "/investment_buy_sell_income.ofx", "type": "application/x-ofx"} @@ -273,7 +273,7 @@ ;; date: 2018-08-04 ;; info: {"filename": "/investment_buy_sell_income.ofx", "type": "application/x-ofx"} -2018-08-04 price SDVMV 62.3900924 USD +2018-08-04 price SDVMV 2.701922663604487647914913999 USD ;; date: 2018-08-04 ;; info: {"filename": "/investment_buy_sell_income.ofx", "type": "application/x-ofx"} @@ -283,7 +283,7 @@ ;; date: 2018-08-04 ;; info: {"filename": "/investment_buy_sell_income.ofx", "type": "application/x-ofx"} -2018-08-04 price SVDIE 85.7179472 USD +2018-08-04 price SVDIE 0.6290928685066971211291035958 USD ;; date: 2018-08-04 ;; info: {"filename": "/investment_buy_sell_income.ofx", "type": "application/x-ofx"} @@ -293,7 +293,7 @@ ;; date: 2018-08-04 ;; info: {"filename": "/investment_buy_sell_income.ofx", "type": "application/x-ofx"} -2018-08-04 price WDUZQ 52.1515218 USD +2018-08-04 price WDUZQ 1.572680550648546949931623568 USD ;; date: 2018-08-04 ;; info: {"filename": "/investment_buy_sell_income.ofx", "type": "application/x-ofx"} @@ -303,4 +303,4 @@ ;; date: 2018-08-04 ;; info: {"filename": "/investment_buy_sell_income.ofx", "type": "application/x-ofx"} -2018-08-04 price WKPSD 24.7722967 USD +2018-08-04 price WKPSD 0.5949031797625979166755953164 USD diff --git a/testdata/source/ofx/test_td_ameritrade/import_results.beancount b/testdata/source/ofx/test_td_ameritrade/import_results.beancount index 86acaabe..5564be36 100644 --- a/testdata/source/ofx/test_td_ameritrade/import_results.beancount +++ b/testdata/source/ofx/test_td_ameritrade/import_results.beancount @@ -21,4 +21,4 @@ ;; date: 2017-12-03 ;; info: {"filename": "/td_ameritrade.ofx", "type": "application/x-ofx"} -2017-12-03 price AMERITRADE-912810RW0 100 USD +2017-12-03 price AMERITRADE-912810RW0 1 USD diff --git a/testdata/source/ofx/test_vanguard_roth_ira/import_results.beancount b/testdata/source/ofx/test_vanguard_roth_ira/import_results.beancount index 04240208..5718a08b 100644 --- a/testdata/source/ofx/test_vanguard_roth_ira/import_results.beancount +++ b/testdata/source/ofx/test_vanguard_roth_ira/import_results.beancount @@ -17,4 +17,4 @@ ;; date: 2018-07-03 ;; info: {"filename": "/vanguard_roth_ira.ofx", "type": "application/x-ofx"} -2018-07-03 price TYCDT 84.20 USD +2018-07-03 price TYCDT 1.554232804232804232804232804 USD diff --git a/testdata/source/ofx/test_vanguard_roth_ira_matching/import_results.beancount b/testdata/source/ofx/test_vanguard_roth_ira_matching/import_results.beancount index 1e488a81..2c1f56e9 100644 --- a/testdata/source/ofx/test_vanguard_roth_ira_matching/import_results.beancount +++ b/testdata/source/ofx/test_vanguard_roth_ira_matching/import_results.beancount @@ -6,4 +6,4 @@ ;; date: 2018-07-03 ;; info: {"filename": "/vanguard_roth_ira.ofx", "type": "application/x-ofx"} -2018-07-03 price TYCDT 84.20 USD +2018-07-03 price TYCDT 1.554232804232804232804232804 USD