e.fu

e.fu

ccxt_client - Elixir client for 110+ cryptocurrency exchanges

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/USDTBTCUSDT)
  • 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

Most Liked

e.fu

e.fu

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 scriptscripts/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

Where Next?

Popular in Announcing Top

asiniy
Hey there! I wrote a download elixir package which does exactly what its name about - an easy way to download files. I saw solutions ab...
New
ostinelli
Let’s write a database! Well not really, but I think it’s a little sad that there doesn’t seem to be a simple in-memory distributed KV da...
New
josevalim
Yes, yet another parser combinator library! Most of the parser combinators in the ecosystem are either compile-time, often using AST tra...
159 19228 141
New
gabrielpoca
Hello everyone! I want to share with you something that I’m really proud of: https://stillstatic.io/ Still is a static site builder for...
New
mtrudel
Bandit is an HTTP server for Plug and WebSock apps. Bandit is written entirely in Elixir and is built atop Thousand Island. It can serve...
New
Crowdhailer
Experimenting with this code. OK.try do user <- fetch_user(1) cart <- fetch_cart(1) order = checkout(cart, user) save_orde...
New
woylie
I released Doggo, a collection of unstyled Phoenix components. https://github.com/woylie/doggo Features Unstyled Phoenix components....
New
scohen
Lexical Lexical is a next-generation language server for the Elixir programming language. Features Context aware code completion As-you...
New
anshuman23
Hello all, I have been working on my proposed project called Tensorflex as part of Google Summer of Code 2018.. Tensorflex can be used f...
New
wfgilman
I’ve cleaned up and open sourced three financial libraries I was using for my company. They are bindings for the APIs of these three comp...
New

Other popular topics Top

danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 29377 241
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement