Implement Mark Price Consumption in Position Service#17
Implement Mark Price Consumption in Position Service#17google-labs-jules[bot] wants to merge 1 commit intomasterfrom
Conversation
- Clarified Mark Price responsibility in design doc (Risk triggers liquidation, Position updates PnL).
- Created `MarkPriceUpdatedEventListener` to consume `market.mark-price` events.
- Updated `PositionDomainService` to handle Mark Price updates:
- Update `MarkPriceCache`.
- Recalculate `unrealizedPnl`, `marginRatio`, and `liquidationPrice` for active positions.
- Persist updated positions (using optimistic locking).
- Emit `PositionUpdated` event (via `createMarkPriceEvent`).
- Updated `PositionEvent` to support Mark Price updates with full position state.
- Added `MarkPriceCache` for local caching.
- Updated `exchange-position` dependencies.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
Implemented the consumption of
MarkPriceUpdatedevents in the Position Service. This involves listening to themarket.mark-pricetopic, updating the local mark price cache, and recalculating PnL, margin ratio, and liquidation price for all active positions on that instrument. Updated positions are persisted and aPositionUpdatedevent is emitted. The design document was also updated to clarify responsibilities.PR created automatically by Jules for task 4458839992511751053 started by @vincentf13