ccxt-gateway
High-performance, self-hosted gateway for 100+ cryptocurrency exchanges via CCXT.
Features
- High Performance: Built with FastAPI, uvloop, and orjson for maximum throughput
- Rock Solid Stability: Multi-process design with automatic restart on failures
- Memory Management: Automatic subprocess restart when memory limits exceeded
- WebSocket Support: Proxy CCXT watch* functions via WebSocket connections
- Auto-Update: Automatic CCXT version management
- Unified API: Single REST and WebSocket API for all supported exchanges
Quick Start
Installation
# Clone the repository
git clone https://github.com/yourusername/ccxt-gateway.git
cd ccxt-gateway
# Install dependencies
pip install -e ".[server]"
Running
# Start the gateway
ccxt-gateway
# Or directly with Python
python -m ccxt_gateway.main
The gateway will start on http://0.0.0.0:8000 by default.
Basic Usage
# Create a Binance exchange instance
curl -X POST "http://localhost:8000/exchanges/my-binance?exchange_name=binance"
# Get ticker for BTC/USDT
curl "http://localhost:8000/exchanges/my-binance/fetch_ticker?symbol=BTC/USDT"
# Delete the exchange instance
curl -X DELETE "http://localhost:8000/exchanges/my-binance"
Configuration
Configuration is loaded from (in order):
- Environment variables (prefixed with
CCXT_GATEWAY_) .envfileconfig/default.yaml
See config/default.yaml for all available options.
API Documentation
Once running, visit:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
Architecture
Client -> FastAPI -> ZMQ Broker -> Exchange Subprocess (CCXT)
Each exchange runs in its own subprocess, communicating via ZeroMQ for isolation and stability.
Development
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Format code
black src/
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ccxt_gateway-1.8.0.tar.gz.
File metadata
- Download URL: ccxt_gateway-1.8.0.tar.gz
- Upload date:
- Size: 48.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3804007e4e9575ba2ce5d44f1ebdeab7e44eb9a21ad37fc58fec6ccfa15fa2f
|
|
| MD5 |
9ab6425c65ca856093b7d3cf603cc74e
|
|
| BLAKE2b-256 |
9629a0bc05a20af06ed6e408040df1e6f81f163f98927cc99e8e6ca829498942
|
Provenance
The following attestation bundles were made for ccxt_gateway-1.8.0.tar.gz:
Publisher:
pypi-ccxt.yml on BubbleParticles/Planar.jl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ccxt_gateway-1.8.0.tar.gz -
Subject digest:
c3804007e4e9575ba2ce5d44f1ebdeab7e44eb9a21ad37fc58fec6ccfa15fa2f - Sigstore transparency entry: 2431718814
- Sigstore integration time:
-
Permalink:
BubbleParticles/Planar.jl@6394bdadd7b30225929da4291ac231f151347561 -
Branch / Tag:
refs/tags/v1.8.0 - Owner: https://github.com/BubbleParticles
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-ccxt.yml@6394bdadd7b30225929da4291ac231f151347561 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ccxt_gateway-1.8.0-py3-none-any.whl.
File metadata
- Download URL: ccxt_gateway-1.8.0-py3-none-any.whl
- Upload date:
- Size: 33.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91c08339b59589b15fd1c2c67ef15f89656c02b282dbc03c126cfa4ce8775149
|
|
| MD5 |
d56e2a63e5bb13d1cbd6d2d92b6affbd
|
|
| BLAKE2b-256 |
975152e2c17aef411f365cd20272e64d44138231b8d6dd50cff901dd47d57083
|
Provenance
The following attestation bundles were made for ccxt_gateway-1.8.0-py3-none-any.whl:
Publisher:
pypi-ccxt.yml on BubbleParticles/Planar.jl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ccxt_gateway-1.8.0-py3-none-any.whl -
Subject digest:
91c08339b59589b15fd1c2c67ef15f89656c02b282dbc03c126cfa4ce8775149 - Sigstore transparency entry: 2431718957
- Sigstore integration time:
-
Permalink:
BubbleParticles/Planar.jl@6394bdadd7b30225929da4291ac231f151347561 -
Branch / Tag:
refs/tags/v1.8.0 - Owner: https://github.com/BubbleParticles
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-ccxt.yml@6394bdadd7b30225929da4291ac231f151347561 -
Trigger Event:
push
-
Statement type: