diff --git a/src/lib/components/Pricing.svelte b/src/lib/components/Pricing.svelte index b377ef1c..0957d1bf 100644 --- a/src/lib/components/Pricing.svelte +++ b/src/lib/components/Pricing.svelte @@ -272,7 +272,7 @@ onMount(async () => {
- Limited Offer + 2 Days Left
@@ -289,6 +289,7 @@ onMount(async () => {
$599
+ diff --git a/src/routes/dark-pool-flow/+page.svelte b/src/routes/dark-pool-flow/+page.svelte index 7443f3a0..ad5f8ea5 100644 --- a/src/routes/dark-pool-flow/+page.svelte +++ b/src/routes/dark-pool-flow/+page.svelte @@ -14,6 +14,7 @@ let highestVolumeTicker; let highestSizeTicker; let highestAmountTicker; + let sumAmountTicker let displayDate; let scrollContainer; let notFound = false; @@ -144,6 +145,17 @@ function formatTime(dateString) { return { ticker: maxAmountTicker, amount: maxAmount }; } + function sumTotalAmount(data) { + let totalAmount = 0; + let ticker; + // Iterate through the data and sum up the cost basis for each item + data?.forEach(item => { + totalAmount += item?.volume * item?.price; + }); + + return{ ticker: data?.at(0)?.symbol, totalAmount: totalAmount }; + } + async function handleScroll() { @@ -167,6 +179,8 @@ function formatTime(dateString) { highestSizeTicker = findHighestSize(rawData); highestAmountTicker = findHighestAmount(rawData); + sumAmountTicker = sumTotalAmount(rawData); + if (data?.user?.tier === 'Pro') { const attachScrollListener = () => { if (scrollContainer) { @@ -228,6 +242,7 @@ onDestroy(async() => { highestVolumeTicker = findHighestVolume(rawData); highestSizeTicker = findHighestSize(rawData); highestAmountTicker = findHighestAmount(rawData); + sumAmountTicker = sumTotalAmount(rawData); }, 200); } @@ -375,7 +390,7 @@ const debouncedHandleInput = debounce(handleInput, 200);
- Most Traded Option + Most Traded Symbol {mostFrequentTicker?.ticker} @@ -437,6 +452,20 @@ const debouncedHandleInput = debounce(handleInput, 200);
+ + +
+
+ Total Amount + + + {sumAmountTicker?.ticker} + + {abbreviateNumber(sumAmountTicker?.totalAmount, true)} + +
+
+ diff --git a/src/routes/home/+page.svelte b/src/routes/home/+page.svelte index 04b38315..cb4544ac 100644 --- a/src/routes/home/+page.svelte +++ b/src/routes/home/+page.svelte @@ -80,6 +80,9 @@ onMount( async() => {
+ {#if Feedback} + + {/if}