BlockReq
Back to all articles

Rpc Tutorials

BNB double-pair open tool: same-cap twin pools

Brew multi-pair launch: two locked pools at the same USD cap — BSC public WSS eth_subscribe Factory PairCreated, verify both pools, then alert. Register for 3M free requests monthly.

BlockReq EngineeringSeptember 11, 20265 min read

BNB double-pair open tool: same-cap twin pools

Brew multi-pair launches lock two pools at the same USD cap—this post converges on same-cap twin-pool listen: Factory PairCreated (or equivalent pool create) arrives → group by launch / token → verify both pool addresses → card. LONG-eco whitelist PairCreated watches eco-table hits; here we watch same-cap twin sets.

Run on the public endpoint · blockreq.com register for 3M free requests monthly.

UseEndpoint
Public HTTPShttps://bsc-rpc.blockreq.com/v1/rpc/public
Public WSSwss://bsc-rpc.blockreq.com/v1/rpc/public
PrivateTrailing public{API_KEY} (keys stay local)

Chain: BNB Smart Chain EVM chainId = 0x38 (56). Public endpoints · eth_subscribe · Plans · Register.

1. Hook: same cap × twin-pool listen

Tape feelOn-chain signalWatch
Brew multi-pair openFactory PairCreated / pool createlaunchId · token · capUsd
Same-cap lockpoolA + poolB under one launchboth addresses verified
Paired outboundtwinReady = both pools seenone twin card
Sniper tapehit → outboundDedupe = launchId + pool pair

Same family, different grain: LONG whitelist narrows to an eco address table; Brew double-pair narrows to a same-cap twin set.

2. Event: Factory PairCreated → twin group

Keep local JSON BREW_FACTORY (editable) + target CAP_USD + optional QUOTE_HINT (WBNB / USD1, …). One BSC public WSS: subscribe Factory PairCreated, decode, write twinState keyed by launch / token.

Step A · Subscribe Factory PairCreated

{
  "jsonrpc": "2.0", "id": 1, "method": "eth_subscribe",
  "params": ["logs", {
    "address": "BREW_FACTORY",
    "topics": ["0x0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9"]
  }]
}
  • topics[0]: V2-style PairCreated (confirm against Brew / Factory ABI; swap in an equivalent pool-create topic when needed).
  • Decode token0 / token1 / pair → map launchId (tx-local or follow-on create fields) → append into twinState[launchId].pools[].

Step B · Same-cap twin check

FieldRule
capUsdlocal target / decoded USD cap
poolA / poolBtwo pool addresses under one launch
twinReadypools.length >= 2 and cap aligned
quoteSidesquote hints on each side (editable)

Step C · Twin-pool card fields

{ chain: "bsc", pad: "brew-double-pair", launchId, token, capUsd, poolA, poolB, token0, token1, txHash, blockNumber, ts }

Dedupe on launchId + sorted poolA|poolB; demo knobs: CAP_USD and Factory address.

3. Browser demo (StackBlitz)

Default BSC public WSS; paste Brew Factory + target cap + quote hints, hit Start, stream twin-pool cards. Code lives in StackBlitz — the post only embeds the preview:

Repo: blockreq/blog-demosexamples/brew-bnb-double-pair-listen.

Product page: ZH · EN

WSS  → wss://bsc-rpc.blockreq.com/v1/rpc/public
HTTPS→ https://bsc-rpc.blockreq.com/v1/rpc/public
env  → BREW_FACTORY · CAP_USD · QUOTE_HINT · PAIR_CREATED_TOPIC0

Keyed: swap trailing public for {API_KEY}. Quota: blockreq.com register for 3M free requests monthly.

4. Alert rhythm

  1. PairCreated arrives → decode token0 / token1 / pair · group by launchId.
  2. Same-cap twin check → two pool addresses + aligned cap → twinReady.
  3. OutboundBNB Brew twin · token=… · cap=… · poolA=… · poolB=… · blk=….
  4. Dedupe → one push per launchId + sorted pool pair.

On disconnect: reconnect and re-subscribe; gap-fill with HTTPS eth_getLogs on the same Factory. POST → https://bsc-rpc.blockreq.com/v1/rpc/public.

5. Summary + CTA

  1. Grain: Brew BNB open = same-cap twin-pool listen.
  2. Recipe: Factory + PairCreated topic + launch group + twin check → twin card.
  3. Runnable: browser on BlockReq BSC public WSS; demos1 paths above.
  4. Start: Public endpoints + blockreq.com register for 3M free requests monthly.

Next: pin Factory / cap JSON → webhook → stack on-screen with LONG-eco whitelist open cards. Docs · Pricing · Register.