feat(margin): add asset type info to liquidation and withdraw events#751
feat(margin): add asset type info to liquidation and withdraw events#751avernikoz wants to merge 1 commit intoMystenLabs:mainfrom
Conversation
Updates `LiquidationEvent` and `WithdrawCollateralEvent` to include `base_asset_type` and `quote_asset_type` fields. Additionally adds `debt_is_base` to `LiquidationEvent`. This provides necessary context for tracking which pair generated the event without needing to query the pool state.
Code Review - PR #751SummaryThis PR adds asset type information (base_asset_type, quote_asset_type) to LiquidationEvent and WithdrawCollateralEvent, plus a debt_is_base field to LiquidationEvent. This enhancement improves event observability by allowing off-chain systems to identify the trading pair without additional pool state queries. ✅ Positive Observations
📝 Minor Observations
🔒 Security & Correctness✅ No security concerns identified:
✅ Correctness:
🎯 Performance✅ No performance concerns:
📊 Overall AssessmentRecommendation: Approve with minor suggestions The changes are well-implemented and follow existing patterns. The main consideration is whether the field ordering change in events is acceptable for your off-chain infrastructure. If you have event consumers that depend on field positions, you may want to add a migration notice. Action Items (Optional)
Great work on improving event observability! 🚀 |
Updates
LiquidationEventandWithdrawCollateralEventto includebase_asset_typeandquote_asset_typefields. Additionally addsdebt_is_basetoLiquidationEvent. This provides necessary context for tracking which pair generated the event without needing to query the pool state.