Multi-market opens: Equifold eth_subscribe alerts
One token can open across many markets / quote sides—an ETH-quoted book first, then a stock-token quote, the tape stacking layer by layer. Equifold live on Base, plus Robinhood-side multi-market chatter, paraphrased from EquiFold · Base and EquiFold · multi-market. This post does one job: hang a single eth_subscribe on the Factory, aggregate markets per token, and tag first vs Nth with priority and rate labels.
Bags single-pair landings: Stock-pairs launch. New-pair agent: New pairs agent. Open rhythm: Watch Robinhood opens. This one tracks one token → many markets.
| Use | Base (default) | Robinhood (optional toggle) |
|---|---|---|
| Public HTTPS | https://base-rpc.blockreq.com/v1/rpc/public | https://robinhood-mainnet-rpc.blockreq.com/v1/rpc/public |
| Public WSS | wss://base-rpc.blockreq.com/v1/rpc/public | wss://robinhood-mainnet-rpc.blockreq.com/v1/rpc/public |
| Private | Trailing public → {API_KEY} (keys stay local) | Same pattern |
Chains: Base EVM chainId = 0x2105 (8453); optional RH 0x1237 (4663). Free 3M Requests / 30 days · Public endpoints · eth_subscribe · Pricing.
1. Single pair → multi-market listen model
| Tape feel | On-chain signal | Watch |
|---|---|---|
| Market lands | Factory create / open-style event | marketId, baseToken, quoteToken |
| Same token, another book | Same baseToken, new quote / new market | Append marketsByToken[token] |
| First-market open | Aggregate list length = 1 | Priority tag P0 / first |
| Nth-market open | Length ≥ 2 | Tag P1… / nth + rate window |
Stock-pairs watches “one side ∈ stock table → one pair”; this post watches “how the market list grows under one token.”
2. Equifold events + quote types
Two common quote sides (confirm against deploy ABI / env):
| Quote type | Example | Alert use |
|---|---|---|
| ETH / WETH quote | Native liquidity book | First market often lands here → P0 |
| Stock-token quote | AAPL / TSLA-class | Same token opens another book → Nth expand |
Factory address and create/open topics[0] live in env placeholders (EQUIFOLD_FACTORY, EQUIFOLD_MARKET_TOPIC0)—swap chain or deploy by editing env only.
3. One subscribe: Factory + topic, aggregate per token
One public WSS, narrow Factory logs; each push decodes base / quote / market into a local aggregate map.
Step A · Subscribe Factory create/open (topic0 placeholder)
{
"jsonrpc": "2.0", "id": 1, "method": "eth_subscribe",
"params": ["logs", {
"address": "${EQUIFOLD_FACTORY}",
"topics": ["${EQUIFOLD_MARKET_TOPIC0}"]
}]
}
address/topics[0]from env; confirm against Equifold Factory ABI.- Decode
baseToken/quoteToken/market(field names per ABI) →key = baseToken.toLowerCase().
Step B · Local aggregate marketsByToken
| Field | Meaning |
|---|---|
token | baseToken (aggregate key) |
markets[] | { market, quote, tx, ts, index } |
firstAt | First-market timestamp |
count | Current market count |
Each create: count += 1, index = count; index === 1 → first; else Nth.
Step C · Split vs stock-pairs
| Post | Listens for | Emits |
|---|---|---|
| Stock-pairs | PairCreated × stock table | Single-pair card |
| This post | Equifold Factory × token aggregate | First / Nth priority card |
4. Alerts: first vs Nth (priority · rate tags)
Drive push rhythm with priority + rate labels (positive tags → dashboard chips):
| Tag | Demo trigger | Push strategy |
|---|---|---|
| P0 · first | index === 1 | Push immediately; full fields |
| P1 · nth | index ≥ 2 | Include index, quote, Δt from first |
| rate · burst | Same token opens several markets in a short window | Stack rate tag; merge into one cluster card |
| rate · steady | Later markets with wider spacing | Lightweight single update |
- Market landed →
{ token, market, quote, index, factoryTx, ts }. - First → same +
priority: "P0"; highlight on webhook / board. - Nth →
priority: "P1"+index+deltaFromFirstMs. - Rate cluster → several same-token opens in-window → one cluster card with
markets[]summary.
Disconnects: reconnect → re-subscribe; gap-fill with HTTPS eth_getLogs in block segments, replay the same aggregate + priority rules. Default POST → https://base-rpc.blockreq.com/v1/rpc/public; flip to the RH row in the table when toggling.
5. Free 3M + dual-endpoint toggle (StackBlitz)
Defaults to BlockReq Base public WSS; UI can flip to RH. Paste / env-fill Factory + topic0, live-refresh marketsByToken, tag P0 / P1 / rate. Code lives in StackBlitz—article embeds the preview only:
Repo: blockreq/blog-demos → examples/equifold-multi-market-listen. For keyed: swap trailing public for {API_KEY}. Free 3M covers a short dual-chain listen; long boards go keyed.
6. Summary
- Multi-market opens = Factory events aggregated by token; hear how the list grows, hear first vs Nth.
- Recipe: one Factory subscribe +
marketsByToken+ P0/P1/rate tags. - Base public WSS runs by default; StackBlitz toggles RH; Free 3M covers tryouts.
- Series: stock single-pair · new-pairs agent · open rhythm · thin liquidity · this multi-market aggregate. Next: pin Factory / topic0 in
.env→ wire P0/P1 to webhooks → persist checkpoints. Public endpoints · Plans & pricing.