Materialize vault deltas for balance sync#2592
Conversation
How to use the Graphite Merge QueueAdd the label Raindex-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
📝 WalkthroughWalkthroughThis PR adds a new ChangesDerived Vault Deltas Read-Model
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |

Summary
derived_vault_deltasas a pipeline-maintained read model for the existingvault_deltasview outputvault_balance_changes/running_vault_balancesderived_vault_deltasinstead of recomputing the viewThis PR is standalone on
mainand does not depend on the derived-trades stack.Benchmarks
Measured with
nix developon a copied Base ST0x local DB, not the live DB.Before this PR, the same balance maintenance path measured:
upsert running_vault_balancesalone hit ~184.54sWith
derived_vault_deltasbackfilled on the copy:Tests
COMMIT_SHA=local nix develop -c cargo test -p raindex_common local_db::query --libCOMMIT_SHA=local nix develop -c cargo test -p raindex_common local_db::pipeline::adapters::apply --libCOMMIT_SHA=local nix develop -c cargo test -p raindex_common local_db::export --libCOMMIT_SHA=local nix develop -c cargo test -p raindex_common raindex_client::local_db::pipeline::bootstrap --libCOMMIT_SHA=local nix develop -c cargo test -p raindex_app_settings local_db_manifest --libSummary by CodeRabbit