How it works
- Snapshot. When a user opens a token, the backend reads
GET /v2/thesis/token/{tokenAddress}for the newest page. - Live. One backend socket on
/v2/wssubscribes to the tokens users have open, up to 50, and fans eachthesisframe out to their browsers. - Track record. The backend asks
POST /v2/user/handles/pnlfor the authors on screen, in one call, and caches the answer.
Authorization header
on a WebSocket.
Starter code
Node 18 or later, withexpress and ws.
Details that matter
- Dedupe on
thesisHash, falling back toid. The same thesis can be reissued under a new id. - Key the socket by
tokenAddressfrom 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
readyentries, so apendingauthor is asked again on the next open. - Size the snapshot. A page is priced per started block of 20 requested
rows, so
limit=50costs 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.
