               ; process all item updates
               _ (->> current-base-items
                      (concat dereferenced-base-items
-                             dereferenced-account-id-base-items)
+                             dereferenced-account-base-items)
                      (mapv #(recalculate-account-items storage %)))
 
               ; update the transaction record itself

                item))
         (mapv #(get-previous-item storage %)))))

(defn- find-existing-transaction
  "Given a transaction that has been updated, find the existing
  transaction in storage. If none can be found, throw an exception."

        validated
        (let [existing (find-existing-transaction storage validated)
              dereferenced-base-items (remove-dereferenced-items storage validated existing)
              dereferenced-account-base-items (dereferenced-account-base-items storage validated existing)

              ; current items
              upserted-items (mapv #(as-> % i
