瀏覽代碼

fix: take only open markets when building cache

Filip Dunder 1 年之前
父節點
當前提交
e5e20876eb
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      liquidity/liquidity.ts

+ 7 - 0
liquidity/liquidity.ts

@@ -13,6 +13,7 @@ import {
 } from '@raydium-io/raydium-sdk';
 import { TOKEN_PROGRAM_ID } from '@solana/spl-token';
 import { MinimalMarketLayoutV3 } from '../market';
+import bs58 from 'bs58';
 
 export const RAYDIUM_LIQUIDITY_PROGRAM_ID_V4 = MAINNET_PROGRAM_ID.AmmV4;
 export const OPENBOOK_PROGRAM_ID = MAINNET_PROGRAM_ID.OPENBOOK_MARKET;
@@ -54,6 +55,12 @@ export async function getAllAccountsV4(
             bytes: OPENBOOK_PROGRAM_ID.toBase58(),
           },
         },
+        {
+          memcmp: {
+            offset: LIQUIDITY_STATE_LAYOUT_V4.offsetOf('status'),
+            bytes: bs58.encode([6, 0, 0, 0, 0, 0, 0, 0]),
+          },
+        },
       ],
     },
   );