File tree Expand file tree Collapse file tree
src/features/liquidityPool Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/** @type {import('next').NextConfig } */
22const nextConfig = {
3- // output: 'standalone',
3+ output : 'standalone' ,
44 images : {
55 remotePatterns : [
66 {
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import type {
1313} from '@/features/liquidityPool/types'
1414import type { TTradeableTokenProps } from '@/features/tokens/types'
1515import { getTradeableTokenByAddress , getBBAFromDaltons , isNativeBBA } from '@/lib/token'
16+ import StaticTradeableTokens from '@/staticData/tokens'
1617
1718const publicKey = ( property : string = 'publicKey' ) => {
1819 return blob ( 32 , property )
@@ -231,6 +232,11 @@ export function calculatePoolMetrics(
231232 }
232233}
233234
235+ const isUnknownTokenBySymbol = ( symbol : string ) => {
236+ const knownSymbol = StaticTradeableTokens . map ( ( token ) => token . symbol )
237+ return ! knownSymbol . includes ( symbol )
238+ }
239+
234240export async function processPoolAccount (
235241 connection : Connection ,
236242 pubkey : PublicKey ,
@@ -268,6 +274,9 @@ export async function processPoolAccount(
268274 getTokenMintInfo ( connection , mintBKey )
269275 ] )
270276
277+ // to prevent any token pair that is not valid anymore
278+ if ( isUnknownTokenBySymbol ( mintA . symbol ) || isUnknownTokenBySymbol ( mintB . symbol ) ) return null
279+
271280 // Get token account balances (reserves)
272281 const [ reserveA , reserveB ] = await Promise . all ( [
273282 getTokenAccountBalance ( connection , tokenAccountAKey ) ,
You can’t perform that action at this time.
0 commit comments