Skip to main content
For: trading terminals and token screeners. A trader opening a token sees why other traders bought it: the written thesis, the size of the trade, the author’s position PnL, and the author’s realized profit over the last 30 days. New theses land on the page as traders publish them.

How it works

  1. Snapshot. When a user opens a token, the backend reads GET /v2/thesis/token/{tokenAddress} for the newest page.
  2. Live. One backend socket on /v2/ws subscribes to the tokens users have open, up to 50, and fans each thesis frame out to their browsers.
  3. Track record. The backend asks POST /v2/user/handles/pnl for the authors on screen, in one call, and caches the answer.
The key stays on the backend. Browsers cannot send the Authorization header on a WebSocket.

Starter code

Node 18 or later, with express and ws.

Details that matter

  • Dedupe on thesisHash, falling back to id. The same thesis can be reissued under a new id.
  • Key the socket by tokenAddress from the REST page. The API lower-cases EVM addresses, so the page’s value matches the frames.
  • Cache author PnL. A ready entry costs 30,000 CU. Ten minutes of cache per author keeps a busy token page affordable. The starter code caches only ready entries, so a pending author is asked again on the next open.
  • Size the snapshot. A page is priced per started block of 20 requested rows, so limit=50 costs 600 CU.
  • After a drop, close the gap. On reconnect, read the newest page again and let the dedupe set drop what the user already has.

Build it with us

We build these projects together with the teams that ship them. Tell us what you are building on Telegram or at fomoscan-support@proton.me and we will help you scope it, size the credits and get it live.