Skip to content

Prediction P&L Calculation Endpoint #1399 - #1494

Merged
Olowodarey merged 5 commits into
Arena1X:mainfrom
Awointa:feat/1399-prediction-pnl-endpoint
Jul 30, 2026
Merged

Prediction P&L Calculation Endpoint #1399#1494
Olowodarey merged 5 commits into
Arena1X:mainfrom
Awointa:feat/1399-prediction-pnl-endpoint

Conversation

@Awointa

@Awointa Awointa commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Closes #1399

Changes

Implemented GET /predictions/pnl endpoint to calculate and return realized and unrealized P&L for user positions.

Features

  • Computes realized P&L from settled predictions
  • Computes unrealized P&L from open positions at current odds
  • Supports time filtering and per-market/aggregate breakdowns
  • Validates aggregate equals sum of per-market values

Files Modified

  • backend/src/predictions/predictions.service.ts — Core P&L calculation logic
  • backend/src/predictions/predictions.controller.ts — New endpoint and response handling
  • backend/src/predictions/dto — Request/response DTOs

Testing

Added comprehensive test coverage for realized/unrealized P&L calculation and aggregation math.

@drips-wave

drips-wave Bot commented Jul 30, 2026

Copy link
Copy Markdown

@Awointa Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
insight-arena-4rll Ready Ready Preview Jul 30, 2026 7:40am

Awointa added 2 commits July 30, 2026 08:37
- Add missing } after getPnl return statement
- Remove unused MarketPnlEntry import (merge artifact)

Fixes TS1146 compile error and no-unused-vars lint error
@Olowodarey
Olowodarey merged commit 0354c43 into Arena1X:main Jul 30, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Backend] — Prediction P&L Calculation Endpoint

2 participants