# RavingDesk Paper Portfolio & Exposure > Turn paper fills and your own marks into positions, P&L, exposure and a price-shock check. Replays a list of paper fills (buys and sells, long and short) with weighted-average cost, then values the open positions at the marks you supply: cash, equity, realized and unrealized profit or loss, long/short/gross/net exposure, concentration and the equity after a uniform price shock. Totals are withheld when a position has no mark. It is the ledger engine of the RavingDesk paper-trading workspace. Part of usefulweb.site (https://usefulweb.site/). Results are deterministic calculations from the inputs and the listed assumptions; the API returns exactly what the web page shows. ## Use it - Human interface: https://ravingdeskpaperportfolio.usefulweb.site/ (interactive tool at https://ravingdeskpaperportfolio.usefulweb.site/tool) - JSON API: POST https://ravingdeskpaperportfolio.usefulweb.site/api/v1/calculate with a JSON object of inputs (schema: https://ravingdeskpaperportfolio.usefulweb.site/api/v1/tool) - OpenAPI: https://ravingdeskpaperportfolio.usefulweb.site/openapi.json - MCP (Streamable HTTP): https://ravingdeskpaperportfolio.usefulweb.site/mcp - tool `ravingdesk_paper_portfolio` ## Inputs - startingCash (number, required): Starting cash - trades (table): Paper fills (in the order they happened) - marks (table): Marks (your own current prices) - One price per open symbol. Without a mark, equity and exposure totals are not calculated. - shockPercent (number): Uniform price shock - Applied to every mark at once (sensitivity check, not a forecast). ## Method - Fills are replayed in the order given. Adding to a position updates the weighted-average entry; reducing it realizes (exit − average entry) × quantity for longs and the reverse for shorts, minus the proportional entry fee and the exit fee. - A fill larger than the open position closes it and opens the remainder in the other direction at the fill price. - Cash = starting cash − buys + sells − fees (short sales add cash; negative cash is allowed, no margin checks). Equity = cash + quantity × mark of every open position. - Exposure: long = sum of long market values, short = sum of absolute short market values, gross = long + short, net = long − short; concentration is the largest position’s share of gross. Ratios to equity are only shown when equity is positive. - If any open position lacks a mark, equity, unrealized P&L, exposure and the shock are withheld instead of being calculated from partial data. - The price shock multiplies every mark by (1 + shock %), floored at zero, and recalculates equity. ## Limits - Paper-trading calculation for education and planning only. It is not investment, tax or legal advice, uses only the numbers you enter and never places an order.