DEV Community

Cover image for Rug Séance: Día de los Muertos for dead crypto tokens, narrated by Gemma
vhmns
vhmns

Posted on

Rug Séance: Día de los Muertos for dead crypto tokens, narrated by Gemma

Hacktoberfest Open-Source AI Challenge: Ghost in the Machine Submission 👻🌼

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine

What I Built

Rug Séance holds a Día de los Muertos for crypto tokens that died.

You paste the contract address of a BNB Smart Chain token. The app reads the token's whole short life from the chain: when its pool was seeded, how high it got, who sold, and the moment the liquidity vanished. A deterministic "coroner" writes up an Acta de Defunción (death certificate). Then the token's ghost, La Calavera de $TICKER, comes back and tells you in the first person how it died.

The ghost can't lie its way out, though. Every factual sentence has to cite a numbered piece of evidence (ev4, ev8…), and each one links to the real transaction on BscScan. If the model makes up a citation, it gets stripped. If it states a number without citing anything, the sentence gets a dashed underline.

Most rug pulls are faster than people expect. On BSC, plenty of tokens go from birth to death in less time than a lunch break, and nobody remembers them. Día de los Muertos is about remembering, so I wanted to give these ones a wake, with receipts.

Two of the bundled cases are real BSC tokens that died the day I built this:

  • $PAND (Panda BSCPAD): seeded with 15.98 WBNB, the pool peaked at 29.94 WBNB, then one transaction pulled out 99.5% of the pool, 30 minutes after launch. The deployer's own wallet sent it.
  • $BSC🏆 (BSC Gold Plus): seeded with 48.70 WBNB, peaked at 94.16 WBNB, then 79.79 WBNB (99.8%) was removed 25 minutes in, again by its deployer.

Here's what the $PAND ghost said when I asked "Could my wallet have known?" (Gemma 4 31B, unedited):

Ah, the eternal question of the living. You looked at my face and saw a panda, but you should have looked at the bones. Your wallet could have seen the red flags if you had peered into the void. The ownership was never renounced [ev2], and the LP tokens sat entirely in one unlocked wallet [ev2]. […] I lived for only 30 minutes before 99.5% of the pool vanished [ev8]. Not financial advice, mi amigo, but the ledger never lies, even when it is ghostwriting.

What's on the page:

  • Acta de Defunción: a lotería-card death certificate with born/died/age, peak liquidity and liquidity at death, cause of death, contributing factors, the coroner's confidence, and a ¡RUGGED! stamp
  • La Séance: streaming chat with presets: Who killed you?, Could my wallet have known?, Write your epitaph
  • Las Últimas Horas: a timeline with tx links and a liquidity chart rebuilt from Sync events
  • Epitafio: an epitaph on a small SVG ofrenda, ready to copy
  • La Evidencia, La Familia del Deployer, El Panteón
  • Healthy tokens get no ghost, just "This token still breathes" and their risk notes

Demo

Live: https://rugseance.kodekecil.tech (try the three sample cases, or paste any BSC token address)

Demo video (1 min): https://github.com/vhmns14/rug-seance/blob/main/docs/demo.mp4

Acta de Defunción and La Séance

Code

Rug Séance · Día de los Rugged

Summon the ghost of a dead BNB Smart Chain token. Paste a BEP-20 contract address. Rug Séance reads the token's life straight from the chain, a deterministic coroner rules on the cause of death, and the token's ghost, La Calavera de $TICKER, voiced by Gemma (Google's open-weight model), tells you how it died in the first person. Every factual sentence cites a numbered piece of evidence that links to the transaction on BscScan.

Live: https://rugseance.kodekecil.tech · Demo video: docs/demo.mp4

Rug Séance, desktop

Built for the DEV Hacktoberfest Open-Source AI Challenge, Week 4: Ghost in the Machine.

What you get

  • Acta de Defunción: a lotería-card death certificate. Name, contract, born, died, age, peak and at-death liquidity, cause of death, contributing factors, and the coroner's confidence, stamped ¡RUGGED! (or ¡HONEYPOT!, ¡DUMPED!, ¡ABANDONADO!).
  • La Séance: streaming chat with the ghost. Presets: Who…

MIT licensed. One Node service, plain ES-module frontend, no database, no framework.

How I Built It

The open-source AI part: Gemma. The ghost's voice is Google's open-weight Gemma: google/gemma-4-31b-it by default, with gemma-4-26b-a4b-it as a fallback, through any OpenAI-compatible endpoint. I used OpenRouter's free tier. Changing two environment variables points it at Ollama running gemma3 on your own machine.

The rule I set myself: code decides the facts, the model only speaks.

  1. Evidence gathering, all from free, no-key sources:
    • GoPlus Security token API: owner, taxes, honeypot simulation, holders, LP holders, creator
    • DexScreener: pairs, current liquidity, pair creation time
    • BSC JSON-RPC directly: token metadata, then eth_getLogs for the PancakeSwap v2 pair's Mint, Burn, Swap and Sync events from launch to now, in 5,000-block windows (halved when an RPC complains). An interpolation search turns the pair's creation time into a starting block in about a second.
  2. The coroner (src/autopsy.js) is plain JavaScript. A Burn that removes ≥ 50% of the pool means liquidity pulled. A failed GoPlus sell simulation means honeypot. A ≥ 90% price fall without a burn means dumped. Dry and quiet means abandoned. It also looks up who sent the liquidity-removal transaction, so "the deployer pulled it" is a fact the code found, not a guess the model made.
  3. The medium (src/ghost.js) hands Gemma a compact evidence pack where every item has an id. The system prompt makes the ghost a calavera literaria: wry, melancholic, first person. The hard rules: cite [ev:N] for every fact, never invent people or numbers, never contradict the coroner.
  4. Checking the ghost. Citations are validated against the evidence list. Unknown ids become [ev:?], unknown hashes are redacted, and sentences with numbers but no citation are flagged in the UI.
  5. Free models are fragile, so the app retries with backoff, falls back to a second Gemma, and then to a deterministic narrator built from the same evidence. The UI says plainly when that happens. Summons and replies are cached in memory.

Design. I wanted Mexican folk art, not "AI dashboard": cream paper cards on a night-indigo background, rosa mexicano, cempasúchil orange and turquoise, a swaying papel picado strand, falling marigold petals, a hand-coded SVG sugar skull, veladora candles that flicker while it summons, a lotería-card death certificate, and an SVG ofrenda for the epitaph. The fonts (Rye, Fjalla One, IBM Plex Mono) are self-hosted, so it works without a CDN.

Deploy. It runs on Cloudflare Workers (src/worker.js, a fetch-handler port of the Express server with the static files bundled in) on a .tech domain. The plain Node/Express server and a render.yaml are still in the repo for anyone who'd rather host it there.

Why Does Open Innovation Matter?

  • The séance can run with the lights off. With Ollama and Gemma, the whole narration runs on your laptop: no API key, no account, no per-token bill. Only the public chain reads go out.
  • Honesty is easier when you own the stack. Because the model is a swappable part behind an OpenAI-compatible interface, I could design the app so the model never decides facts. The evidence and the verdict come from open code you can read and fork. The model is the voice, not the judge.
  • It costs nothing to keep alive. Free public data, a free model tier or local inference, and a free-tier Cloudflare Worker. A closed, metered API would make "summon any dead token for fun" something you'd think twice about paying for.
  • No one can take it away. If a provider drops the model tomorrow, the weights still exist, and so does every rule the coroner uses.

The Spirit of It

The moment it landed for me: I pasted a token I'd never heard of, and a little skull explained, politely, with a link, that its maker drained 99.8% of its pool 25 minutes after it was born. Then I asked it to write its own epitaph, and Gemma gave me this:

Born to shine, died in a flash.
The deployer took the gold,
leaving only dust and ghosts.

Día de los Muertos says you're only truly dead when nobody remembers you. These tokens were built to be forgotten fast. This is a small ofrenda so they aren't, and so the next person checks the bones before buying the face.

Prize Categories

  • Best Use of Gemma: Gemma (4 31B / 26B A4B through OpenRouter, or gemma3 locally through Ollama) voices the ghost, grounded by a citation contract.
  • Best Use of a .tech Domain: live at https://rugseance.kodekecil.tech

Not financial advice. Los muertos no dan alpha.

Top comments (0)