e.fu

e.fu

ccxt_client is a pure Elixir client for interacting with 110+ cryptocurrency exchanges through a unified API.
It is generated from the CCXT exchange specifications and requires no Node.js at runtime — just Elixir.

{:ccxt_client, "~> 0.1"}

Overview

The library provides a consistent, type-safe interface for both public market data and authenticated trading
operations across a large number of exchanges.

All exchange modules are generated at compile time from specifications extracted from the
CCXT project’s 7+ years of accumulated exchange knowledge.

Usage examples

Public endpoints (works on all exchanges)

{:ok, ticker} = CCXT.Binance.fetch_ticker("BTC/USDT")
{:ok, book} = CCXT.Kraken.fetch_order_book("ETH/USD")

Authenticated endpoints (trading, balances, etc.)

creds = CCXT.Credentials.new(api_key: "...", secret: "...")
{:ok, balance} = CCXT.Bybit.fetch_balance(creds)

{:ok, order} =
  CCXT.OKX.create_order(
    "BTC/USDT",
    "limit",
    "buy",
    0.001,
    50_000.0,
    creds
  )

How it works

Instead of hand-writing and maintaining 110+ exchange modules, ccxt_client is generated using a small set of
reusable patterns:

  1. Exchange specifications (endpoints, signing patterns, symbol formats, capabilities) are extracted from CCXT
  2. Exchange modules are generated via macros at compile time
  3. Requests are signed using 7 parameterized signing patterns that cover 95%+ of exchanges

This approach produces a large exchange surface area with minimal duplication and consistent behavior.

Features

  • Unified API across 110+ exchanges
  • Public endpoints: tickers, order books, trades, OHLCV
  • Authenticated endpoints: balances, orders, trading
  • Type-safe response structs
  • WebSocket support with automatic reconnection
  • Circuit breakers and rate limiting
  • Bidirectional symbol normalization (BTC/USDT ↔ BTCUSDT)
  • All exchanges compile and pass unit tests

Authenticated endpoints have been verified with real credentials on Deribit, Bybit, and a few other exchanges.

Where help is needed

While the signing implementations follow each exchange’s specification, many exchanges have not yet been tested
with real API credentials.

Community testing would be extremely valuable.

If you have an account on any exchange:

  1. Try a public endpoint:

    CCXT.YourExchange.fetch_ticker("BTC/USDT")
    
  2. Try an authenticated endpoint using testnet or sandbox credentials

  3. Report results (what worked / what didn’t) via GitHub issues

Every tested exchange improves the library for everyone.

Selective compilation

If you do not need all exchanges, you can limit which ones are compiled:

config :ccxt_client, exchanges: [:binance, :bybit, :okx]

Status

This is version v0.1.0 — early, but functional.
Feedback, issues, and pull requests are welcome.

Links

https://github.com/ZenHive/ccxt_client

Showing Posts 1 to 2

e.fu

e.fu OP

v0.2.0 released — WebSocket adapters, telemetry, and a breaking change

Quick update on ccxt_client. v0.2.0 is out with some significant improvements and one breaking change.


:warning: Breaking: Trading modules removed

CCXT.Trading.* modules (Greeks, Funding, Risk, Volatility, Options, etc.) have been extracted to a separate library. If you were using any of those modules, they’re no longer in ccxt_client.

ccxt_client is now a focused exchange-access library — HTTP, WebSocket, signing, symbol normalization, and types only. No changes to any exchange API functionality.

{:ccxt_client, "~> 0.2"}

What’s new

WebSocket Adapter

A managed GenServer that handles reconnection, subscription restoration, and auth state automatically:

{:ok, adapter} =
  CCXT.Bybit.WS.Adapter.start_link(
    url_path: [:public, :spot],
    handler: fn msg -> process_message(msg) end
  )

{:ok, sub} = CCXT.Bybit.WS.watch_ticker_subscription("BTC/USDT")
:ok = CCXT.Bybit.WS.Adapter.subscribe(adapter, sub)

The adapter:

  • Reconnects with exponential backoff
  • Re-subscribes to all active channels after reconnect
  • Handles auth re-authentication with state tracking
    (:unauthenticated → :authenticated → :expired)

The low-level CCXT.WS.Client is still available for short-lived connections where you manage lifecycle yourself.


Telemetry

Centralized event contract with attach/2 and detach/1 support:

CCXT.Telemetry.attach(:my_handler, fn event, measurements, metadata ->
  Logger.info("#{metadata.exchange} #{event}: #{measurements.duration}ms")
end)

Six events covering:

  • HTTP requests
  • WebSocket messages
  • Rate limiting
  • Circuit breaker state changes

Market Precision Metadata

Extract precision info from any exchange’s markets:

{:ok, markets} = CCXT.Binance.fetch_markets()
precisions = CCXT.MarketPrecision.from_markets(markets, :binance)
# => %{"BTC/USDT" => %CCXT.MarketPrecision{price: 2, amount: 5, ...}}

Handles all three CCXT precision modes:

  • Tick size
  • Decimals
  • Significant digits

Includes a TradingView-compatible price format helper.


Other improvements

  • Updated rate limit costs across all 10 Tier 1 exchange specs from upstream CCXT
  • Generator improvements: decoupled coercer/parser pipeline, version-override path prefix handling
  • Deribit bug fixes:
    • fetch_trades/1 arity
    • WS balance channel
    • WS ticker interval suffix

Still looking for testers

The ask from the original post still stands — if you have an account on any exchange, trying even a single endpoint and reporting what happens is enormously helpful:

CCXT.YourExchange.fetch_ticker("BTC/USDT")

Open an issue with what worked and what didn’t.


e.fu

e.fu OP

v0.4.0 — Compile-time 93% faster, named params, self-describing APIs

Hey all, sharing a progress update on ccxt_client. v0.4.0 is going up on Hex today.

Compile-time: 35s → 2.5s

The biggest win this release. Exchange modules used to inline the full pipeline per endpoint — Binance alone took 28 seconds. We replaced that with a shared runtime dispatcher (Dispatch.call/5) where generated functions are thin wrappers looking up pre-computed @endpoint_configs. Binance now compiles in ~1 second. .beam sizes dropped 85%.

# What the generator produces now (per endpoint):
def fetch_ticker(symbol, opts \\ []) do
  Dispatch.call(__MODULE__, :fetch_ticker, [symbol], opts, @endpoint_configs)
end

Named params everywhere

Positional arg0/arg1 replaced with actual parameter names across all 52 specs. Function signatures now read naturally:

# Before
CCXT.Binance.fetch_ohlcv(symbol, arg0, arg1, opts)

# After
CCXT.Binance.fetch_ohlcv(symbol, timeframe, since, opts)

Timeframe translation

Unified timeframes ("1h", "1d") are automatically translated to exchange-native formats ("60", "D") for both REST and WebSocket. No more checking what Phemex calls a daily candle.

# Just use standard timeframes — translation happens automatically
{:ok, candles} = CCXT.Phemex.fetch_ohlcv("BTC/USDT", "1d", credentials: creds)

Symbol format v2

Symbol normalization got significantly richer — forward_aliases, prefix handling, colon separators, and split_no_separator for exchanges that don’t use delimiters. Coverage went from basic delimiter mapping to handling most exchange quirks.

Self-describing APIs (Descripex)

Exchange modules now expose machine-readable metadata about their capabilities:

CCXT.Binance.__ccxt_spec__().endpoints
# Returns structured endpoint definitions with param types, defaults, etc.

This is groundwork for agent-consumable APIs — other tools (including AI agents) can discover what an exchange supports programmatically.

Other highlights

  • CCXT v4.5.42 sync — added Lighter (DEX), 4 new parse methods (TWAP, ADL rank)
  • 993 response transformers — column-oriented OHLCV, variable-length order book levels, bid/ask array coercion
  • CCXT.Health — quick exchange health checks (ping/2, latency/2, status/1)
  • Order sanity checks — validation on order responses
  • Sync verification script — scripts/verify_sync.sh validates nothing breaks across spec refreshes

Installation

{:ccxt_client, "~> 0.4"}

Still need your help testing

The library covers 107 exchanges, but most authenticated endpoints still need real-world validation. If you trade on any exchange and can spare 10 minutes with testnet credentials, open an issue with what works and what doesn’t. Every exchange tested helps everyone.

GitHub · Hex · Docs

— All posts loaded —

Where Next? Top

Trending in Announcing Top

type1fool
WebAuthnLiveComponent WebAuthnComponents See this post about renaming the package. Passwordless authentication for Phoenix LiveView app...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
kip
In 2021 I started a new library called Tempo with the objective of modelling time as a set of intervals - not as instants. In 2022 I gave...
New
quatermain
Hello, I’m sharing my plugin here in forum after some time so it has time to mature and proof yourself. I use Claude Code daily on a pr...
New
gtcode
Aloha gang, There’s a new class of AI model out from TypeSafe. Jev is their flagship model. You can learn about it here: ...
New
LostKobrakai
I’ve recently created a small library phoenix_vite integrating the vite build tooling with phoenix. It provides an igniter.installer t...
New

Other Trending Topics Top

dominicletz
Hey there, I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first. ...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
OndrejValenta
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly) AI dream has many faces, but general...
New
alexslade
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog It says that Fly is going all-in on sprites, which is a worry ...
New
CodeSync
Code BEAM Europe 2026 – Call for Talks is Open! We’re excited to announce that Code BEAM Europe 2026 is now open for talk submissions :t...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews