0% found this document useful (0 votes)
8 views2 pages

Lotwise Portfolio Tracker Tool Guide

The document outlines the requirements for building a Lotwise Portfolio Tracker tool to manage trades using a lot system. It specifies the backend (Node.js + Postgres) and frontend (Next.js) components, detailing the necessary REST API endpoints, Kafka integration, and user interface pages. Deliverables include a public GitHub repository with a README, a live site link, and a demo account for testing the logic.

Uploaded by

farhankhan2867
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

Lotwise Portfolio Tracker Tool Guide

The document outlines the requirements for building a Lotwise Portfolio Tracker tool to manage trades using a lot system. It specifies the backend (Node.js + Postgres) and frontend (Next.js) components, detailing the necessary REST API endpoints, Kafka integration, and user interface pages. Deliverables include a public GitHub repository with a README, a live site link, and a demo account for testing the logic.

Uploaded by

farhankhan2867
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Assignment: Lotwise Portfolio Tracker

Objective

Build a simple tool to track portfolio trades using a lot system:

 Buy (positive quantity) → creates a new lot.

 Sell (negative quantity) → closes existing lots using FIFO and calculates realized P&L.

 Show open positions and realized P&L clearly.

Requirements

Backend ([Link] + Postgres)

 REST API endpoints:

o POST /trades → add trade (symbol, qty, price, timestamp).

o GET /positions → list open lots + average cost.

o GET /pnl → realized P&L summary.

 Every new trade should also be published to Kafka.

Worker ([Link] + Kafka)

 Consume trade events from Kafka.

 Apply lot logic (create/close lots).

 Update database with positions and realized P&L.

Frontend ([Link])

 Page 1: Trade input form.

 Page 2: Positions (open lots, avg cost).

 Page 3: Realized P&L view.

Deliverables

1. Code in a public GitHub repo (well-structured + README).

2. README must explain:

o Data model (tables/relationships).

o How FIFO matching works.

o How to run locally.

o Any assumptions made.

3. Live working site link (deployed on free services is fine — e.g.


o Frontend → Vercel / Netlify

o Backend API + Kafka Worker → Render / Railway / Heroku (or Docker on free VM)

o Database → Supabase / Railway Postgres).

4. A short demo account or seeded trades so we can test the logic directly.

Test Scenario (for yourself)

1. Buy 100 AAPL @ 150

2. Buy 50 AAPL @ 160

3. Sell 80 AAPL @ 170

Expected:

 Remaining open lots = 70 AAPL (20 from first, 50 from second).

 Realized P&L correctly computed.

You might also like