diff --git a/src/routes/api/options-contract-history/+server.ts b/src/routes/api/options-contract-history/+server.ts index 3d9b082f..ea04f283 100644 --- a/src/routes/api/options-contract-history/+server.ts +++ b/src/routes/api/options-contract-history/+server.ts @@ -4,7 +4,7 @@ export const POST: RequestHandler = async ({ request, locals }) => { const data = await request.json(); const { apiURL, apiKey } = locals; - const postData = { params: data?.params }; + const postData = { ticker: data?.ticker, contract: data?.contract }; const response = await fetch(apiURL + "/options-contract-history", { method: "POST", headers: { diff --git a/src/routes/stocks/[tickerID]/options/hottest-contracts/+page.svelte b/src/routes/stocks/[tickerID]/options/hottest-contracts/+page.svelte index 240276a9..f8978dfb 100644 --- a/src/routes/stocks/[tickerID]/options/hottest-contracts/+page.svelte +++ b/src/routes/stocks/[tickerID]/options/hottest-contracts/+page.svelte @@ -164,12 +164,12 @@ { key: "strike_price", label: "Chain", align: "left" }, { key: "dte", label: "DTE", align: "right" }, { key: "otm", label: "% OTM", align: "right" }, - { key: "last_price", label: "Last", align: "right" }, - { key: "high_price", label: "Low-High", align: "right" }, + { key: "last", label: "Last", align: "right" }, + { key: "high", label: "Low-High", align: "right" }, { key: "volume", label: "Volume", align: "right" }, { key: "open_interest", label: "OI", align: "right" }, { key: "open_interest_change", label: "OI Change", align: "right" }, - { key: "bid_volume", label: "Bid/Ask Vol", align: "right" }, + { key: "iv", label: "IV", align: "right" }, { key: "total_premium", label: "Total Prem", align: "right" }, ]; @@ -177,12 +177,12 @@ strike_price: { order: "none", type: "number" }, dte: { order: "none", type: "number" }, otm: { order: "none", type: "number" }, - last_price: { order: "none", type: "number" }, - high_price: { order: "none", type: "number" }, + last: { order: "none", type: "number" }, + high: { order: "none", type: "number" }, volume: { order: "none", type: "number" }, open_interest: { order: "none", type: "number" }, open_interest_change: { order: "none", type: "number" }, - bid_volume: { order: "none", type: "number" }, + iv: { order: "none", type: "number" }, total_premium: { order: "none", type: "number" }, }; @@ -509,7 +509,8 @@ output = cachedData; } else { const postData = { - params: contractId, + ticker: $stockTicker, + contract: contractId, }; // make the POST request to the endpoint @@ -690,12 +691,12 @@ - {item?.last_price} + {item?.last} - {item?.low_price}-{item?.high_price} + {item?.low}-{item?.high} - {#if item?.open_interest_change >= 0} + {#if item?.changeOI >= 0} +{item?.open_interest_change?.toLocaleString( - "en-US", - )}+{item?.changeOI?.toLocaleString("en-US")} {:else} {item?.open_interest_change?.toLocaleString( - "en-US", - )}{item?.changeOI?.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, - )} -
-
-
-
-
+ {item?.iv}% - {item?.last_price} + {item?.last} - {item?.low_price}-{item?.high_price} + {item?.low}-{item?.high} - {#if item?.open_interest_change >= 0} + {#if item?.changeOI >= 0} +{item?.open_interest_change?.toLocaleString( - "en-US", - )}+{item?.changeOI?.toLocaleString("en-US")} {:else} {item?.open_interest_change?.toLocaleString( - "en-US", - )}{item?.changeOI?.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, - )} -
-
-
-
-
+ {item?.iv}% - {item?.last_price} + {item?.last}