BlockReq
Back to all articles

Rpc Tutorials

Robinhood position watchtower: eth_subscribe for holding-period state

Hang a Robinhood Chain position state machine on BlockReq public WSS eth_subscribe—deployer/LP/swap/phase diffs, LP-drop and large-swap tags. Free 3M quota.

BlockReq EngineeringSeptember 7, 20265 min read

Robinhood position watchtower: eth_subscribe for holding-period state

Entry tools are everywhere—open rhythm, volume density, whale FOMO all hang on subscribe. Once you hold a bag, the tape still wants a holding-period watchtower (Canary): deployer balance, LP/reserves, swap/fee/phase, quiet vs spike—push as soon as state flips. Paraphrased demand from the thread around gippp69. This post does one job: hang a position state machine on eth_subscribe logs, run a simple local state diff, and tag LP drops, large single swaps, and phase switches.

Open-watch rhythm: Watch Robinhood opens. Volume density: Volume spikes. Whale follow-flow: Whale FOMO. This one tracks the holding-period state machine.

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

Chain: EVM chainId = 0x1237 (4663). Free 3M Requests / 30 days · Public endpoints · eth_subscribe · Pricing.

1. States to watch while you hold

Tape feelOn-chain signalWatch
Deployer movesDeployer balance / nonce drift; related TransferSnapshot bal / history; Δ over threshold → tag
LP / reserve driftPool Sync / Mint / Burn; reserve0/1Sharp drop / rise vs baseline
Swap pulsePool Swap logs; per-tx amountQuiet window vs spike window
Fee / phase flipCustom topics (fee / phase / mode)Topic value changed → phase switch

Watchtower = your local position table (token / pool / deployer) + last-tick state. Signal lands on log pushes, then you diff.

2. State machine + eth_subscribe (watchtower recipe)

Keep a lowercase, deduped position watchlist: { token, pool, deployer }. One public WSS, narrow logs; on each push, update state and compare to the prior tick.

Step A · Subscribe pool Sync / Swap (sample)

{
  "jsonrpc": "2.0", "id": 1, "method": "eth_subscribe",
  "params": ["logs", {
    "address": "0xYourPoolAddress",
    "topics": []
  }]
}
  • address = the pool for your position. Add Sync / Swap / Burn topic0 whenever you can narrow.
  • After Sync decode, take reserve0 / reserve1; Δ% vs baseline → LP drift.

Step B · Subscribe Transfer (deployer / treasury side)

{
  "jsonrpc": "2.0", "id": 2, "method": "eth_subscribe",
  "params": ["logs", {
    "topics": [
      "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
      null,
      null
    ]
  }]
}
  • topics[0] = ERC-20 Transfer. Deployer on from / to → update deployer history.
  • Periodically align with HTTPS eth_getBalance (deployer) for a balance snapshot.

Step C · Local state diff

FieldSourceDemo diff rule
reservesSyncΔ% ≥ R → LP drop / spike
lastSwapSwapSingle fill ≥ S → large swap
phaseCustom topic / storageValue changed → phase switch
quietVsSpikeIn-window Swap countLow-rate quiet / high-rate pulse

Tune R / S / window yourself. Tags = interpretation: JSON → dashboard chips / alert copy.

3. Preview: position watchtower demo (StackBlitz)

Defaults to BlockReq public WSS; paste token / pool / deployer, live-tag LP drift / large swap / phase. Code lives in StackBlitz—article embeds the preview only:

Repo: blockreq/blog-demosexamples/robinhood-position-watchtower. For keyed: swap trailing public for {API_KEY}.

4. Alert rules (LP / large swap / phase)

  1. Baseline → after entry, store { reserves0, phase, t0 }.
  2. Each related log → refresh state; compute Δreserves, single-swap size, phase hash.
  3. Any hit → tag and optionally webhook:
  • LP Δ% ≥ R → LP drop (or spike)
  • Single Swap ≥ S → large swap
  • Phase changed → phase switch
  1. Quiet vs spike → sliding-window Swap count; cross threshold → feel tag.

Disconnects: reconnect → re-subscribe; gap-fill with HTTPS eth_getLogs in block segments, replay the same state diff. POST → https://robinhood-mainnet-rpc.blockreq.com/v1/rpc/public.

5. Summary

  1. Position watchtower = position watchlist + logs subscribe + local state diff.
  2. Recipe: pool Sync/Swap + deployer Transfer + R/S/phase rules → LP / large-swap / phase tags.
  3. Public WSS runs as-is; Free 3M covers short hold sessions; long boards go keyed.
  4. Series: open rhythm · volume density · whale follow-flow · this holding-period state machine.

Next: pin the position table as JSON → wire tags to webhooks → persist backfill checkpoints. Public endpoints · Plans & pricing.