BlockReq
返回全部文章

實戰範例

依 quote mint 白名單過濾 Solana 上的 Pump.fun Custom Pair 建立

節點就緒後把 endpoint 填進環境變數即可開跑:Pump.fun Custom Pair 按 quote mint 白名單(xStocks 等)過濾 Create/CustomPair,可選疊 PumpSwap 畢業。註冊每月免費 3M 請求。

BlockReq Engineering2026年9月16日5 分鐘閱讀

Pumpfun Custom Pairs 把報價腿擴到 tokenized stocks / majors / metals:建立時選 xStocks、Sunrise 等 quote mint,曲線與 PumpSwap 手續費與標準開盤同構。本篇先把 Create / CustomPair + quote mint 白名單 配方預埋好——瀏覽器側留 SOLANA_HTTPS / SOLANA_WSS 佔位,節點就緒後把 endpoint 填進環境變數即可開跑。

公共端點開跑 · blockreq.com 註冊每月免費 3M 請求。

用途Endpoint(佔位)
HTTPSprocess.env.SOLANA_HTTPS(節點就緒後填入)
WSSprocess.env.SOLANA_WSS(節點就緒後填入)
私有末尾 public → {API_KEY}(Key 放本地)

鏈:Solana。配方走 logsSubscribe(mentions Pump program)→ 解碼 Create/CustomPair → quote mint ∈ 白名單 → 開盤卡。瀏覽器 demo 先展示 UI + sample 行,endpoint 一就緒即換真值續聽。公開端點 · 套餐 · 註冊。

與 RH 股票配對開盤配方分開疊層:本篇落在 Solana Pump Create/CustomPair + quote mint 白名單;RH 線走 EVM Factory PairCreated(見 股票配對 meme · RH 任意報價)。

1. Hook:Custom Pair 按 quote 聽開盤

盤面語感鏈上訊號你盯什麼
quote 白名單開盤Create / CustomPair 且 quote mint ∈ 表baseMint / quoteMint
xStocks / majors 腿quote = NVDA* / TSLA* / BTC* 等白名單標籤 + mint
打狗聽聲quote 命中即出站去重鍵 = signature / mint
節點換端env 換真 WSS 即續聽SOLANA_WSS 一填開跑

語感:標準 Pump 開盤聽 Create;Custom Pair 多一道 quote mint 門閂——只把白名單報價腿推成卡。

2. 事件:logsSubscribe + quote 白名單

環境變數先放 SOLANA_HTTPS / SOLANA_WSS / PUMP_PROGRAM / QUOTE_WHITELIST。節點就緒後只改 endpoint,訂閱體與過濾邏輯原樣沿用。

Step A · 訂 Pump program logs

{
  "jsonrpc": "2.0", "id": 1, "method": "logsSubscribe",
  "params": [
    { "mentions": ["PUMP_PROGRAM"] },
    { "commitment": "confirmed" }
  ]
}
  • mentions[0] = process.env.PUMP_PROGRAM(以官方 program id 表為準)。
  • 客戶端掃 log:命中 Create / CustomPair / 等價 create 指令名。
  • HTTPS getTransaction(encoding: "jsonParsed")取出 baseMint / quoteMint / bonding curve。

Step B · quote mint 白名單過濾

QUOTE_WHITELIST = editable mint set(xStocks / Sunrise / majors …)
hit = quoteMint ∈ QUOTE_WHITELIST  →  write launchState

開盤卡欄位:

{ pad: "pump-custom-pair", baseMint, quoteMint, quoteTag, signature, slot, ts }

同 signature / baseMint 去重;滑動窗合併同 mint 重複推送。

Step C · 可選疊層:PumpSwap 畢業

Create 命中後,同 program / PumpSwap 路徑掃 migrate / graduate 日誌;畢業簽名到站 → 疊 graduated / pumpSwapPool 色塊。

3. 瀏覽器 demo

瀏覽器連 SOLANA_WSS 佔位,填 Pump program + QUOTE_WHITELIST,點 Start:UI 先刷 sample 開盤行;節點就緒後換真 endpoint,同一套過濾直接續聽。

env  → SOLANA_HTTPS · SOLANA_WSS · PUMP_PROGRAM · QUOTE_WHITELIST
WSS  → process.env.SOLANA_WSS
HTTPS→ process.env.SOLANA_HTTPS

路徑:/demos1/pumpfun-custom-pairs-listen/zh-tw/ · /demos1/pumpfun-custom-pairs-listen/en/。換 keyed:WSS 末尾 public → {API_KEY}。

開跑配額:blockreq.com 註冊每月免費 3M 請求。

4. 告警節奏

  1. Create / CustomPair 到達 → 解析 baseMint / quoteMint。
  2. 白名單命中 → 出站 Pump Custom Pair · base=… · quote=… · tag=… · slot=…。
  3. 可選 → PumpSwap 畢業作第二色塊。
  4. 去重 → 同 signature / baseMint 只推一次。

斷線後重連並重新 logsSubscribe;空窗用 HTTPS getSignaturesForAddress + getTransaction 按 slot 段回補同一 program。POST → process.env.SOLANA_HTTPS。

5. 小結 + CTA

  1. 粒度:Custom Pair 開盤 = Create/CustomPair + quote mint ∈ 白名單。
  2. 配方:SOLANA_WSS + PUMP_PROGRAM + QUOTE_WHITELIST + 可選 PumpSwap 畢業 → 開盤卡。
  3. 可跑:瀏覽器預埋佔位 + sample 行;節點就緒後把 endpoint 填進環境變數即可開跑。
  4. 開跑:公開端點 + blockreq.com 註冊每月免費 3M 請求。

下一步:固化 xStocks quote 表 → Webhook → 與 RH 任意 quote / 股票配對線疊層對照。文件 · 定價 · 註冊。