From f809fbdaa101fce33ae9f1dff23d9b0faeb94154 Mon Sep 17 00:00:00 2001 From: Manohar Date: Fri, 8 May 2026 17:06:42 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20options/F&O=20positions=20only=20?= =?UTF-8?q?=E2=80=94=20exclude=20equity=20holdings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/angel/client.ts | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/src/angel/client.ts b/src/angel/client.ts index 6141c05..2cbd39a 100644 --- a/src/angel/client.ts +++ b/src/angel/client.ts @@ -110,24 +110,12 @@ function normaliseHolding(h: AngelHolding): Position | null { * Deduplicates by key (position wins over holding for same symbol). */ export async function fetchAllPositions(): Promise { - const [rawPositions, rawHoldings] = await Promise.all([ - fetchPositions(), - fetchHoldings(), - ]); - - const map = new Map(); - - // Holdings first (lower priority) - for (const h of rawHoldings) { - const p = normaliseHolding(h); - if (p) map.set(p.key, p); - } - - // Positions override (intraday / F&O takes precedence) + // Holdings excluded — options/F&O positions only + const rawPositions = await fetchPositions(); + const results: Position[] = []; for (const raw of rawPositions) { const p = normalisePosition(raw); - if (p) map.set(p.key, p); + if (p) results.push(p); } - - return Array.from(map.values()); + return results; }