Exploring the DEX
Explore is the DEX's read-only side: every token the exchange indexes, every pair, and every transaction that has gone through the router. Use it to check a pair's depth before swapping, to find which pools a token is in, or to trace a transaction.
Everything on these pages comes from the DEX indexer over /api/dex/*, not from the chain
directly.
| View | Route | Answers |
|---|---|---|
| Tokens | /defi/explore/tokens | What can I trade, and how liquid is it? |
| Pools | /defi/explore/pools | Which pairs exist, and how busy are they? |
| Transactions | /defi/explore/transactions | What has been traded, by whom? |
Token and pool rows link to detail pages at /defi/explore/tokens/<address> and
/defi/explore/pools/<address>.
Tokens
Lists the tokens the DEX indexes, ten per page, ordered by 30-day volume, descending by default. Clicking a column you are already sorting by flips the direction; clicking a new one resets to descending. Each row carries Swap and Add actions that open the swap or add-liquidity form with that token pre-selected.
GET /api/dex/tokens
?order_by=<sort key>&order_direction=ASC|DESC
&listed=<true or false>&search=<text>&page=<n>&limit=<n>| Sort key | Meaning |
|---|---|
pairs_count | How many pools this token is in |
price | Current price |
24hchange, 7dchange, 30dchange | Price change over the window |
24hvolume, 7dvolume, 30dvolume | Traded volume over the window |
name, symbol | Alphabetical |
created_at | Listing age |
listed filters to listed or unlisted tokens; omit it to return both, which is what the web UI
shows. Tokens start unlisted, and the flag is set by the Superhero operator through the
API-key-protected POST /api/dex/tokens/<address>/listed.
Endpoints for a single token:
| Endpoint | Returns |
|---|---|
GET /api/dex/tokens/<address> | The token record |
GET /api/dex/tokens/<address>/price | Current price |
GET /api/dex/tokens/<address>/price/analysis | Price with liquidity analysis |
GET /api/dex/tokens/<address>/summary | Aggregated summary |
GET /api/dex/tokens/<address>/history | Historical series |
Pools
Lists every pair, searchable by token name or symbol, with two sort keys:
| Sort key | Meaning |
|---|---|
transactions_count | Busiest pools first |
created_at | Newest pools first |
A ?tokenAddress= query parameter filters to pools containing that token. This is how a token
detail page links through to its pools.
GET /api/dex/pairs
?order_by=transactions_count|created_at&order_direction=ASC|DESC
&token_address=<ct_...>&search=<text>&page=<n>&limit=<n>The pool detail page at /defi/explore/pools/<address> shows a header, a stats overview, current
reserves, a candlestick chart, pool composition and recent transactions:
| Endpoint | Feeds |
|---|---|
GET /api/dex/pairs/<address> | Header, reserves, composition |
GET /api/dex/pairs/<address>/summary | The stats overview |
GET /api/dex/pairs/<address>/history | Chart data, paginated |
GET /api/dex/pairs/<address>/preview | Compact preview payload |
For routing work, GET /api/dex/pairs/from/<from_token>/to/<to_token> resolves a direct pair,
and appending /providers returns the pairs that could serve those two tokens.
Transactions
A filterable feed of DEX transactions. Three filters combine:
- Transaction type: one of the router functions below, or All.
- Pair address: a
ct_pair contract. - Account address: one wallet's activity.
| Group | Types |
|---|---|
| Swaps | swap_exact_tokens_for_tokens, swap_tokens_for_exact_tokens, swap_exact_ae_for_tokens, swap_exact_tokens_for_ae, swap_tokens_for_exact_ae, swap_ae_for_exact_tokens |
| Liquidity | add_liquidity, add_liquidity_ae, remove_liquidity, remove_liquidity_ae |
The type names the shape of the trade: exact_tokens_for means the trader fixed the input,
tokens_for_exact means they fixed the output, and _ae means native AE was on one side and
the router wrapped it.
GET /api/dex/transactions
?order_by=created_at|tx_type&order_direction=ASC|DESC
&tx_type=<function name>&pair_address=<ct_...>&account_address=<ak_...>
&token_address=<ct_...>&from_date=<ISO-8601>&to_date=<ISO-8601>
&page=<n>&limit=<n>The date filters are inclusive on both ends and are not exposed in the UI. Single lookups:
GET /api/dex/transactions/<txHash> and GET /api/dex/transactions/pair/<pairAddress>.
Failed transactions do not appear in the feed. A reverted call emits no events, so there is nothing to index; the feed is a record of trades that happened.
How the figures are computed
Windows. Volume and price change come in three rolling windows (24h, 7d and 30d,
measured back from the moment the summary was last recomputed) plus an all-time total.
Everything is aggregated in AE, then converted. Per-pair volumes are summed, converted to an AE amount using the pair's own reserve ratio and token decimals, and only then multiplied by the AE rate for each supported currency:
| Field | What it is |
|---|---|
price.ae, volume.ae | The computed quantity |
price.usd, .eur, .gbp, … | That same number × the current AE rate |
The AE rate comes from CoinGecko, refreshed on a schedule and re-read at most every 30 seconds. A USD figure moving does not necessarily mean the pool moved; it may only mean AE did.
Price change compares the current price against the earliest in-window ratio of a candidate pair, skipping dust-state start ratios from near-empty pools so a single wei of liquidity cannot produce a multi-million-percent change.
How fresh the data is
| Data | Refresh |
|---|---|
| Pairs, swaps, liquidity events | Live, from the chain indexer's middleware WebSocket subscription |
| Token prices, token summaries, pair summaries | Every 10 minutes by default |
| AE fiat rates | Re-read at most every 30 seconds |
A swap shows up in the transaction feed promptly, while the token's price, volume and change columns can be up to ten minutes behind. The indexer reads the æternity middleware, so the middleware's own lag is the floor on all of it. For anything you are about to sign against, read the pair contract directly.
DEX tokens and community tokens
Both are "tokens on Superhero", and a community token can appear in both places if somebody has created a pool for it. They are different markets with different prices.
| Community token | DEX token | |
|---|---|---|
| Listed at | /trends/tokens | /defi/explore/tokens |
| API | /api/tokens | /api/dex/tokens |
| Price comes from | The exponential bonding curve | Pool reserve ratios |
| "Volume" means | Buys and sells against the curve | Swaps through pools |
| Has a DAO and a treasury | Yes | Only if it is also a community token |
See the full comparison on the DeFi overview.
Related
- Swapping: pick a pair here, then trade it.
- Liquidity Pools: check a pool's depth and volume before providing.
- DEX API: the full REST reference for these endpoints.
- Bonding curves: the other market, and why its prices differ.