Skip to content

Feature/closed pnl fill (backport #3168)#3289

Merged
pp346 merged 1 commit intorelease/indexer/v9.xfrom
mergify/bp/release/indexer/v9.x/pr-3168
Dec 18, 2025
Merged

Feature/closed pnl fill (backport #3168)#3289
pp346 merged 1 commit intorelease/indexer/v9.xfrom
mergify/bp/release/indexer/v9.x/pr-3168

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Dec 18, 2025

Changelist

  • New Features
    • Added position state snapshot fields to fill records to capture position metrics at execution time.
    • Added realized P&L tracking field to perpetual positions.
    • Updated realized P&L calculation to use stored position data instead of derived computation.

Test Plan

Added new tests to check for the inclusion of the before field entries and updated existing ones to support the new fill schema.

Author/Reviewer Checklist

  • If this PR has changes that result in a different app state given the same prior state and transaction list, manually add the state-breaking label.
  • If the PR has breaking postgres changes to the indexer add the indexer-postgres-breaking label.
  • If this PR isn't state-breaking but has changes that modify behavior in PrepareProposal or ProcessProposal, manually add the label proposal-breaking.
  • If this PR is one of many that implement a specific feature, manually label them all feature:[feature-name].
  • If you wish to for mergify-bot to automatically create a PR to backport your change to a release branch, manually add the label backport/[branch-name].
  • Manually add any of the following labels: refactor, chore, bug.

Summary by CodeRabbit

  • New Features

    • Fill responses now include pre-trade position state: position size, entry price, and position side before each fill.
    • Perpetual position data now exposes a totalRealizedPnl field; reported realized PnL in responses is sourced from this stored value.
  • Documentation

    • Public API schemas and examples updated to show the new fill fields and the totalRealizedPnl presence.

This is an automatic backport of pull request #3168 done by [Mergify](https://mergify.com).

Co-authored-by: unbornaztecking <21340974+UnbornAztecKing@users.noreply.github.com>
(cherry picked from commit eefa4e8)
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 18, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

@pp346 pp346 merged commit c958927 into release/indexer/v9.x Dec 18, 2025
31 checks passed
@pp346 pp346 deleted the mergify/bp/release/indexer/v9.x/pr-3168 branch December 18, 2025 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

1 participant