refactor: 重构目录结构以支持 i18n

创建 'i18n' 目录以存放多语言内容。将所有现有的中文内容(文档、提示词、技能、README)移动到 'i18n/zh/' 中。添加了新的根 README 作为语言入口,并为英文('en')翻译创建了占位符结构。
This commit is contained in:
tukuaiai
2025-12-16 21:30:13 +08:00
parent 1b235161ec
commit 624ef8d5f9
199 changed files with 674 additions and 654 deletions
-133
View File
@@ -1,133 +0,0 @@
---
name: hummingbot
description: Hummingbot trading bot framework - automated trading strategies, market making, arbitrage, connectors for crypto exchanges. Use when working with algorithmic trading, crypto trading bots, or exchange integrations.
---
# Hummingbot Skill
Comprehensive assistance with hummingbot development, generated from official documentation.
## When to Use This Skill
This skill should be triggered when:
- Working with hummingbot
- Asking about hummingbot features or APIs
- Implementing hummingbot solutions
- Debugging hummingbot code
- Learning hummingbot best practices
## Quick Reference
### Common Patterns
**Pattern 1:** For example: candles = [CandlesFactory.get_candle(connector=kucoin, trading_pair="ETH-USDT", interval="1m", max_records=100)]
```
candles = [CandlesFactory.get_candle(connector=kucoin,
trading_pair="ETH-USDT", interval="1m", max_records=100)]
```
**Pattern 2:** Example:
```
bin/hummingbot_quickstart.py -p a -f simple_pmm_example_config.py -c conf_simple_pmm_example_config_1.yml
```
**Pattern 3:** >>> gateway swap --help usage: gateway swap [-h] [connector] [args ...] positional arguments: connector Connector name/type (e.g., jupiter/router) args Arguments: [base-quote] [side] [amount] options: -h, --help show this help message and exit
```
>>> gateway swap --help
usage: gateway swap [-h] [connector] [args ...]
positional arguments:
connector Connector name/type (e.g., jupiter/router)
args Arguments: [base-quote] [side] [amount]
options:
-h, --help show this help message and exit
```
**Pattern 4:** usage: gateway list [-h]
```
usage: gateway list [-h]
```
**Pattern 5:** Example:
```
price = self.market_data_provider.get_price_by_type('binance', 'BTC-USDT', PriceType.MidPrice)
```
**Pattern 6:** Example:
```
price = self.market_data_provider.get_price_by_volume('binance', 'BTC-USDT', volume: 10000, True)
```
**Pattern 7:** Example:
```
price = self.market_data_provider.get_volume_for_price('binance', 'BTC-USDT', 70000, True)
```
**Pattern 8:** Example:
```
price = self.market_data_provider.get_order_book_snapshot('binance', 'BTC-USDT')
```
## Reference Files
This skill includes comprehensive documentation in `references/`:
- **advanced.md** - Advanced documentation
- **configuration.md** - Configuration documentation
- **connectors.md** - Connectors documentation
- **development.md** - Development documentation
- **getting_started.md** - Getting Started documentation
- **other.md** - Other documentation
- **strategies.md** - Strategies documentation
- **trading.md** - Trading documentation
- **troubleshooting.md** - Troubleshooting 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
-255
View File
@@ -1,255 +0,0 @@
# Hummingbot - Advanced
**Pages:** 7
---
##
**URL:** https://hummingbot.org/dashboard/backtest.png
---
##
**URL:** https://hummingbot.org/dashboard/backtest-2.png
---
##
**URL:** https://hummingbot.org/assets/img/backtesting.png
---
##
**URL:** https://hummingbot.org/dashboard/backtest-1.png
---
## Check Performance - Hummingbot
**URL:** https://hummingbot.org/client/history
**Contents:**
- Performance History¶
- History command¶
- How It Works¶
- Sample Output¶
- Average Price¶
- Hold Portfolio Value¶
- Current Portfolio Value¶
- Trade P&L¶
- Total P&L¶
- Return Percentage¶
The history command displays the current duration of total past trades, asset inventory and value, and market trading pair performance. Run history --verbose to see all recent trades.
Trades are saved locally in a .csv file located in the data folder which you can view by running history --verbose --days command even after you restart Hummingbot.
Optional argument --precision specifies the number of decimal values.
This block below shows the calculation for some of the values displayed in the history output.
The Return % in the navbar at the bottom of Hummingbot client may be different from the history command output. This is because the Return % in history takes the price changes into calculation while the navbar in the bottom UI does not.
Run the history command in Hummingbot to display the current duration of total past trades, asset inventory and value, market trading pair performance.
The following displays the formula for key calculations:
For more details on the calculations, please see this Google Sheet.
Avg Price = Total trade volume of quote/Total trade volume of base asset.
In the sample output, the total avg price is 6.91/47423 = 0.0001457
This value means the average price of total MFT/BNB trades is 0.0001457
The asset value from the start to the end with no trades.
Hold portfolio value = (base start asset*current market price)+ quote start asset
From the above example, for the Hold portfolio value is (155248*0.0000809)+23.33=35.89
Current portfolio value = (base current asset*current market price)+ quote current asset
From the above example, for the Current portfolio value is (202671*0.0000809)+16.419=32.815
Trade P&L = Current portfolio value - Hold Portfolio value
From the above example, for the Trade P&L value is 32.815-35.89=-3.075
Total P&L = Trade P&L + Fees paid
From the above example, for the Total P&L is -3.075 + -0.428 = -3.504
Return% = Total P&L/Hold portfolio value
From the above example, for the Return% is -3.075/-35.89 = -9.76%
The Return % (bottom navbar) matches the calculated return on History after the last trade, see following screenshot:
**Examples:**
Example 1 (unknown):
```unknown
Avg price = total trade volume of quote / total trade volume of base asset
Hold portfolio value = (base start asset * current market price) + quote start asset
Current portfolio value = (base current asset * current market price) + quote current asset
Trade P&L = current portfolio value - hold portfolio value
Total P&L = trade P&L + fees paid
Return % = total P&L / hold portfolio value
```
Example 2 (unknown):
```unknown
>>> history
Start Time: 2020-11-11 00:56:37
Current Time: 2020-11-11 12:57:22
Duration: 0 days 12:00:45
binance / MFT-BNB
Trades:
buy sell total
Number of trades 113 97 209
Total trade volume (BTC) 2181335 -2133912 47423
Total trade volume (USDT) -217,67 210.76 -6.91
Avg price 0.0000998 0.0000988 0.0001457
Assets:
Start Current Change
MFT 155248 202671 47423
BNB 23.331 16.419 -6.912
MFT/BNB price 0.0001076 0.0000809 -0.0000267
Base asset % 41.7% 50.0% 8.2%
Performance:
Hold portfolio value 35.890 BNB
Current portfolio value 32.815 BNB
Trade P&L -3.075 BNB
Fees paid -0.428 BNB
Total P&L -3.504 BNB
Return %: -9.76%
```
---
##
**URL:** https://hummingbot.org/dashboard/backtest-3.png
---
## Check Performance - Hummingbot
**URL:** https://hummingbot.org/client/history/
**Contents:**
- Performance History¶
- History command¶
- How It Works¶
- Sample Output¶
- Average Price¶
- Hold Portfolio Value¶
- Current Portfolio Value¶
- Trade P&L¶
- Total P&L¶
- Return Percentage¶
The history command displays the current duration of total past trades, asset inventory and value, and market trading pair performance. Run history --verbose to see all recent trades.
Trades are saved locally in a .csv file located in the data folder which you can view by running history --verbose --days command even after you restart Hummingbot.
Optional argument --precision specifies the number of decimal values.
This block below shows the calculation for some of the values displayed in the history output.
The Return % in the navbar at the bottom of Hummingbot client may be different from the history command output. This is because the Return % in history takes the price changes into calculation while the navbar in the bottom UI does not.
Run the history command in Hummingbot to display the current duration of total past trades, asset inventory and value, market trading pair performance.
The following displays the formula for key calculations:
For more details on the calculations, please see this Google Sheet.
Avg Price = Total trade volume of quote/Total trade volume of base asset.
In the sample output, the total avg price is 6.91/47423 = 0.0001457
This value means the average price of total MFT/BNB trades is 0.0001457
The asset value from the start to the end with no trades.
Hold portfolio value = (base start asset*current market price)+ quote start asset
From the above example, for the Hold portfolio value is (155248*0.0000809)+23.33=35.89
Current portfolio value = (base current asset*current market price)+ quote current asset
From the above example, for the Current portfolio value is (202671*0.0000809)+16.419=32.815
Trade P&L = Current portfolio value - Hold Portfolio value
From the above example, for the Trade P&L value is 32.815-35.89=-3.075
Total P&L = Trade P&L + Fees paid
From the above example, for the Total P&L is -3.075 + -0.428 = -3.504
Return% = Total P&L/Hold portfolio value
From the above example, for the Return% is -3.075/-35.89 = -9.76%
The Return % (bottom navbar) matches the calculated return on History after the last trade, see following screenshot:
**Examples:**
Example 1 (unknown):
```unknown
Avg price = total trade volume of quote / total trade volume of base asset
Hold portfolio value = (base start asset * current market price) + quote start asset
Current portfolio value = (base current asset * current market price) + quote current asset
Trade P&L = current portfolio value - hold portfolio value
Total P&L = trade P&L + fees paid
Return % = total P&L / hold portfolio value
```
Example 2 (unknown):
```unknown
>>> history
Start Time: 2020-11-11 00:56:37
Current Time: 2020-11-11 12:57:22
Duration: 0 days 12:00:45
binance / MFT-BNB
Trades:
buy sell total
Number of trades 113 97 209
Total trade volume (BTC) 2181335 -2133912 47423
Total trade volume (USDT) -217,67 210.76 -6.91
Avg price 0.0000998 0.0000988 0.0001457
Assets:
Start Current Change
MFT 155248 202671 47423
BNB 23.331 16.419 -6.912
MFT/BNB price 0.0001076 0.0000809 -0.0000267
Base asset % 41.7% 50.0% 8.2%
Performance:
Hold portfolio value 35.890 BNB
Current portfolio value 32.815 BNB
Trade P&L -3.075 BNB
Fees paid -0.428 BNB
Total P&L -3.504 BNB
Return %: -9.76%
```
---
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-39
View File
@@ -1,39 +0,0 @@
# Hummingbot Documentation Index
## Categories
### Advanced
**File:** `advanced.md`
**Pages:** 7
### Configuration
**File:** `configuration.md`
**Pages:** 24
### Connectors
**File:** `connectors.md`
**Pages:** 100
### Development
**File:** `development.md`
**Pages:** 13
### Getting Started
**File:** `getting_started.md`
**Pages:** 24
### Other
**File:** `other.md`
**Pages:** 75
### Strategies
**File:** `strategies.md`
**Pages:** 73
### Trading
**File:** `trading.md`
**Pages:** 3
### Troubleshooting
**File:** `troubleshooting.md`
**Pages:** 1
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-258
View File
@@ -1,258 +0,0 @@
# Hummingbot - Trading
**Pages:** 3
---
## Overview - Hummingbot
**URL:** https://hummingbot.org/gateway/
**Contents:**
- Overview
- What is Gateway?¶
- In This Section¶
- Key Features¶
- Connector Schemas¶
- Installation¶
- Architecture¶
- Governance and Maintenance¶
- Contributing¶
- History¶
Hummingbot Gateway is a Typescript-based API server that standardizes interactions with blockchain networks and decentralized exchanges (DEXs). It acts as a middleware layer, providing a unified interface for performing actions like checking balances, executing trades, and managing wallets across different protocols.
Gateway is a companion service to the Python-based Hummingbot client, exposing standardized REST API endpoints for trading and liquidity-related functionality on DEXs. This enables Hummingbot to run strategies that operate across both centralized (CEX) and decentralized exchanges seamlessly.
For detailed implementation guides and examples for each schema, see DEX Connectors.
Gateway can be installed alongside Hummingbot to enable trading on AMM DEXs, or as a standalone API server. For detailed installation instructions, see Installation & Setup.
When running Gateway in DEV mode, access the interactive Swagger API documentation at: http://localhost:15888/docs
Gateway follows a modular architecture with clear separation of concerns:
Like other connectors, Gateway DEX connectors require ongoing maintenance: fixing bugs, addressing user issues, and keeping up with updates to both the exchange/blockchain API as well as improvements to the Hummingbot connector standard.
Hummingbot Foundation maintains certain reference connectors as the standard and utilizes a community-based maintenance process. We assign Bounties to community developers to upgrade and fix bugs for each exchange's connectors in the codebase.
Each quarter, Exchange Connector Polls allocates HBOT bounties toward the top CEX connectors and determines which exchange connectors should be included in the codebase going forward. This process also determines which blockchains and networks that Gateway supports.
See the Connector Pots tab in HBOT Tracker for the current allocations for each exchange.
Gateway is part of the open source Hummingbot project. Ways to contribute:
For more information about Gateway's history and architecture decisions, see:
**Examples:**
Example 1 (javascript):
```javascript
/src
├── chains/ # Blockchain-specific implementations
│ └── {chain}/ # Each blockchain (ethereum, solana, etc.)
├── connectors/ # DEX-specific implementations
│ ├── {dex}/ # Each DEX connector directory
│ │ ├── router-routes/ # DEX aggregator operations
│ │ ├── amm-routes/ # AMM pool operations
│ │ └── clmm-routes/ # Concentrated liquidity operations
├── services/ # Core services (config, logging, tokens)
├── schemas/ # API request/response schemas
├── templates/ # Base classes and interfaces for connectors
├── tokens/ # Token lists and metadata
├── pools/ # Liquidity pool configurations
└── wallet/ # Wallet management
```
---
## Overview - Hummingbot
**URL:** https://hummingbot.org/gateway
**Contents:**
- Overview
- What is Gateway?¶
- In This Section¶
- Key Features¶
- Connector Schemas¶
- Installation¶
- Architecture¶
- Governance and Maintenance¶
- Contributing¶
- History¶
Hummingbot Gateway is a Typescript-based API server that standardizes interactions with blockchain networks and decentralized exchanges (DEXs). It acts as a middleware layer, providing a unified interface for performing actions like checking balances, executing trades, and managing wallets across different protocols.
Gateway is a companion service to the Python-based Hummingbot client, exposing standardized REST API endpoints for trading and liquidity-related functionality on DEXs. This enables Hummingbot to run strategies that operate across both centralized (CEX) and decentralized exchanges seamlessly.
For detailed implementation guides and examples for each schema, see DEX Connectors.
Gateway can be installed alongside Hummingbot to enable trading on AMM DEXs, or as a standalone API server. For detailed installation instructions, see Installation & Setup.
When running Gateway in DEV mode, access the interactive Swagger API documentation at: http://localhost:15888/docs
Gateway follows a modular architecture with clear separation of concerns:
Like other connectors, Gateway DEX connectors require ongoing maintenance: fixing bugs, addressing user issues, and keeping up with updates to both the exchange/blockchain API as well as improvements to the Hummingbot connector standard.
Hummingbot Foundation maintains certain reference connectors as the standard and utilizes a community-based maintenance process. We assign Bounties to community developers to upgrade and fix bugs for each exchange's connectors in the codebase.
Each quarter, Exchange Connector Polls allocates HBOT bounties toward the top CEX connectors and determines which exchange connectors should be included in the codebase going forward. This process also determines which blockchains and networks that Gateway supports.
See the Connector Pots tab in HBOT Tracker for the current allocations for each exchange.
Gateway is part of the open source Hummingbot project. Ways to contribute:
For more information about Gateway's history and architecture decisions, see:
**Examples:**
Example 1 (javascript):
```javascript
/src
├── chains/ # Blockchain-specific implementations
│ └── {chain}/ # Each blockchain (ethereum, solana, etc.)
├── connectors/ # DEX-specific implementations
│ ├── {dex}/ # Each DEX connector directory
│ │ ├── router-routes/ # DEX aggregator operations
│ │ ├── amm-routes/ # AMM pool operations
│ │ └── clmm-routes/ # Concentrated liquidity operations
├── services/ # Core services (config, logging, tokens)
├── schemas/ # API request/response schemas
├── templates/ # Base classes and interfaces for connectors
├── tokens/ # Token lists and metadata
├── pools/ # Liquidity pool configurations
└── wallet/ # Wallet management
```
---
## Overview - Hummingbot
**URL:** https://hummingbot.org/hummingbot-api/
**Contents:**
- Hummingbot API¶
- Overview¶
- Key Features¶
- Architecture¶
- Key Components¶
- Use Cases¶
- Getting Started¶
- API Routers¶
- 🐳 Docker Management¶
- 💼 Account Management¶
The backend-api has been renamed to hummingbot-api, marking a major revamp of the codebase with improvements in architecture, modularity, and developer experience.
Hummingbot API is a comprehensive RESTful API framework designed for managing trading operations across multiple exchanges. It allows individual traders and teams to deploy custom, private servers for trade execution, portfolio management, and data collection, bot deployment, and other use cases.
GitHub Repository: github.com/hummingbot/hummingbot-api
The Hummingbot API enables various trading applications:
The guides include Docker setup and Python API client examples to get you trading in minutes.
The Hummingbot API provides the following key routers:
Manage Docker containers and instances running Hummingbot
Handle exchange account credentials and configurations
Discover and manage available exchange connectors
Monitor and analyze portfolio performance across exchanges
Execute trades, manage orders, and monitor positions
Configure and deploy trading strategies with real-time updates
Access real-time and historical market data
Deploy, configure, and manage multiple bot instances
Run strategy backtests with historical data
The API uses HTTP Basic Authentication:
A modern, asynchronous Python client is available for interacting with the Hummingbot API. This client is used by the Hummingbot Dashboard as the interface layer for all API communications.
**Examples:**
Example 1 (unknown):
```unknown
graph TB
subgraph "Clients"
direction LR
CUSTOM[Custom Apps]
DASH[Hummingbot<br/>Dashboard]
AI[AI Agents]
end
subgraph "Hummingbot API"
direction LR
API["FastAPI<br/>Server<br/>"]
PG[(PostgreSQL<br/>Database)]
MQTT[EMQX<br/>Message Broker]
end
subgraph "Bots"
BOTS[Hummingbot<br/>Instances]
end
subgraph "Exchanges"
EX[Binance, OKX,<br/>Hyperliquid, etc.]
end
%% Client connections using API Client
DASH -->|Hummingbot API Client| API
%% Bot connections
BOTS <-->|Commands & Updates| MQTT
%% Exchange connections
BOTS <-->|Trade & Data| EX
API <-->|Trade & Data| EX
%% Apply theme colors
classDef clientStyle stroke:#5FFFD7,stroke-width:3px
classDef apiStyle stroke:#00B1BB,stroke-width:3px
classDef botsStyle stroke:#E549FF,stroke-width:3px
class DASH clientStyle
class API,PG,MQTT apiStyle
class BOTS botsStyle
```
Example 2 (unknown):
```unknown
pip install hummingbot-api-client
```
Example 3 (python):
```python
from hummingbot_api_client import HummingbotAPIClient
# Initialize client
client = HummingbotAPIClient(
base_url="http://localhost:8000",
username="your-username",
password="your-password"
)
# Get portfolio data
portfolio = await client.get_portfolio()
# Execute a trade
order = await client.create_order(
connector="binance",
trading_pair="BTC-USDT",
order_type="limit",
side="buy",
amount=0.001,
price=50000
)
```
---
@@ -1,87 +0,0 @@
# Hummingbot - Troubleshooting
**Pages:** 1
---
## Troubleshooting - Hummingbot
**URL:** https://hummingbot.org/troubleshooting/
**Contents:**
- Troubleshooting
- Installation¶
- Docker: Permission denied error¶
- Source: conda command not found¶
- Source: ./install: line 40 ... Killed¶
- Source: Could not find conda environment: hummingbot¶
- Source: unable to execute gcc: No such file or directory¶
- Dashboard¶
- Failed to connect MQTT Bridge:¶
- Docker is not running. Please start Docker and refresh the page.¶
The error message above indicates a permission issue while trying to access the Docker daemon socket. This is a common problem when trying to run Docker commands as a non-root user. To add your user to the docker group, use the following command:
Ensure Anaconda, Miniconda, or Miniforge (for arm64 systems) is installed. If you've just installed it, restart your terminal to refresh the command line environment.
Collecting package metadata (repodata.json): / ./install: line 40: 14981 Killed... This error shows up during installation, typically on systems with 2GB RAM or less. Increase your system's RAM to at least 4GB, or consider adding a swap file if upgrading hardware is not feasible.
This is related to the issue above. Check if there are any errors after running the ./install script. If there are, you'll need to solve those first otherwise creating the hummingbot conda environment will fail.
If getting this error you'll need to install the build-essential package. Run the command below to install -
If you get this error, this usually means the Hummingbot Broker is not running, start the Broker from the Instances page and then restart all Hummingbot client instances.
Make sure you have Docker installed. On Windows and MacOS machines make sure you have Docker Desktop running in the background.
Note: The name of the missing module could be something else like st_pages etc. If you get this message this means the environment wasn't installed properly. Run the following steps in a terminal to reinstall -
By default the authentication system is disabled.
Find the variable AUTH_SYSTEM_ENABLED in the CONFIG.py file and set it to True to enable the authentication page.
If you are getting this error on Kraken, or a similar error on a different exchange this is because the exchange connector doesn't currently support market orders which the PositionExecutor needs to close the position.
If you get this error make sure that when you created the API keys you also checked the Access Websockets API option.
You'll need to approve tokens that you are trading. See below for an example if you are trading WETH on Ethereum mainnet
When approving tokens, if you get a "Token not Supported" error, please make sure to add the token address in the tokenlist manually. The token list can be found in the ./conf/list folder
Use the following command to display token balances for different networks.
This error comes up because CTRL + V doesn't work in Hummingbot. Try any of the following shortcuts below to paste.
Press CTRL + X if you want to cancel out of the configuration
If one or more tokens is showing 0 Total in ($), use the command below to change your rate oracle source. By default, the rate_oracle_source is set to Binance and if the token is not available in Binance then the Total in ($) will show 0.
**Examples:**
Example 1 (unknown):
```unknown
docker: Got permission denied while trying to connect to the Docker daemon socket at
unix:///var/run/docker.sock...
```
Example 2 (unknown):
```unknown
sudo usermod -aG docker $USER
# Restart the terminal after running the command above, if it still doesn't work try the command below
sudo chmod 666 /var/run/docker.sock
```
Example 3 (unknown):
```unknown
$ conda
-bash: conda: command not found
```
Example 4 (unknown):
```unknown
Collecting package metadata (repodata.json): / ./install: line 40: 14981 Killed...
```
---