{"id":32651625,"url":"https://github.com/pg56714/dcex","last_synced_at":"2026-06-06T07:01:56.689Z","repository":{"id":321230204,"uuid":"1074113000","full_name":"pg56714/dcex","owner":"pg56714","description":"A Lightweight Python Package for Low-Latency and Cross-Exchange Trading.","archived":false,"fork":false,"pushed_at":"2026-06-01T07:30:07.000Z","size":501,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-01T09:22:55.478Z","etag":null,"topics":["cex","crypto","cryptocurrency","dex","exchange","exchange-api","python","quant","quantitative-finance","quantitative-trading","quanttrading","trading"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/dcex/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pg56714.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-11T06:59:03.000Z","updated_at":"2026-06-01T07:30:12.000Z","dependencies_parsed_at":"2025-10-28T15:29:55.316Z","dependency_job_id":null,"html_url":"https://github.com/pg56714/dcex","commit_stats":null,"previous_names":["pg56714/dcex"],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/pg56714/dcex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pg56714%2Fdcex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pg56714%2Fdcex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pg56714%2Fdcex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pg56714%2Fdcex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pg56714","download_url":"https://codeload.github.com/pg56714/dcex/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pg56714%2Fdcex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33972398,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-06T02:00:07.033Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cex","crypto","cryptocurrency","dex","exchange","exchange-api","python","quant","quantitative-finance","quantitative-trading","quanttrading","trading"],"created_at":"2025-10-31T07:59:39.248Z","updated_at":"2026-06-06T07:01:56.683Z","avatar_url":"https://github.com/pg56714.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dcex - DEX \u0026 CEX trading library\n\n**Important**: No default broker tags are set. You may manually specify a broker tag within function arguments if needed.\n\n\u003e Forked from [krex](https://github.com/kairosresearchio/krex), a simplified version of the [ccxt](https://github.com/ccxt/ccxt) Python library.\n\n\u003e Originally created and maintained by the same contributor, this fork continues active development, building upon the original foundation with enhanced design, unified DEX + CEX support, and fixes for previously unresolved issues.\n\nA high-performance and lightweight Python library for interacting with cryptocurrency exchanges. dcex offers synchronous and asynchronous clients across multiple major exchanges, designed for speed, modularity, and ease of use.\n\nScope note: dcex focuses on market data, account queries, and trading/order APIs. External withdrawal creation endpoints are not currently wrapped, and options support is limited to exchange-specific APIs rather than the unified Product Table Manager.\n\n[![Python](https://img.shields.io/badge/python-3.12%2B-blue.svg)](https://python.org)\n[![License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![PyPI](https://img.shields.io/pypi/v/dcex)](https://badge.fury.io/py/dcex)\n\n## Installation\n\n```bash\npip install dcex\n```\n\nor use `uv` to manage the project:\n\n```bash\nuv add dcex\n```\n\n## Quick Start\n\n### Synchronous Usage\n\n```python\nimport dcex\n\nclient = dcex.binance()\n\nklines = client.get_klines(product_symbol=\"BTC-USDT-SWAP\", interval=\"1m\")\nprint(klines)\n```\n\n### Asynchronous Usage\n\n```python\nimport os\nimport asyncio\nimport dcex.async_support as dcex\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nBINANCE_API_KEY = os.getenv(\"BINANCE_API_KEY\")\nBINANCE_API_SECRET = os.getenv(\"BINANCE_API_SECRET\")\n\nasync def main():\n    client = await dcex.binance(\n        api_key=BINANCE_API_KEY,\n        api_secret=BINANCE_API_SECRET\n    )\n\n    try:\n        result = await client.get_income_history()\n        print(result)\n\n    finally:\n        await client.close()\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\n## Supported Exchanges\n\n| Exchange        | Sync Support | Async Support |\n| --------------- | ------------ | ------------- |\n| **Binance**     | Yes          | Yes           |\n| **Bybit**       | Yes          | Yes           |\n| **OKX**         | Yes          | Yes           |\n| **BitMart**     | Yes          | Yes           |\n| **BitMEX**      | Yes          | Yes           |\n| **Gate.io**     | Yes          | Yes           |\n| **Hyperliquid** | Yes          | Yes           |\n| **BingX**       | Yes          | Yes           |\n| **KuCoin**      | Yes          | Yes           |\n\n## Key Features\n\n- Product Table Manager for unifying trading instruments across exchanges\n- Sync and async API clients with consistent interfaces where available\n- Low-overhead HTTP clients for market data, account queries, and trading workflows\n- Opt-in live test suites for public, private, stateful, and generated-report endpoints\n\n## What is Product Table Manager (PTM)?\n\nPTM is a utility that standardizes and unifies trading instrument metadata across different exchanges, making cross-exchange strategy development easier.\n\nIt is a table that contains the following columns:\n\n| Column            | Description                                                                                                                                                                                                                |\n| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| exchange          | The exchange name                                                                                                                                                                                                          |\n| product_symbol    | The symbol we use to identify the product, it will be the same in different exchanges. For example, `BTC-USDT-SWAP` is the same product in Binance and Bybit, which named `BTCUSDT` in Binance and `BTC-USDT-SWAP` in OKX. |\n| exchange_symbol   | The symbol that the exchange actually uses                                                                                                                                                                                 |\n| product_type      | The normalized product type used by dcex, e.g. `spot`, `swap`, `futures`                                                                                                                                                   |\n| exchange_type     | The exchange-specific product type, e.g. `spot`, `linear`, `inverse`, `perpetual`, `delivery`                                                                                                                             |\n| base_currency     | The base currency, e.g. `BTC`                                                                                                                                                                                              |\n| quote_currency    | The quote currency, e.g. `USDT`                                                                                                                                                                                            |\n| price_precision   | The price precision, e.g. `0.000001`                                                                                                                                                                                       |\n| size_precision    | The size precision, e.g. `0.000001`                                                                                                                                                                                        |\n| min_size          | The minimum size, e.g. `0.000001`                                                                                                                                                                                          |\n| min_notional      | The minimum notional, e.g. `0.000001`                                                                                                                                                                                      |\n| size_per_contract | The size per contract. Sometimes 1 contract is not the same as 1 unit in exchanges like OKX.                                                                                                                               |\n\nOptions are not currently included in the unified PTM output. Some exchange-specific clients expose option-related parameters or market endpoints, but options are not normalized across exchanges.\n\n## How to use Product Table Manager?\n\nIn most cases, dcex handles product-symbol mapping internally. If you have a specific use case, you can use `ptm` to get the information you need.\n\n```python\nfrom dcex.utils.common import Common\nfrom dcex.product_table.manager import ProductTableManager\n\nptm = ProductTableManager.get_instance(Common.BINANCE)\n\nproduct_symbol = ptm.get_product_symbol(\n    exchange=Common.BINANCE,\n    exchange_symbol=\"BTCUSDT\",\n    product_type=\"swap\",\n)\n\nprint(product_symbol)\n```\n\n## Contributing\n\nWe welcome contributions. Please see our [Contributing Guide](.github/CONTRIBUTING.md) for details.\n\n## Testing\n\nThe default test suite is offline and does not require exchange API keys or network access:\n\n```bash\nuv run pytest\n```\n\nFor live, private, stateful, and generated-report test commands, see the\n[Contributing Guide](.github/CONTRIBUTING.md#testing).\n\n## Examples\n\nExamples are under `examples/sync` and `examples/async`. See\n[examples/README.md](examples/README.md) for the example conventions.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n## Support\n\n- **Issues**: Report bugs and request features on [GitHub Issues](https://github.com/pg56714/dcex/issues).\n- **Discussions**: Discuss ideas and share your thoughts on [GitHub Discussions](https://github.com/pg56714/dcex/discussions).\n\n## Disclaimer\n\nCryptocurrency trading involves significant risk. This library is provided as-is without any warranty. Users are responsible for their own trading decisions and risk management.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpg56714%2Fdcex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpg56714%2Fdcex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpg56714%2Fdcex/lists"}