Skip to main content
GET
GET /tokens?chainId=137 returns the tokens Olympex lists on one chain: each token’s address, symbol, name, decimals and logo. Use it to fill a token picker and to convert amounts between human-readable units and base units. Take chainId from GET /chains, and cache the result: the list is large and changes rarely.

Choose the chain

  • chainId is required and must be a positive integer. Take it from GET /chains, which returns integers: 137 becomes ?chainId=137.
  • Send chainId as a plain decimal integer: ?chainId=137. GET /tokens also reads some other spellings, such as 0x89 or 137.0, as 137. Don’t rely on them.
  • chainId is the only query parameter. A missing, empty or non-numeric chainId, or any other query parameter, returns 400 VALIDATION_ERROR Invalid query parameters. error.details reports an unknown parameter under field chainId, for example "Unrecognized key: \"foo\"".
  • A chain that isn’t enabled returns 400 VALIDATION_ERROR with the message Chain <chainId> is not enabled.
  • The response echoes the chain as a number in data.chainId.
  • The query string is part of the signature: sign chainId=137 as the canonical query, and the empty string as the body, as for every GET.

Cache the list

The list holds hundreds of tokens per chain. It comes in one response, unsorted, unpaginated and uncompressed, even when you send Accept-Encoding: gzip, and it changes rarely. There is no ETag or Last-Modified header, so you can’t make a conditional request: refresh the list on a schedule.
  • Cache it per chain on your side, for example for 24 hours, instead of calling GET /tokens for every page view or quote.
  • Sort it yourself for display.
  • Every enabled chain has a token list. An empty tokens array or a 500 TOKEN_LIST_ERROR means the list couldn’t be read, not that the chain has no tokens: keep using your cached list and retry with backoff.

Match tokens by address

  • Identify a token by its address, never by its symbol. Symbols aren’t unique.
  • Compare addresses case-insensitively. Address casing varies between entries. Lowercase both sides, and key your cache by the lowercase address.
  • The native token is listed as 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee, the lowercase form of 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE. POST /quotes and POST /swap accept it in either casing, so compare it case-insensitively. Limit orders and DCA can’t sell it: use the wrapped token, for example WETH on Ethereum (0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2), WBNB on BNB Chain (0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c) or WPOL on Polygon (0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270).
  • POL on Polygon. The Polygon list also carries 0x0000000000000000000000000000000000001010, POL’s system contract, with the same symbol. Don’t offer it: it can’t be approved, and quotes can route it at prices unrelated to POL. Use the native pseudo-address for POL.
  • Symbols are labels, not identifiers. When several listed tokens share a symbol, some carry a numeric suffix such as STRK_1 or USDP_2, and the number can change when the list is refreshed. A few symbols also differ from the contract’s symbol() in case or have trailing spaces. Before you display a symbol, trim it and drop a trailing _<number>. Where you need the token’s real symbol, as a limit order’s tokenASymbol and tokenBSymbol do, read symbol() from the token contract.
  • Logos. icon is a logo URL, usually on cdn.olympex.io, or an empty string when there is no logo. Some URLs point to third-party hosts that may not serve the image, so show a fallback when a logo is empty or fails to load. Load logos with an <img> element: the CDN sends no CORS headers, so a browser fetch can’t read them. Some entries also carry logoURI.
  • Other fields can appear on an entry. Ignore the ones you don’t use.
A listed token doesn’t mean every pair has a route: request a quote to confirm a pair. The list doesn’t limit what you can trade either: quotes, swaps, limit orders and DCA strategies accept any valid token address, listed or not. The list has no ranking or verification flag.

Convert amounts with decimals

decimals converts between the two units the API uses. Conventions lists the unit of every amount field. USDC on Polygon has 6 decimals: a quote.outAmount of "10034668" is 10.034668 USDC, and an allowance of 10 USDC is 10000000 base units. Use integer or decimal arithmetic, never floating point.

Authorizations

x-api-key-id
string
header
required

Your API key ID (UUID). See Sign requests.

x-value-info
string
header
required

Base64 of timestamp + "\n" + nonce + "\n" + bodyHash, where timestamp is Unix seconds, nonce is 24 new hexadecimal characters and bodyHash is the unpadded base64url SHA-256 of the canonical body.

x-passphrase
string
header
required

Your account passphrase. Treat it like the secret key.

x-signature
string
header
required

Lowercase hex HMAC-SHA256 (signature v2), keyed with your secret key string (UTF-8, not decoded), of seven lines joined with \n, with no trailing newline: OLPX-HMAC-SHA256-V2, timestamp, nonce, the uppercase method, path, canonicalQuery and bodyHash. path is the request path including /api/v1, without the query string, for example /api/v1/limit-order/<id>. canonicalQuery is the query parameters decoded (+ is a space), sorted by key and then by value, re-encoded per RFC 3986 and joined with &, or the empty string when there is no query. Headers signed for one request are rejected on any other. See Sign requests.

Query Parameters

chainId
integer
required

Chain ID, for example 137. It must be one of the chains from GET /chains. No other query parameters are allowed.

Required range: x >= 1

Response

Tokens on the chain. Three entries shown; the real list has hundreds.

success
enum<boolean>
required
Available options:
true
data
object
required
meta
object
required