feat: settle order book functionality and validation#1305
Conversation
Time Submission Status
You can submit time with the command. Example: See available commands to help comply with our Guidelines. |
📝 WalkthroughWalkthroughAdded multi-bridge routing to order-book settlement and validation: batch-unlock helper now accepts a bridge selector; settlement/fee-distribution look up and pass market bridge; tests refactored to track USDC balances separately from TRUF and to inject TRUF where needed. Changes
Sequence Diagram(s)sequenceDiagram
participant Engine as Engine/Scheduler
participant SQL as process_settlement (migration)
participant DB as ob_queries / DB
participant Unlock as ob_batch_unlock_collateral
participant Bridge as Bridge Precompile
Engine->>SQL: trigger process_settlement
SQL->>DB: lookup market info for query_id -> bridge
DB-->>SQL: bridge name (hoodi_tt2 / sepolia_bridge / ethereum_bridge)
SQL->>Unlock: call ob_batch_unlock_collateral($bridge, wallets, amounts)
Unlock->>Bridge: call selected bridge precompile
Bridge-->>Unlock: ack / result
Unlock-->>SQL: success / error
SQL-->>Engine: settlement complete / error
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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 |
resolves: https://github.com/truflation/website/issues/3205
Summary by CodeRabbit
Bug Fixes
Improvements
Tests
✏️ Tip: You can customize this high-level summary in your review settings.