diff --git a/apis/birdeye/helpers.ts b/apis/birdeye/helpers.ts index fdc8123..b8e2e20 100644 --- a/apis/birdeye/helpers.ts +++ b/apis/birdeye/helpers.ts @@ -154,7 +154,7 @@ export const fetchSwapChartPrices = async ( daysToShow: string, ) => { if (!inputMint || !outputMint) return [] - const interval = daysToShow === '1' ? '30m' : daysToShow === '7' ? '1H' : '4H' + const interval = daysToShow === '1' ? '30m' : daysToShow === '7' ? '1H' : '1D' const queryEnd = Math.floor(Date.now() / 1000) const queryStart = queryEnd - parseInt(daysToShow) * DAILY_SECONDS const inputQuery = `defi/history_price?address=${inputMint}&address_type=token&type=${interval}&time_from=${queryStart}&time_to=${queryEnd}` diff --git a/hooks/useStakeRates.ts b/hooks/useStakeRates.ts index b15d39f..b80cab0 100644 --- a/hooks/useStakeRates.ts +++ b/hooks/useStakeRates.ts @@ -9,7 +9,7 @@ const fetchRates = async () => { ).map((t) => { const isUsdcBorrow = t.name === 'JLP' || t.name === 'USDC' const outputMint = isUsdcBorrow ? USDC_MINT : SOL_MINT - return fetchSwapChartPrices(t.mint_address, outputMint, '30') + return fetchSwapChartPrices(t.mint_address, outputMint, '90') }) const [jlpPrices, msolPrices, jitoPrices, bsolPrices] = await Promise.all(promises) @@ -27,22 +27,22 @@ const fetchRates = async () => { const rateData: Record = {} if (jlpPrices && jlpPrices?.length > 1) { rateData.jlp = - (12 * (jlpPrices[jlpPrices.length - 2].price - jlpPrices[0].price)) / + (4 * (jlpPrices[jlpPrices.length - 2].price - jlpPrices[0].price)) / jlpPrices[0].price } if (msolPrices && msolPrices?.length > 1) { rateData.msol = - (12 * (msolPrices[msolPrices.length - 2].price - msolPrices[0].price)) / + (4 * (msolPrices[msolPrices.length - 2].price - msolPrices[0].price)) / msolPrices[0].price } if (jitoPrices && jitoPrices?.length > 1) { rateData.jitosol = - (12 * (jitoPrices[jitoPrices.length - 2].price - jitoPrices[0].price)) / + (4 * (jitoPrices[jitoPrices.length - 2].price - jitoPrices[0].price)) / jitoPrices[0].price } if (bsolPrices && bsolPrices?.length > 1) { rateData.bsol = - (12 * (bsolPrices[bsolPrices.length - 2].price - bsolPrices[0].price)) / + (4 * (bsolPrices[bsolPrices.length - 2].price - bsolPrices[0].price)) / bsolPrices[0].price }