DeFi & DEX
Exploring the DEX

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.

ViewRouteAnswers
Tokens/defi/explore/tokensWhat can I trade, and how liquid is it?
Pools/defi/explore/poolsWhich pairs exist, and how busy are they?
Transactions/defi/explore/transactionsWhat 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 keyMeaning
pairs_countHow many pools this token is in
priceCurrent price
24hchange, 7dchange, 30dchangePrice change over the window
24hvolume, 7dvolume, 30dvolumeTraded volume over the window
name, symbolAlphabetical
created_atListing 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:

EndpointReturns
GET /api/dex/tokens/<address>The token record
GET /api/dex/tokens/<address>/priceCurrent price
GET /api/dex/tokens/<address>/price/analysisPrice with liquidity analysis
GET /api/dex/tokens/<address>/summaryAggregated summary
GET /api/dex/tokens/<address>/historyHistorical series

Pools

Lists every pair, searchable by token name or symbol, with two sort keys:

Sort keyMeaning
transactions_countBusiest pools first
created_atNewest 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:

EndpointFeeds
GET /api/dex/pairs/<address>Header, reserves, composition
GET /api/dex/pairs/<address>/summaryThe stats overview
GET /api/dex/pairs/<address>/historyChart data, paginated
GET /api/dex/pairs/<address>/previewCompact 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.
GroupTypes
Swapsswap_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
Liquidityadd_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:

FieldWhat it is
price.ae, volume.aeThe 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

DataRefresh
Pairs, swaps, liquidity eventsLive, from the chain indexer's middleware WebSocket subscription
Token prices, token summaries, pair summariesEvery 10 minutes by default
AE fiat ratesRe-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 tokenDEX token
Listed at/trends/tokens/defi/explore/tokens
API/api/tokens/api/dex/tokens
Price comes fromThe exponential bonding curvePool reserve ratios
"Volume" meansBuys and sells against the curveSwaps through pools
Has a DAO and a treasuryYesOnly 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.