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.
| Use | Endpoint |
|---|---|
| Public HTTPS | https://bsc-rpc.blockreq.com/v1/rpc/public |
| Public WSS | wss://bsc-rpc.blockreq.com/v1/rpc/public |
| Private | Trailing 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 feel | On-chain signal | Watch |
|---|---|---|
| Brew multi-pair open | Factory PairCreated / pool create | launchId · token · capUsd |
| Same-cap lock | poolA + poolB under one launch | both addresses verified |
| Paired outbound | twinReady = both pools seen | one twin card |
| Sniper tape | hit → outbound | Dedupe = 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-stylePairCreated(confirm against Brew / Factory ABI; swap in an equivalent pool-create topic when needed).- Decode
token0/token1/pair→ maplaunchId(tx-local or follow-on create fields) → append intotwinState[launchId].pools[].
Step B · Same-cap twin check
| Field | Rule |
|---|---|
capUsd | local target / decoded USD cap |
poolA / poolB | two pool addresses under one launch |
twinReady | pools.length >= 2 and cap aligned |
quoteSides | quote 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-demos → examples/brew-bnb-double-pair-listen.
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
- PairCreated arrives → decode token0 / token1 / pair · group by launchId.
- Same-cap twin check → two pool addresses + aligned cap →
twinReady. - Outbound →
BNB Brew twin · token=… · cap=… · poolA=… · poolB=… · blk=…. - 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
- Grain: Brew BNB open = same-cap twin-pool listen.
- Recipe: Factory + PairCreated topic + launch group + twin check → twin card.
- Runnable: browser on BlockReq BSC public WSS; demos1 paths above.
- 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.