diff --git a/src/app/api/quotes/route.ts b/src/app/api/quotes/route.ts index 71e9947..2041d5a 100644 --- a/src/app/api/quotes/route.ts +++ b/src/app/api/quotes/route.ts @@ -5,7 +5,7 @@ export async function GET(req: NextRequest) { try { const amountOfMTM: BN[] = (global as any).quotesService.getMTMAmountsFor1USDC(); const latestMTMAmount = amountOfMTM[amountOfMTM.length - 1].toString(); - return NextResponse.json(latestMTMAmount); + return NextResponse.json({ latestMTMAmount }); } catch (error) { return NextResponse.json({ error: 'Failed to fetch quotes' }, { status: 500 }); } diff --git a/src/app/page.tsx b/src/app/page.tsx index 889f59e..2ed258a 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -26,7 +26,7 @@ const Page: React.FC = (): React.ReactElement => { const data = await response.json(); // Convert the string back to BN - const price = new BN(data); + const price = new BN(data.latestMTMAmount); setPriceMTMFor1USDC(price); } catch (error) { console.error('Failed to fetch price:', error);