Hashtags & Topics
The hashtag is where Superhero's social layer meets its market layer:
Trends = Hashtags = Communities = Tokens.
A #tag in a post is a plain substring on chain. Off chain it becomes a topic with its own
feed, a row in the trending index and, if someone launches one, a bonding-curve token with a
treasury, a DAO and a chat room.
Writing a tag
Type # followed by a name. The composer offers a picker while you type, and the resulting
text goes on chain verbatim. There is no separate tag field in the contract.
Which characters count as part of a tag comes from the community factory's collections: each
collection publishes an allowed_name_chars rule set, and the composer merges every
collection's rules into one character class. The English collection (WORDS) allows -, 0
through 9 and A through Z; other collections cover Chinese, Arabic and Russian, and a
collection added later is picked up automatically. A tag is capped at 50 characters for the
picker's purposes.
A name containing a character no collection allows (a . or a _, for example) truncates
when rendered, so the picker does not offer it.
Account mentions use the same trigger mechanics but a different storage form: @name in the
composer becomes [account:ak_…] on the wire. See Posting.
The display envelope
A tag may carry an optional suffix describing how it should render:
#SYMBOL plain tag — shows the symbol and a 24h change badge
#SYMBOL{change=0} same, with the change badge suppressed
#SYMBOL{mode=compact} adds the price
#SYMBOL{mode=advanced} adds the price and a chartThe symbol itself is never modified. The three named modes are sugar over three booleans,
chart, price and change, each settable to 1 or 0, and the ladder is strictly
monotonic: tag is a subset of compact, which is a subset of advanced. The tag preset carries
change: true; turning the badge off requires change=0 explicitly.
The payload is at most 64 characters and may not contain braces or newlines. The writer is permissive and the reader is strict: an unknown key, an unrecognised value, or an unparseable payload degrades to the plain tag rather than rendering as literal text, so a post written today cannot be made to look broken by a change to the grammar tomorrow.
From tag to link
When a post renders, each tag becomes a link to the token page:
/trends/tokens/<TAG in uppercase>?showTrade=0A post item may carry a trend_mentions array with name, sale_address, collection_info
and a performance summary for each #tag in the content, in which case the client uses it
directly. Otherwise the client searches GET /api/tokens with the tag as the search term,
takes a case-insensitive exact match on the token's name or symbol, and falls back to the first
result.
The rendered pill also shows a 24-hour change badge, from the mention's embedded performance or
from GET /api/tokens/{address}/performance. A tag with no matching token still links (the
token page handles the miss), so a hashtag is always navigable.
From tag to topic
Every tag that appears in posts becomes a topic with its own feed:
| Endpoint | Returns |
|---|---|
GET /api/topics/name/{name} | The topic's posts and its post_count |
GET /api/topics | The topic index |
GET /api/topics/{id} | One topic by id |
GET /api/topics/popular/trending | Trending topics |
You can also filter the main post index by topic: GET /api/posts?topics=… takes a
comma-separated list with partial matching.
A token's page renders its topic feed as the discussion tab. That tab defaults to posts by token holders only and falls back to everyone when the holders-only view would be empty, and its composer requires the token's hashtag before the Post button enables.
The indexer caps a post at 10 topics, each at most 50 characters after normalization.
The trending index
Trending tags are a separate, ranked index of tags and scores, with the platform each trend
came from in source.
GET /api/trending-tags?order_by=score&order_direction=DESC&limit=100&page=1&search=| Parameter | Values |
|---|---|
order_by | score, source or created_at; anything else is a 400 |
order_direction | ASC or DESC |
limit, page | 1 to 100, default 100 |
search | Case-insensitive substring on tag, at most 100 characters |
Each row carries id, tag, score, source, description (nullable) and created_at,
plus a left-joined token matched on token.name = trending_tag.tag, so a trending tag that
already has a community token arrives with it attached. A single tag is at
GET /api/trending-tags/{tag}, 404 when unknown.
Tags are normalised on write and on read: camelCase is split to kebab-case, the result is
uppercased, anything that is not a letter, a number or a hyphen in any script is stripped, and
runs of hyphens are collapsed and trimmed from the ends. GET /api/trending-tags/{tag} applies
the same function before looking up, so the lookup is case- and punctuation-insensitive.
Scores are supplied by an external provider through an API-key-authenticated
POST /api/trending-tags and stored as given; source is the provider's platform (for example
x). Each push replaces the whole index, so a tag absent from the latest push disappears rather
than ageing out.
The index drives the trending rail beside the feed, the trending pill carousel, and the trend
cloud at /trends/visx, which renders tags sized by score. It also supplies the popular feed's
trendingBoost term, normalised as min(1, highestTagScoreAmongThePostsTopics / 100); see
The Feed. A score above 100 adds nothing extra.
Topics and trending tags are different things
They are two tables with two independent writers, joined only by name.
| Topic | Trending tag | |
|---|---|---|
| Written by | The post indexer, from #tag in post content | The trending provider, via POST /api/trending-tags |
| Endpoint | GET /api/topics… | GET /api/trending-tags… |
| Has posts behind it | Always. A topic exists because a post mentioned it | Not necessarily |
| Lifetime | Permanent, like the posts | Until the next push replaces the index |
Not every topic gets a trending row, and a trending tag can exist with no posts behind it. The two meet when their normalized names match: topic names and trending tag names go through the same camelCase-splitting and uppercasing rule.
From topic to token
A topic becomes a token when somebody creates one. That is a permissionless action: open
https://superhero.com/trends/create, pick a name, and the community factory deploys the whole
stack (an AEX-9 token, an exponential bonding curve, an affiliation token sale, a DAO that
owns and benefits from the sale, and a CommunityManagement contract), then registers the
community in its on-chain registry.
The naming rules come from the collection you create in:
| Rule | Source |
|---|---|
| Token name must equal its symbol | Enforced by the factory |
| Name must be unique within the collection | The factory's community registry |
| Allowed characters | The collection's allowed_name_chars |
| Allowed length | The collection's allowed_name_length |
Once the token exists, every #tag matching its name or symbol in any post, including posts
written before the token existed, resolves to its page. Nothing rewrites the old posts;
resolution starts succeeding.
From there the token layer takes over: price is set by the bonding curve, 1% of every trade splits between the community DAO and the affiliation system, and holders govern the treasury. See Tokens overview and Trending score.
The whole chain
you type #AENIGHTS in a post
-> stored verbatim in the Tipping contract's title string
-> indexer extracts it as a topic; the post joins /api/topics/name/aenights
-> the tag accrues a score in /api/trending-tags
-> it renders as a pill linking to /trends/tokens/AENIGHTS
-> someone creates the token at /trends/create
-> the pill gains a live price and 24h change
-> holders get a DAO, a treasury, a chat room and a moderation thresholdEach arrow is a different system. Only the first is on chain in the social contract; the token at the end is on chain in a different one; everything in between is the indexer.
Related
- Posting: where the tag is written, and the other content conventions.
- The Feed: topic feeds and the
trendingBoostranking signal. - Tokens overview: what a hashtag becomes once it has a token.
- Trending score: the token-side ranking this index feeds.
- Collections and naming: the character and length rules a tag must satisfy to become a token.