Currencies, markets and charts

Importing spot currencies and markets from KuCoin, what the dry-run plan protects, why imports arrive disabled, KuCoin's tick-size precision, and how the candle cache is built.

5 min readUpdated 3 August 2026markets, currencies, import, precision, charts

A working connection gets you nothing visible. Until you import from KuCoin and then enable what you imported, the platform has no currencies and no markets, and the trade page has nothing to show.

Both imports are preview-first. They tell you what they would change and write nothing until you confirm. Both used to be plain GETs that deleted rows on sight, which is why the confirmation exists.

Import currencies first

Admin → Finance → Currency → Spot (/admin/finance/currency/spot).

Reads the currency list from the active provider. Omit confirm for a dry run that returns the plan and writes nothing.

The dry run returns counts — toCreate, toUpdate, toDelete, a sample of the codes it would delete, and how many currencies you currently have enabled. Read the delete count before confirming. A currency that KuCoin has delisted is removed, and any wallet balance in it stops being manageable through the spot screens.

What the confirmed import writes, and what it deliberately does not:

  • New currencies are created with status: false. Nothing is listed to users until you enable it.
  • Existing currencies have their name, precision and fee refreshed. status is not touched. This is deliberate: re-importing to pick up a fee change used to switch off every currency you had enabled.
  • After a confirmed import, the price cron is kicked so the new rows get prices without waiting for the next tick.

KuCoin's precision is a tick size

ccxt reports currency precision either as a digit count (8) or as a tick size (1e-8), depending on the exchange. KuCoin reports tick sizes. The importer converts: a value below 1 is read as a tick size and turned into the number of decimals it implies; a whole number of 1 or more is already a digit count and is capped at 18.

The stored value is what the admin currency screens and the public /api/exchange/currency response present as that asset's decimals, so a wrong conversion is visible to users as an asset that cannot be traded in sensible sizes.

What the KuCoin network data does and does not carry

KuCoin's per-network payload is normalised into a common shape. Two fields differ from the other providers and are worth knowing:

  • There is no maximum withdrawal. KuCoin does not publish one, so maxWithdraw is stored as null. Any cap you want has to be a platform-side limit.
  • The memo flag is inferred. It is derived from whether the network carries a contract address, not from a memo field. Verify the memo requirement per asset against KuCoin before you rely on the imported flag — a wrong memo on a memo-chain deposit is how coins get lost.

Network minimums and withdrawal fees come through as published.

Then import markets

Admin → Finance → Exchange → Market (/admin/finance/exchange/market), the Import action.

Reads the market list from the active provider. Omit confirm for a dry run.

The importer keeps only markets that are active, have both price and amount precision, and are genuinely spot. Two filters exist specifically because of KuCoin:

Contract markets are dropped. ccxt loads KuCoin's spot, swap and futures markets in one call. Anything whose spot flag is not true, and any symbol containing a colon (BTC/USDT:USDT), is skipped. One contract symbol in exchange_market breaks multi-symbol calls with "kucoin symbols must be of the same type" and takes down the entire ticker batch, not just that pair.

Delisted markets are removed carefully. A market KuCoin no longer lists is a candidate for deletion, with two exceptions the plan reports:

  • Markets with OPEN orders are never removed. Each open order is holding inOrder against a user's balance; deleting the market would strand that money with nothing pointing at it. The plan reports these under keptForOpenOrders. Cancel the orders, then re-import.
  • Order history is never deleted. retainedOrderCount tells you how many order rows survive on markets being removed. A delisting does not un-happen the trades that occurred.

Watchlist entries pointing at removed markets are deleted — they are a user preference, not a record.

Imported markets arrive disabled

New markets are created with status: false. Importing three hundred KuCoin pairs does not list three hundred pairs. Enable the ones you want from the market table.

Both the single-market and bulk status endpoints are gated on edit.ecosystem.market, not edit.exchange.market. A role granted every *.exchange.market permission can view, edit and delete markets but cannot turn one on. Grant edit.ecosystem.market as well — see Permissions.

Bulk-enables or disables exchange markets by id.

Each market row also stores the taker and maker rates and the precision and limits that came from KuCoin. Editing a market lets you override them; the values the platform charges its own users are separate from what KuCoin charges you, and the fee comparison screen at /admin/finance/exchange/fee shows the two side by side per fee currency.

Order book depth

KuCoin accepts an order book depth of 5, 20, 50 or 100 — nothing else. When the browser asks for something in between, the backend snaps the request to the nearest allowed value and then trims the response back to the size that was asked for, so the display is correct even though the upstream request was not.

The frontend cooperates only if NEXT_PUBLIC_EXCHANGE="kuc" is set; that value selects the KuCoin depth ladder (50/50/100/100 by tick size) instead of Binance's much deeper one. Left at "bin" the browser asks for depths KuCoin will not serve, and the snapping on the backend is doing all the work.

Tickers

KuCoin is polled rather than streamed. Where other providers use watchTickers and accumulate updates on an interval, the KuCoin branch calls fetchTickers with retries and stops the batching interval, pushing each batch straight to subscribed clients and into the ticker cache.

That makes the ticker path the most rate-limit-sensitive part of the integration. If the platform trips KuCoin's limits, this is usually why — and the resulting ban marker silences every spot path, not just tickers.

Candle cache

Chart history is built once and cached, rather than proxied per request. Admin → Finance → Exchange → Chart (/admin/finance/exchange/chart).

The cache is written under data/chart as gzipped files with a Redis layer in front. Settings live in the settings table under the key chart_cache:

Setting Default Effect
cacheDays 30 How much history to fetch per market
rateLimit 500 Milliseconds between requests to KuCoin during a build
intervals 1m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 12h, 1d, 3d, 1w Which timeframes to build
autoUpdate Whether builds run without being asked
Starts a chart build for the named symbols and intervals. Progress is streamed over the build WebSocket.
Backfills gaps in one market and interval.
Clears cached candles, optionally from Redis and the file cache.

Do not lower rateLimit to speed up a large build. The chart settings response includes the current exchange ban status precisely because building too fast is the reliable way to get the whole platform throttled.

If you are using the Chart Engine addon instead of TradingView, that is selected separately under Admin → Trading → Settings via spotChartEngine.