sol-mem-gen/src/app/api/quotes/route.ts
adwait 36f298ff96 Use MTM price based on USDC for meme generation (#7)
Part of https://www.notion.so/Use-MTM-price-based-on-pool-189a6b22d47280ff9373c89f40b378d1

Co-authored-by: Adw8 <adwaitgharpure@gmail.com>
Co-authored-by: Nabarun <nabarun@deepstacksoft.com>
Co-authored-by: Adwait Gharpure <adwaitgharpure@gmail.com>
Reviewed-on: #7
Co-authored-by: adwait <adwait@noreply.git.vdb.to>
Co-committed-by: adwait <adwait@noreply.git.vdb.to>
2025-01-30 15:03:09 +00:00

13 lines
458 B
TypeScript

import BN from 'bn.js';
import { NextRequest, NextResponse } from 'next/server';
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 });
} catch (error) {
return NextResponse.json({ error: 'Failed to fetch quotes' }, { status: 500 });
}
}