From c77cced136a95358b784597fc493c2ad491116fe Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Wed, 1 Jan 2025 11:39:33 +0100 Subject: [PATCH] ui fix --- .../DarkPool/HistoricalVolume.svelte | 20 +- src/lib/components/FailToDeliver.svelte | 18 +- .../options/hottest-contracts/+page.server.ts | 5 +- .../options/hottest-contracts/+page.svelte | 630 +++++++++--------- 4 files changed, 351 insertions(+), 322 deletions(-) diff --git a/src/lib/components/DarkPool/HistoricalVolume.svelte b/src/lib/components/DarkPool/HistoricalVolume.svelte index 8339330e..124cebb4 100644 --- a/src/lib/components/DarkPool/HistoricalVolume.svelte +++ b/src/lib/components/DarkPool/HistoricalVolume.svelte @@ -234,11 +234,17 @@ Latest Information -
- +
+
- - - - - - diff --git a/src/routes/stocks/[tickerID]/options/hottest-contracts/+page.server.ts b/src/routes/stocks/[tickerID]/options/hottest-contracts/+page.server.ts index 3f224fca..59e5fb74 100644 --- a/src/routes/stocks/[tickerID]/options/hottest-contracts/+page.server.ts +++ b/src/routes/stocks/[tickerID]/options/hottest-contracts/+page.server.ts @@ -1,7 +1,7 @@ export const load = async ({ locals, params }) => { - const { apiKey, apiURL } = locals; + const { apiKey, apiURL, user } = locals; const getData = async () => { const postData = { @@ -17,7 +17,8 @@ export const load = async ({ locals, params }) => { body: JSON.stringify(postData), }); - const output = await response.json(); + let output = await response.json(); + output = user?.tier !== "Pro" ? output?.slice(0, 3) : output; return output; }; diff --git a/src/routes/stocks/[tickerID]/options/hottest-contracts/+page.svelte b/src/routes/stocks/[tickerID]/options/hottest-contracts/+page.svelte index 5ecb68d1..76eeed49 100644 --- a/src/routes/stocks/[tickerID]/options/hottest-contracts/+page.svelte +++ b/src/routes/stocks/[tickerID]/options/hottest-contracts/+page.svelte @@ -1,7 +1,7 @@ -
+
Hottest Contracts (Highest Volume) +
+
+ Date
+ Total Volume
+ Avg. Short % of Volume
+ Date {formatDateRange(rawData?.slice(-1)?.at(0)?.date)}
+ Price Range {lowestPrice + "-" + highestPrice}
+ Latest FTD {abbreviateNumber(rawData?.slice(-1)?.at(0)?.failToDeliver)}
+ + + -
Chain
- - - - - - - - - - - - - - - {#each volumeList as item, index} - - + - {item?.strike_price} - {item?.option_type === "C" ? "Call" : "Put"} - {" " + - item?.date_expiration + - " " + - `(${daysLeft(item?.date_expiration)})`} - - - - {item?.last_price} - - + - {item?.low_price}-{item?.high_price} - - - {item?.volume?.toLocaleString("en-US")} - - - {item?.open_interest?.toLocaleString("en-US")} - - - - - {/each} - -
ChainLastLow-HighVolumeOIOI ChangeBid/Ask VolTotal Prem
LastLow-HighVolumeOIOI ChangeBid/Ask VolTotal Prem - {#if item?.open_interest_change >= 0} - +{item?.open_interest_change?.toLocaleString( - "en-US", - )} - {:else} - {item?.open_interest_change?.toLocaleString( - "en-US", - )} - {/if} - - - -
- -
- -
- - -
- - -
-
-
-
- -
-
-
- Bid Vol: {@html abbreviateNumberWithColor( - item?.bid_volume, - false, - true, - )} -
-
- Mid Vol: {@html abbreviateNumberWithColor( - item?.mid_volume, - false, - true, - )} -
-
- Ask Vol: {@html abbreviateNumberWithColor( - item?.ask_volume, - false, - true, - )} -
-
-
-
-
-
- {@html abbreviateNumberWithColor( - item?.total_premium, - false, - true, - )} -
+ + + {#each volumeList as item, index} + + + {item?.strike_price} + {item?.option_type === "C" ? "Call" : "Put"} + {" " + + item?.date_expiration + + " " + + `(${daysLeft(item?.date_expiration)})`} + + + {item?.last_price} + + + {item?.low_price}-{item?.high_price} + + + {item?.volume?.toLocaleString("en-US")} + + + {item?.open_interest?.toLocaleString("en-US")} + + + {#if item?.open_interest_change >= 0} + +{item?.open_interest_change?.toLocaleString( + "en-US", + )} + {:else} + {item?.open_interest_change?.toLocaleString( + "en-US", + )} + {/if} + + + + +
+ +
+ +
+ + +
+ + +
+
+
+
+ +
+
+
+ Bid Vol: {@html abbreviateNumberWithColor( + item?.bid_volume, + false, + true, + )} +
+
+ Mid Vol: {@html abbreviateNumberWithColor( + item?.mid_volume, + false, + true, + )} +
+
+ Ask Vol: {@html abbreviateNumberWithColor( + item?.ask_volume, + false, + true, + )} +
+
+
+
+
+ + + {@html abbreviateNumberWithColor( + item?.total_premium, + false, + true, + )} + + + {/each} + + +

Highest OI Contracts

+
+ + + + + -
ChainStrike
- - - - - - - - - - - - - - - - {#each openInterestList as item, index} - - + - {item?.option_type === "C" ? "Call" : "Put"} - {" " + - item?.date_expiration + - " " + - `(${daysLeft(item?.date_expiration)})`} - - - {item?.strike_price} - - + - {item?.last_price} - - - {item?.low_price}-{item?.high_price} - - - {item?.volume?.toLocaleString("en-US")} - - - - - - {/each} - -
ChainStrikeLastLow-HighVolumeOIOI ChangeBid/Ask VolTotal Prem
LastLow-HighVolumeOIOI ChangeBid/Ask VolTotal Prem - {item?.open_interest?.toLocaleString("en-US")} - - {#if item?.open_interest_change >= 0} - +{item?.open_interest_change?.toLocaleString( - "en-US", - )} - {:else} - {item?.open_interest_change?.toLocaleString( - "en-US", - )} - {/if} - - - -
- -
- -
- - -
- - -
-
-
-
- -
-
-
- Bid Vol: {@html abbreviateNumberWithColor( - item?.bid_volume, - false, - true, - )} -
-
- Mid Vol: {@html abbreviateNumberWithColor( - item?.mid_volume, - false, - true, - )} -
-
- Ask Vol: {@html abbreviateNumberWithColor( - item?.ask_volume, - false, - true, - )} -
-
-
-
-
-
- {@html abbreviateNumberWithColor( - item?.total_premium, - false, - true, - )} -
+ + + {#each openInterestList as item, index} + + + {item?.option_type === "C" ? "Call" : "Put"} + {" " + + item?.date_expiration + + " " + + `(${daysLeft(item?.date_expiration)})`} + + + {item?.strike_price} + + + {item?.last_price} + + + {item?.low_price}-{item?.high_price} + + + {item?.volume?.toLocaleString("en-US")} + + + {item?.open_interest?.toLocaleString("en-US")} + + + {#if item?.open_interest_change >= 0} + +{item?.open_interest_change?.toLocaleString( + "en-US", + )} + {:else} + {item?.open_interest_change?.toLocaleString( + "en-US", + )} + {/if} + + + + +
+ +
+ +
+ + +
+ + +
+
+
+
+ +
+
+
+ Bid Vol: {@html abbreviateNumberWithColor( + item?.bid_volume, + false, + true, + )} +
+
+ Mid Vol: {@html abbreviateNumberWithColor( + item?.mid_volume, + false, + true, + )} +
+
+ Ask Vol: {@html abbreviateNumberWithColor( + item?.ask_volume, + false, + true, + )} +
+
+
+
+
+ + + {@html abbreviateNumberWithColor( + item?.total_premium, + false, + true, + )} + + + {/each} + + +
+