Analytics API

9 endpoints in this group.

GET /api/analytics/aum

Get Aum

AUM history for the authenticated tenant with capital breakdown: net_capital = contributed capital from capital_accounts unrealized = sum of unrealized_pnl from latest snapshot realized_ytd = sum of gain_loss from realized_trades YTD total_aum = net_capital + unrealized + realized_ytd

Parameters

NameInTypeRequiredDescription
tenant_idquery—optional
account_idquery—optional
account_idsquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/analytics/cumulative-pnl

Cumulative Pnl

Cumulative P&L series for the authenticated tenant .

Parameters

NameInTypeRequiredDescription
tenant_idquery—optional
account_idquery—optional
account_idsquery—optional
yearquery—optional
period_daysquery—optionalOptional rolling-window filter in days.

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/analytics/date-range

Get Date Range

Min/max realized-trade dates for the authenticated tenant.

Auth : tenant_id is derived from the JWT claim. Admins may pass tenant_id to read another tenant; non-admins cannot.

Parameters

NameInTypeRequiredDescription
tenant_idquery—optional
account_idquery—optional
account_idsquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/analytics/drawdown

Compute Drawdown

Compute cumulative-PnL drawdown series for the authenticated tenant .

fixes:

  • Reject malformed date_sold rows — the legacy MTM tax-filing import contained strings like "Dec 29" + literal "Invalid Date" that polluted the series with phantom -80% drawdowns. The regex guard ^YYYY-MM-DD excludes them at the SQL layer.
  • Accept period_days so the 30d / 60d / 90d window buttons on the Performance Analysis page can actually filter the response; previously the frontend sliced the unbounded series client-side which was both slow and never reached the legacy rows that wedged the chart.
  • Drop the unsafe LEFT(date_sold, 4)::integer year filter in favor of the regex-validated date_sold::date comparison.

Parameters

NameInTypeRequiredDescription
tenant_idquery—optional
account_idquery—optional
account_idsquery—optional
yearquery—optional
period_daysquery—optionalOptional rolling-window filter — only include trades whose date_sold is within the last N days.

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/analytics/investor-allocation

Get Investor Allocation

Investor allocation breakdown for the authenticated tenant .

Parameters

NameInTypeRequiredDescription
tenant_idquery—optional
account_idquery—optional
account_idsquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/analytics/pnl

Aggregate Pnl

P&L aggregate per period for the authenticated tenant .

Parameters

NameInTypeRequiredDescription
tenant_idquery—optional
account_idquery—optional
account_idsquery—optional
periodquerystringoptionaldaily
yearquery—optional
period_daysquery—optionalOptional rolling-window filter in days.

Responses

CodeDescription
200Successful Response
422Validation Error

POST /api/analytics/xirr

Compute Xirr

Compute XIRR (irregular cash flow IRR) using Newton-Raphson. Returns annualized rate of return. None if no convergence.

Request body: application/json

Responses

CodeDescription
200Successful Response
422Validation Error

GET /api/analytics/yoy

Yoy Summary

Year-over-year P&L summary for the authenticated tenant . Includes pnl_growth_pct vs prior year and aum_growth_pct.

Parameters

NameInTypeRequiredDescription
tenant_idquery—optional
account_idquery—optional
account_idsquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

POST /api/market/refresh

Refresh Market Data

Fetch latest prices from yfinance and update daily_position_snapshots.

Parameters

NameInTypeRequiredDescription
symbolsquerystringoptionalComma-separated symbols to refresh
tenant_idquery—optional
account_idquery—optional
account_idsquery—optional

Responses

CodeDescription
200Successful Response
422Validation Error

Occasional BlitzPulse product updates and offers, sent only if you tick the box and confirm your address.

How we handle your email

Footer Disclaimer BlitzPulse is educational decision support only. Not investment, tax, or legal advice. Not a broker. Trade at your own risk.