mirror of
https://github.com/tradecatlabs/vibe-coding-cn.git
synced 2026-08-02 05:37:45 +00:00
106 lines
17 KiB
Markdown
106 lines
17 KiB
Markdown
|
|
---
|
|||
|
|
name: ccxt
|
|||
|
|
description: CCXT cryptocurrency trading library. Use for cryptocurrency exchange APIs, trading, market data, order management, and crypto trading automation across 150+ exchanges. Supports JavaScript/Python/PHP.
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
# Ccxt Skill
|
|||
|
|
|
|||
|
|
Comprehensive assistance with ccxt development, generated from official documentation.
|
|||
|
|
|
|||
|
|
## When to Use This Skill
|
|||
|
|
|
|||
|
|
This skill should be triggered when:
|
|||
|
|
- Working with ccxt
|
|||
|
|
- Asking about ccxt features or APIs
|
|||
|
|
- Implementing ccxt solutions
|
|||
|
|
- Debugging ccxt code
|
|||
|
|
- Learning ccxt best practices
|
|||
|
|
|
|||
|
|
## Quick Reference
|
|||
|
|
|
|||
|
|
### Common Patterns
|
|||
|
|
|
|||
|
|
**Pattern 1:** Frequently Asked Questions I'm trying to run the code, but it's not working, how do I fix it? If your question is formulated in a short manner like the above, we won't help. We don't teach programming. If you're unable to read and understand the Manual or you can't follow precisely the guides from the CONTRIBUTING doc on how to report an issue, we won't help either. Read the CONTRIBUTING guides on how to report an issue and read the Manual. You should not risk anyone's money and time without reading the entire Manual very carefully. You should not risk anything if you're not used to a lot of reading with tons of details. Also, if you don't have the confidence with the programming language you're using, there are much better places for coding fundamentals and practice. Search for python tutorials, js videos, play with examples, this is how other people climb up the learning curve. No shortcuts, if you want to learn something. What is required to get help? When asking a question: Use the search button for duplicates first! Post your request and response in verbose mode! Add exchange.verbose = true right before the line you're having issues with, and copypaste what you see on your screen. It's written and mentioned everywhere, in the Troubleshooting section, in the README and in many answers to similar questions among previous issues and pull requests. No excuses. The verbose output should include both the request and response from the exchange. Include the full error callstack! Write your programming language and language version number Write the CCXT / CCXT Pro library version number Which exchange it is Which method you're trying to call Post your code to reproduce the problem. Make it a complete short runnable program, don't swallow the lines and make it as compact as you can (5-10 lines of code), including the exchange instantation code. Remove all irrelevant parts from it, leaving just the essence of the code to reproduce the issue. DON'T POST SCREENSHOTS OF CODE OR ERRORS, POST THE OUTPUT AND CODE IN PLAIN TEXT! Surround code and output with triple backticks: ```GOOD```. Don't confuse the backtick symbol (`) with the quote symbol ('): '''BAD''' Don't confuse a single backtick with triple backticks: `BAD` DO NOT POST YOUR apiKey AND secret! Keep them safe (remove them before posting)! I am calling a method and I get an error, what am I doing wrong? You're not reporting the issue properly ) Please, help the community to help you ) Read this and follow the steps: https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-submit-an-issue. Once again, your code to reproduce the issue and your verbose request and response ARE REQUIRED. Just the error traceback, or just the response, or just the request, or just the code – is not enough! I got an incorrect result from a method call, can you help? Basically the same answer as the previous question. Read and follow precisely: https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-submit-an-issue. Once again, your code to reproduce the issue and your verbose request and response ARE REQUIRED. Just the error traceback, or just the response, or just the request, or just the code – is not enough! Can you implement feature foo in exchange bar? Yes, we can. And we will, if nobody else does that before us. There's very little point in asking this type of questions, because the answer is always positive. When someone asks if we can do this or that, the question is not about our abilities, it all boils down to time and management needed for implementing all accumulated feature requests. Moreover, this is an open-source library which is a work in progress. This means, that this project is intended to be developed by the community of users, who are using it. What you're asking is not whether we can or cannot implement it, in fact you're actually telling us to go do that particular task and this is not how we see a voluntary collaboration. Your contributions, PRs and commits are welcome: https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-con
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
python tutorials
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**Pattern 2:** To create a market-buy order with cost, first, you need to check if the exchange supports that feature (exchange.has['createMarketBuyOrderWithCost']). If it does, then you can use the createMarketBuyOrderWithCost` method. Example:
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
exchange.has['createMarketBuyOrderWithCost']). If it does, then you can use the
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**Pattern 3:** Example: If you wanted to buy BTC/USDT with a market buy-order, you would need to provide an amount = 5 USDT instead of 0.000X. We have a check to prevent errors that explicitly require the price because users will usually provide the amount in the base currency.
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
create_order(symbol, 'market,' 'buy,' 10)
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**Pattern 4:** For a complete list of all exchanges and their supported methods, please, refer to this example: https://github.com/ccxt/ccxt/blob/master/examples/js/exchange-capabilities.js
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
exchange.rateLimit
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**Pattern 5:** The ccxt library supports asynchronous concurrency mode in Python 3.5+ with async/await syntax. The asynchronous Python version uses pure asyncio with aiohttp. In async mode you have all the same properties and methods, but most methods are decorated with an async keyword. If you want to use async mode, you should link against the ccxt.async_support subpackage, like in the following example:
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
ccxt.async_support
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
## Reference Files
|
|||
|
|
|
|||
|
|
This skill includes comprehensive documentation in `references/`:
|
|||
|
|
|
|||
|
|
- **cli.md** - Cli documentation
|
|||
|
|
- **exchanges.md** - Exchanges documentation
|
|||
|
|
- **faq.md** - Faq documentation
|
|||
|
|
- **getting_started.md** - Getting Started documentation
|
|||
|
|
- **manual.md** - Manual documentation
|
|||
|
|
- **other.md** - Other documentation
|
|||
|
|
- **pro.md** - Pro documentation
|
|||
|
|
- **specification.md** - Specification documentation
|
|||
|
|
|
|||
|
|
Use `view` to read specific reference files when detailed information is needed.
|
|||
|
|
|
|||
|
|
## Working with This Skill
|
|||
|
|
|
|||
|
|
### For Beginners
|
|||
|
|
Start with the getting_started or tutorials reference files for foundational concepts.
|
|||
|
|
|
|||
|
|
### For Specific Features
|
|||
|
|
Use the appropriate category reference file (api, guides, etc.) for detailed information.
|
|||
|
|
|
|||
|
|
### For Code Examples
|
|||
|
|
The quick reference section above contains common patterns extracted from the official docs.
|
|||
|
|
|
|||
|
|
## Resources
|
|||
|
|
|
|||
|
|
### references/
|
|||
|
|
Organized documentation extracted from official sources. These files contain:
|
|||
|
|
- Detailed explanations
|
|||
|
|
- Code examples with language annotations
|
|||
|
|
- Links to original documentation
|
|||
|
|
- Table of contents for quick navigation
|
|||
|
|
|
|||
|
|
### scripts/
|
|||
|
|
Add helper scripts here for common automation tasks.
|
|||
|
|
|
|||
|
|
### assets/
|
|||
|
|
Add templates, boilerplate, or example projects here.
|
|||
|
|
|
|||
|
|
## Notes
|
|||
|
|
|
|||
|
|
- This skill was automatically generated from official documentation
|
|||
|
|
- Reference files preserve the structure and examples from source docs
|
|||
|
|
- Code examples include language detection for better syntax highlighting
|
|||
|
|
- Quick reference patterns are extracted from common usage examples in the docs
|
|||
|
|
|
|||
|
|
## Updating
|
|||
|
|
|
|||
|
|
To refresh this skill with updated documentation:
|
|||
|
|
1. Re-run the scraper with the same configuration
|
|||
|
|
2. The skill will be rebuilt with the latest information
|