From 44a164fdf34cfcc5335aff7bddc8b46ee332d44f Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Thu, 9 Jan 2025 16:00:40 +0100 Subject: [PATCH] add top sectors for etf page --- src/lib/components/ETFSidecard.svelte | 74 ++- .../components/Options/GreekExposure.svelte | 446 +++++++++++++++++ src/routes/etf/[tickerID]/+layout.server.ts | 3 + .../etf/[tickerID]/options/gex/+page.svelte | 5 - .../[tickerID]/options/gex/+page.svelte | 463 +----------------- 5 files changed, 523 insertions(+), 468 deletions(-) create mode 100644 src/lib/components/Options/GreekExposure.svelte diff --git a/src/lib/components/ETFSidecard.svelte b/src/lib/components/ETFSidecard.svelte index 7308e36e..3563fe7b 100644 --- a/src/lib/components/ETFSidecard.svelte +++ b/src/lib/components/ETFSidecard.svelte @@ -1,6 +1,11 @@ + +
+

+ Daily Gamma Exposure +

+ +
+ {#if options !== null} +
+
+ {#each ["3M", "6M", "1Y"] as item} + + {/each} +
+ + +
+ {:else} +
+
+ +
+
+ {/if} +
+
+ + + + + + {#each data?.user?.tier === "Pro" ? displayList : displayList?.slice(0, 3) as item, index} + + + + + + + + + + {/each} + +
+ {formatDate(item?.date)} + + {@html abbreviateNumberWithColor(item?.call_gamma, false, true)} + + {@html abbreviateNumberWithColor(item?.put_gamma, false, true)} + + {@html abbreviateNumberWithColor(item?.net_gamma, false, true)} + + {#if item?.put_call_ratio <= 1} + {item?.put_call_ratio?.toFixed(2)} + {:else} + {item?.put_call_ratio?.toFixed(2)} + {/if} +
+
+ + +
+ + diff --git a/src/routes/etf/[tickerID]/+layout.server.ts b/src/routes/etf/[tickerID]/+layout.server.ts index cd2e63ae..e26a0616 100644 --- a/src/routes/etf/[tickerID]/+layout.server.ts +++ b/src/routes/etf/[tickerID]/+layout.server.ts @@ -50,6 +50,7 @@ export const load = async ({ params, locals }) => { const endpoints = [ "/etf-profile", "/etf-holdings", + "/etf-sector-weighting", "/stock-dividend", "/stock-quote", "/wiim", @@ -67,6 +68,7 @@ export const load = async ({ params, locals }) => { const [ getETFProfile, getETFHoldings, + getETFSectorWeighting, getStockDividend, getStockQuote, getWhyPriceMoved, @@ -78,6 +80,7 @@ export const load = async ({ params, locals }) => { return { getETFProfile, getETFHoldings, + getETFSectorWeighting, getStockDividend, getStockQuote, getWhyPriceMoved, diff --git a/src/routes/etf/[tickerID]/options/gex/+page.svelte b/src/routes/etf/[tickerID]/options/gex/+page.svelte index 7a39fea3..44f508d0 100644 --- a/src/routes/etf/[tickerID]/options/gex/+page.svelte +++ b/src/routes/etf/[tickerID]/options/gex/+page.svelte @@ -492,11 +492,6 @@ {:else}
-

- Hottest Contracts -

diff --git a/src/routes/stocks/[tickerID]/options/gex/+page.svelte b/src/routes/stocks/[tickerID]/options/gex/+page.svelte index fc57cdb4..d4d6d53c 100644 --- a/src/routes/stocks/[tickerID]/options/gex/+page.svelte +++ b/src/routes/stocks/[tickerID]/options/gex/+page.svelte @@ -1,335 +1,13 @@ @@ -376,127 +54,10 @@
- {#if rawData?.length > 0} -
-

- Daily Gamma Exposure -

- -
- {#if options !== null} -
-
- {#each ["3M", "6M", "1Y"] as item} - - {/each} -
- - -
- {:else} -
-
- -
-
- {/if} -
-
- - - - - - {#each data?.user?.tier === "Pro" ? displayList : displayList?.slice(0, 3) as item, index} - - - - - - - - - - {/each} - -
- {formatDate(item?.date)} - - {@html abbreviateNumberWithColor( - item?.call_gamma, - false, - true, - )} - - {@html abbreviateNumberWithColor( - item?.put_gamma, - false, - true, - )} - - {@html abbreviateNumberWithColor( - item?.net_gamma, - false, - true, - )} - - {#if item?.put_call_ratio <= 1} - {item?.put_call_ratio?.toFixed(2)} - {:else} - {item?.put_call_ratio?.toFixed(2)} - {/if} -
-
- - -
+ {#if data?.getData?.length > 0} + {:else}
-

- Hottest Contracts -

@@ -505,21 +66,3 @@
- -