Skip to content

REST & CCXT API

The API behind the app.

A public REST API with a generated OpenAPI document, a CCXT-compatible perpetuals interface, and WebSocket streams for live market data. Reads are open to anyone, from anywhere, with no key.

Mainnet base
aftermath.finance/api
Testnet base
testnet.aftermath.finance/api
Public reads
No API key
CORS
Access-Control-Allow-Origin: *
Documented limit
1,000 req / 10 s
Spec
OpenAPI 1.0.0, MIT

Base URLs

Two hosts, one contract.

One base URL per network. Paths on this page are written relative to that base, exactly as they appear in the spec.

Mainnet
https://aftermath.finance/api
Testnet
https://testnet.aftermath.finance/api
Reference UI
https://aftermath.finance/docs
Spec title
Aftermath Finance API 1.0.0
shell
# No key, no signup. CORS is open to any origin.
curl https://aftermath.finance/api/perpetuals/markets

# The generated OpenAPI document behind the Swagger UI
curl https://aftermath.finance/api/openapi/spec.json

The spec is generated from the service with utoipa and published as JSON and YAML, so a client generator produces types that match what the server actually serves.

Authentication

Signatures, not keys.

There is no API key to issue, so there is none to leak. Authorization for user-scoped routes is a wallet signature, which means the account itself is the credential.

01

Public reads need nothing

Prices, markets, orderbooks, candles, pools, farms, staking, and chain config are open. No key, no registration, no origin restriction.

02

User routes sign a fixed string

User-scoped routes are authorized by a wallet signature over one fixed message: Aftermath Terms and Conditions. The user signs it once and the signature is reused.

03

A bearer token is optional

If you would rather carry a token than a signature, POST /auth/access-token exchanges the signature for an optional bearer token.

The signed message is the literal string Aftermath Terms and Conditions — no nonce, no timestamp, no domain separator to assemble.
Authorization docs

Limits and CORS

1,000 requests per 10 seconds.

That is the documented ceiling for the public API, and it is enough for most bots and dashboards. If your workload needs more, open a ticket in Discord with your sui-address and the rate you are asking for.

Documented limit
1,000 requests / 10 seconds
Key required
None for public reads
Higher limits
By request, in Discord
CORS
Any origin

Responses carry Access-Control-Allow-Origin: *, so a front end can call the API from the browser without a proxy.

Request a higher limit

Endpoint groups

What you can read.

Representative groups, not the full route list. The Swagger UI is generated from the running service and is the authoritative inventory.

GroupCovers
PricesCoin prices in USD.
CoinsCoin data.
RouterTrade routes, via trade-route.
PoolsPool data, including CoinGecko-format tickers.
PerpetualsConfig, markets, 24h stats, orderbooks, candles, funding history, order history.
Perpetuals vaultsVault data.
StakingafSUI APY, exchange rate, validator APYs, and TVL.
FarmsFarm data.
CCXTmarkets, ticker, orderbook, trades, OHLCV.
DEX ScreenerAdapter endpoints in DEX Screener format.
Chain config/sui/epoch and /addresses.
AuthPOST /auth/access-token for a bearer token.
WebSockets/perpetuals/ws/updates and per-market candle streams.

CCXT

Stock CCXT talks to the book.

CCXT ships an Aftermath exchange integration, so an existing trading bot points at Aftermath by changing one line. No Aftermath-specific client, no bespoke transport.

The API also serves CCXT-shaped routes directly — markets, ticker, orderbook, trades, and OHLCV — if you would rather call them over plain HTTP than through the library.

markets.py
import ccxt

exchange = ccxt.aftermath()
markets = exchange.load_markets()

print(list(markets))

Available in the Python, JavaScript, and PHP builds of CCXT. The market set is returned at runtime, so nothing is hardcoded on your side.

WebSockets

Live market data.

Polling is fine for history. For anything live, subscribe — the perpetuals stream carries orderbook, trade, candle, and position updates over a single connection.

A second stream returns candles for one market at a fixed interval, which is the cheaper subscription when all you render is a chart.

API documentation
streams
# Orderbook, trade, candle, and position updates
GET /perpetuals/ws/updates

# Candles for a single market at a fixed interval
GET /perpetuals/ws/market-candles/{market_id}/{interval_ms}

FAQ

Frequently asked questions

Read the full route list.

The Swagger UI is generated from the running service, so every route, parameter, and response shape on it is current.