diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index cba5fd4f..c1edcd6d 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -165,11 +165,11 @@ onMount( async() => {
- + diff --git a/src/routes/most-retail-volume/+page.svelte b/src/routes/most-retail-volume/+page.svelte new file mode 100644 index 00000000..ad44c137 --- /dev/null +++ b/src/routes/most-retail-volume/+page.svelte @@ -0,0 +1,250 @@ + + + + + + + {$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ''} Most Retail Investor Volume · stocknear + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+
+
+ +
+
+ + +
+
+

+ Retail Volume +

+
+ + + Find out the Top 100 stocks where retail investors are investing the most daily. + + + +
+ + + + + +
+ + + + +
+ + {#if isLoaded} + +
+ + We regularly update retail investor trading volumes, indicating daily sentiment as bullish (more buying) or bearish (more selling) for each stock. +
+ +
+ + +
+ + + + + + + + + + + + + + + + {#each stockList as item, index} + + goto(`/stocks/${item?.symbol}`)} class="sm:hover:bg-[#245073] sm:hover:bg-opacity-[0.2] odd:bg-[#202020] {index+1 === stockList?.length && data?.user?.tier !== 'Pro' ? 'opacity-[0.1]' : ''} cursor-pointer"> + + + + + + + + + + + + + + + + + + {/each} + +
+ # + + Symbol + + Daily Traded + + Sentiment + + Market Cap + + Profits +
+ {index+1} + +
+ {item?.symbol} + + {item?.name?.length > charNumber ? item?.name?.slice(0,charNumber) + "..." : item?.name} + +
+
+ {abbreviateNumber(item?.traded,true)} + + {item?.sentiment > 0 ? 'Bullish' : 'Bearish'} + + {abbreviateNumber(item?.marketCap,true)} + + {abbreviateNumber(item?.netIncome,true)} +
+
+ + + +
+ + {:else} +
+
+ +
+
+ {/if} + + +
+
+
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/src/routes/most-retail-volume/+page.ts b/src/routes/most-retail-volume/+page.ts new file mode 100644 index 00000000..a8da690f --- /dev/null +++ b/src/routes/most-retail-volume/+page.ts @@ -0,0 +1,50 @@ +import { userRegion, getCache, setCache } from '$lib/store'; + + +const usRegion = ['cle1','iad1','pdx1','sfo1']; + +let apiURL; + +userRegion.subscribe(value => { + + if (usRegion.includes(value)) { + apiURL = import.meta.env.VITE_USEAST_API_URL; + } else { + apiURL = import.meta.env.VITE_EU_API_URL; + } +}); + + +export const load = async ({parent}) => { + const getMostRetailVolume = async () => { + let output; + const data = await parent(); + + const cachedData = getCache('', 'getMostRetailVolume'); + if (cachedData) { + output = cachedData; + } else { + // make the POST request to the endpoint + const response = await fetch(apiURL + '/most-retail-volume', { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + }, + }); + + output = await response.json(); + + output = data?.user?.tier !== 'Pro' ? output?.slice(0,6) : output; + + setCache('', output, 'getMostRetailVolume'); + + } + + return output; + }; + + // Make sure to return a promise + return { + getMostRetailVolume: await getMostRetailVolume() + }; +}; \ No newline at end of file