Date: 2026-06-11
This is the first productized Elixir target checkpoint for the Binance-first CCXT Pro work. It is a Hex preview publication candidate for controlled Binance REST and Binance Pro integration work.
Release Boundary
This release is scoped to:
- Binance REST raw endpoint generation.
- Binance selected unified REST generation.
- Binance Pro high-level websocket method coverage.
- CCXT-style Pro instance configuration through
Ccxt.Pro.binance/1. - OTP-owned websocket lifecycle through
RegistryandDynamicSupervisor. - Public watch, stream, unwatch, cache, parser, telemetry, and cleanup flows.
- Private websocket API signing, request-id routing, response parsing, and read-only live smoke.
- Private user-data stream subscription, event routing, cache, snapshot preload, and lifecycle helpers.
- Order websocket API mutation support with explicit production risk gates.
- CCXT unified structure normalization and persistence planning helpers.
This release is not scoped to:
- General multi-exchange Elixir Pro support.
- Publishing to Hex.
- Full REST method maturity for every Binance funding/margin/savings mutation.
- Automatic safe execution of withdraw, transfer, borrow, repay, convert, or gift-code REST surfaces.
- Always-on live tests that require real fills or private liquidation events.
Package State
The Elixir package metadata now identifies this target as:
version: "0.1.0-binance-pro-preview"Recommended integration after publishing is through the Hex preview version:
{:ccxt, "== 0.1.0-binance-pro-preview"}smoke/consumer_app verifies the source-checkout consumption model from a
separate Mix project with:
{:ccxt, path: "../.."}The package includes:
libprivdocmix.exsREADME.md
Generated ExDoc output is written to _build/docs so it does not overwrite the
tracked doc source directory.
Supported User Entrypoints
Main modules:
Ccxt.ProCcxt.Pro.BinanceCcxt.Exchanges.BinanceCcxt.Raw.BinanceCcxt.StructureNormalizerCcxt.StructurePersistenceCcxt.StructureSchema
Production-style examples:
examples/pro_ticker_worker.exs: GenServer + Task.Supervisor public ticker worker that stores the latest ticker snapshot and performs explicit websocket cleanup.examples/pro_order_event_worker.exs: GenServer + Task.Supervisor private order event worker that authenticates once, reusesws_auth, and consumesstream_orders/4withnewUpdates: true.
Primary Pro usage:
binance =
Ccxt.Pro.binance(%{
apiKey: "...",
secret: "...",
binanceEnv: "prod",
options: %{recvWindow: 5_000}
})
{:ok, ticker} = Ccxt.Pro.Binance.watch_ticker(binance, "BTC/USDT")Public streams:
Ccxt.Pro.Binance.stream_ticker("BTC/USDT",
binance_env: "prod",
unwatch_on_halt: true
)
|> Enum.take(10)Connection shutdown:
Ccxt.Pro.connections()
|> Enum.each(&Ccxt.Pro.close_connection(&1.pid))Evidence Snapshot
Latest verified evidence recorded for this release:
npm run inspectElixirPro:107/107Binance Pro source methods covered.- Generated/runtime split:
66generated and41runtime-owned. unsupportedMethods: [].- Exchange instance wrappers:
52/52required callable public methods wrapped. - Runtime lifecycle coverage:
18/18required features covered. - Structure coverage:
44covered structure rows,71classified non-structure rows,0unclassified rows. npm run checkElixir:509 tests, 0 failures (60 excluded).mix test --include live --exclude prod_order_live test/ccxt_pro_binance_live_test.exs --timeout 180000:34 tests, 0 failures. This refreshed public streams and signed read-only private websocket/API paths without enabling production order placement.- Default long soak:
npm run testElixirProLongSoakran for901.0seconds with883ticker updates,1767websocket messages, maximum update gap2992ms, first update latency2353ms,0disconnects, and0terminations. - Production-style worker smoke:
CCXT_PRO_WORKER_SECONDS=5 mix run examples/pro_ticker_worker.exsreceived3public ticker updates forBTC/USDT, returned a snapshot withlast_error: nil, and then stopped the worker with explicit connection cleanup. - Production order live gate:
CCXT_PRO_ENABLE_PROD_ORDER_LIVE=true BINANCE_PROD_ORDER_SYMBOL=BTC/USDT BINANCE_PROD_ORDER_AMOUNT=0.0002 mix test --only prod_order_live test/ccxt_pro_binance_live_test.exs --timeout 180000ran3tests with0failures and31excluded, covering non-marketable production order create, fetch, edit, cancel, andstream_orders/4execution-report handling. - Private order event worker smoke:
BINANCE_PRO_ENV=prod CCXT_PRO_ORDER_EVENT_WORKER_SECONDS=90 mix run examples/pro_order_event_worker.exsran whileCCXT_PRO_ENABLE_PROD_ORDER_LIVE=true mix run examples/pro_safe_order_lifecycle.exscreated, fetched, edited, and canceled a non-marketableBTC/USDTorder. The worker received3private execution-report updates (NEW, original orderCANCELED, edited orderCANCELED), retained them in its final snapshot, and exited normally. The retry path also surfaced Binance-2035 User Data Stream subscription already active, which is recorded as an exchange lifecycle condition. - Path dependency consumer smoke:
npm run testElixirConsumercompiledsmoke/consumer_appwith{:ccxt, path: "../.."}and ran1live public Binance Pro test with0failures, coveringCcxt.Pro.binance/1,watch_ticker/2,stream_ticker/2, andCcxt.Pro.close_connection/1from outside the package project. - Hex package dry-run:
npm run buildElixirPackagebuiltccxt-0.1.0-binance-pro-preview.tarwith package metadata, runtime dependencies (jason,telemetry,websockex),lib,priv,doc,mix.exs, andREADME.md.mix hex.build --unpackalso succeeded; the unpacked package contained the runtime/docs payload, includingdoc/real-project-integration.mdanddoc/release-checklist.md, and excludedtest,examples, andsmoke. - Hex metadata audit:
mix.exskeeps the preview version0.1.0-binance-pro-preview, package nameCCXT Elixir, MIT license, CCXT source/doc links, package files limited tolib,priv,doc,mix.exs, andREADME.md, and ExDoc extras for the API reference, real project integration guide, release checklist, release note, target maturity record, cache/lifecycle/structure coverage docs, structure schema guide, and live testing plan. - Packaged consumer smoke:
npm run testElixirPackageConsumerbuilt and unpacked the local Hex package into a temporary directory, copiedsmoke/consumer_appinto a clean temporary consumer project, pointedCCXT_CONSUMER_CCXT_PATHat the unpacked package, and ran1live public Binance Pro test with0failures against the package payload. - Release preview gate:
npm run releaseElixirPreviewCheckrunscheckElixir,docsElixir, andtestElixirPackageConsumerin order. Latest local run completed all three phases, including docs generation and the packaged consumer smoke with1test and0failures. - Cache parity hardening:
Ccxt.Pro.IndexedArrayCacheadds reusable symbol/key-indexed cache semantics andCcxt.Pro.OrderCachenow uses it for symbol/id order replacement instead of id-only replacement. - Timestamp cache hardening:
Ccxt.Pro.TimestampArrayCacheadds reusable timestamp-indexed replacement semantics and Binance OHLCV public cache uses it for raw kline payloads keyed byk.t. - Position cache hardening:
Ccxt.Pro.PositionCachenow preserves Binance hedge-mode position updates bysymbol -> sidewhile keeping the existing per-symbol payload shape forwatch_positions/4. - New update counter hardening:
Ccxt.Pro.CacheUpdatesowns CCXT ProgetLimit-styleallNewUpdates,newUpdatesBySymbol, nested id/side, and timestamp counter semantics. Public cached watch streams and private list/order watchers can opt into that incremental window withnewUpdates: trueornew_updates: true.
Risk Policy
Public market data methods are safe to run against production because they do not require credentials and do not mutate exchange state.
Signed read-only methods require production, testnet, or demo credentials that match the selected environment.
Order mutation methods are available but must stay gated in automation:
create_order_ws/6edit_order_ws/7cancel_order_ws/3cancel_all_orders_ws/2
Production order tests require CCXT_PRO_ENABLE_PROD_ORDER_LIVE=true and use
non-marketable orders with immediate cancel when possible.
cancel_all_orders_ws/2 remains manual-confirmed only because it can cancel
unrelated user orders.
REST funding and account-mutation surfaces such as withdraw, transfer, borrow, repay, convert, and gift code are outside the Pro manifest and remain manual-confirmed/dry-run/signature-only work for this release.
Known Boundaries
- Binance-only Pro scope.
- The long soak evidence is 15 minutes, not yet 6-hour or 24-hour soak.
- Event-driven private live tests cannot deterministically prove real fills or private liquidations without causing actual account events.
- Hex publication metadata exists, but the intended consumption model is still local/path dependency.
- Generated modules should not be edited by hand. Update the generator or runtime-owned modules instead.
Release Commands
Normal local gate:
npm run checkElixir
Generate ExDoc output:
npm run docsElixir
Short long-soak sanity:
CCXT_PRO_LONG_SOAK_SECONDS=5 CCXT_PRO_LONG_SOAK_MIN_UPDATES=1 npm run testElixirProLongSoak
Default long soak:
npm run testElixirProLongSoak