forked from mito-systems/sol-mem-gen
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>
13 lines
458 B
TypeScript
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 });
|
|
}
|
|
}
|