Metadata-Version: 2.5
Name: ccxt-gateway
Version: 1.8.0
Summary: High-performance self-hosted gateway for 100+ crypto exchanges via CCXT
Author: ccxt-gateway contributors
License: MIT
License-File: LICENSE
Requires-Python: >=3.11
Requires-Dist: aiofiles>=24.1.0
Requires-Dist: ccxt[pro]>=4.4.0
Requires-Dist: fastapi>=0.115.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: orjson>=3.10.0
Requires-Dist: packaging>=24.0
Requires-Dist: psutil>=6.0.0
Requires-Dist: pydantic-settings>=2.14.2
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: pyyaml>=6.0.0
Requires-Dist: pyzmq>=26.0.0
Requires-Dist: setuptools>=83.0.0
Requires-Dist: uvicorn[standard]>=0.30.0
Requires-Dist: uvloop>=0.20.0
Provides-Extra: dev
Requires-Dist: httpx>=0.27.0; extra == 'dev'
Requires-Dist: mypy>=1.10.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
Requires-Dist: pytest-cov>=5.0.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: types-pyyaml>=6.0.0; extra == 'dev'
Requires-Dist: types-requests>=2.31.0; extra == 'dev'
Provides-Extra: server
Requires-Dist: granian>=1.4.0; extra == 'server'
Description-Content-Type: text/markdown

# 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

```bash
# Clone the repository
git clone https://github.com/yourusername/ccxt-gateway.git
cd ccxt-gateway

# Install dependencies
pip install -e ".[server]"
```

### Running

```bash
# 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

```bash
# 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):
1. Environment variables (prefixed with `CCXT_GATEWAY_`)
2. `.env` file
3. `config/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

```bash
# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Format code
black src/
```

## License

MIT
