BlockReq
Back to all articles

Rpc Tutorials

Multi-market opens: Equifold eth_subscribe alerts

Hang Equifold multi-market opens on BlockReq public WSS eth_subscribe—one token → many markets, first vs Nth priority tags. Base + optional RH toggle. Free 3M quota.

BlockReq EngineeringSeptember 9, 20265 min read

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.

UseBase (default)Robinhood (optional toggle)
Public HTTPShttps://base-rpc.blockreq.com/v1/rpc/publichttps://robinhood-mainnet-rpc.blockreq.com/v1/rpc/public
Public WSSwss://base-rpc.blockreq.com/v1/rpc/publicwss://robinhood-mainnet-rpc.blockreq.com/v1/rpc/public
PrivateTrailing 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 feelOn-chain signalWatch
Market landsFactory create / open-style eventmarketId, baseToken, quoteToken
Same token, another bookSame baseToken, new quote / new marketAppend marketsByToken[token]
First-market openAggregate list length = 1Priority tag P0 / first
Nth-market openLength ≥ 2Tag 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 typeExampleAlert use
ETH / WETH quoteNative liquidity bookFirst market often lands here → P0
Stock-token quoteAAPL / TSLA-classSame 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

FieldMeaning
tokenbaseToken (aggregate key)
markets[]{ market, quote, tx, ts, index }
firstAtFirst-market timestamp
countCurrent market count

Each create: count += 1, index = count; index === 1 → first; else Nth.

Step C · Split vs stock-pairs

PostListens forEmits
Stock-pairsPairCreated × stock tableSingle-pair card
This postEquifold Factory × token aggregateFirst / Nth priority card

4. Alerts: first vs Nth (priority · rate tags)

Drive push rhythm with priority + rate labels (positive tags → dashboard chips):

TagDemo triggerPush strategy
P0 · firstindex === 1Push immediately; full fields
P1 · nthindex ≥ 2Include index, quote, Δt from first
rate · burstSame token opens several markets in a short windowStack rate tag; merge into one cluster card
rate · steadyLater markets with wider spacingLightweight single update
  1. Market landed{ token, market, quote, index, factoryTx, ts }.
  2. First → same + priority: "P0"; highlight on webhook / board.
  3. Nthpriority: "P1" + index + deltaFromFirstMs.
  4. 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-demosexamples/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

  1. Multi-market opens = Factory events aggregated by token; hear how the list grows, hear first vs Nth.
  2. Recipe: one Factory subscribe + marketsByToken + P0/P1/rate tags.
  3. Base public WSS runs by default; StackBlitz toggles RH; Free 3M covers tryouts.
  4. 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.